Sha256: d127def8860d09599c4ff9a89c524022723b3beb4c3e7852e74973a3e30bb77f

Contents?: true

Size: 1.77 KB

Versions: 8

Compression:

Stored size: 1.77 KB

Contents

{%- comment -%}

Form: type input

@param :form [String] El formulario
@param :field [Integer] El campo del formulario
@param :input_class [String] Las clases del componente
{%- endcomment -%}

{% if include.form %}
  {%- assign name = include.field[0] | append: ']' | prepend: '[' | prepend: include.form -%}
  {%- assign id = include.field[1].id | default: name | replace: '[', '_' | remove: ']' -%}
{% else %}
  {%- assign name = include.field[0] -%}
  {%- assign id = include.field[1].id | default: name %}
{% endif %}

{%- assign label = include.field[1].label[site.locale] -%}
{%- assign help = include.field[1].help[site.locale] -%}
{%- assign error = include.field[1].error[site.locale] -%}
{%- assign autocomplete = include.field[1].autocomplete -%}
{%- assign placeholder = include.field[1].placeholder[site.locale] -%}

<div class="form-group">
  {% if include.field[1].label %}
    <label for="{{ id }}">
      {{ label }}
      {% if include.field[1].required %}*{% endif %}
    </label>
  {% endif %}

  <input
    {% if include.field[1].placeholder %}
      placeholder="{{ placeholder }}"
    {% endif %}
    {{ include.field[1].extra.input }}
    {% if help %}
      aria-describedby="help-{{ id }}"
    {% endif %}
    {% if include.field[1].required %}
      required
    {% endif %}
    type="{{ include.field[1].type }}"
    name="{{ name }}"
    id="{{ id }}"
    {% if autocomplete %}
      autocomplete="{{ autocomplete }}"
    {% endif %}
    class="form-control {{ include.input_class }}" />

  {%- if error -%}
    <div class="invalid-feedback">{{ error }}</div>
  {%- endif -%}

  {%- if error -%}
    <div class="invalid-feedback">{{ error }}</div>
  {%- endif -%}

  {%- if help -%}
    <small id="help-{{ id }}" class="form-text">
      {{ help }}
    </small>
  {%- endif -%}
</div>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
editorial-autogestiva-jekyll-theme-0.5.0rc8 _includes/input.html
editorial-autogestiva-jekyll-theme-0.5.0rc7 _includes/input.html
editorial-autogestiva-jekyll-theme-0.5.0rc6 _includes/input.html
editorial-autogestiva-jekyll-theme-0.5.0rc5 _includes/input.html
editorial-autogestiva-jekyll-theme-0.5.0rc4 _includes/input.html
editorial-autogestiva-jekyll-theme-0.5.0rc3 _includes/input.html
editorial-autogestiva-jekyll-theme-0.5.0rc2 _includes/input.html
editorial-autogestiva-jekyll-theme-0.5.0rc1 _includes/input.html