Formularios

This commit is contained in:
f 2020-05-20 19:36:05 -03:00
parent 33ddca80ba
commit ab27eaaed5
23 changed files with 126 additions and 5 deletions

1
_includes/boolean.html Symbolic link
View file

@ -0,0 +1 @@
form/boolean.html

1
_includes/email.html Symbolic link
View file

@ -0,0 +1 @@
form/email.html

View file

@ -0,0 +1,25 @@
<div class="form-check text-left">
<input
{% if include.field[1].help %}
aria-describedby="help-{{ include.field[0] }}"
{% endif %}
{% if include.field[1].required %}
required
{% endif %}
type="checkbox"
name="{{ include.field[0] }}"
id="{{ include.field[1].id | default: include.field[0] }}"
class="form-check-input" />
<label
class="form-check-label"
for="{{ include.field[1].id | default: include.field[0] }}">
{{ include.field[1].label }}
</label>
{%- if include.field[1].help -%}
<small id="help-{{ include.field[0] }}" class="form-text">
{{ include.field[1].help }}
</small>
{%- endif -%}
</div>

View file

@ -0,0 +1 @@
{% include input.html field=field %}

24
_includes/form/input.html Normal file
View file

@ -0,0 +1,24 @@
<div class="form-group">
<label for="{{ include.field[1].id | default: include.field[0] }}">
{% if include.field[1].required %}*{% endif %}
{{ include.field[1].label }}
</label>
<input
{% if include.field[1].help %}
aria-describedby="help-{{ include.field[0] }}"
{% endif %}
{% if include.field[1].required %}
required
{% endif %}
type="{{ include.field[1].type }}"
name="{{ include.field[0] }}"
id="{{ include.field[1].id | default: include.field[0] }}"
class="form-control" />
{%- if include.field[1].help -%}
<small id="help-{{ include.field[0] }}" class="form-text">
{{ include.field[1].help }}
</small>
{%- endif -%}
</div>

View file

@ -0,0 +1 @@
{% include input.html field=field %}

View file

@ -0,0 +1,30 @@
<div class="form-group">
<label for="{{ include.field[1].id | default: include.field[0] }}">
{% if include.field[1].required %}*{% endif %}
{{ include.field[1].label }}
</label>
<select
{% if include.field[1].help %}
aria-describedby="help-{{ include.field[0] }}"
{% endif %}
{% if include.field[1].required %}
required
{% endif %}
name="{{ include.field[0] }}"
id="{{ include.field[1].id | default: include.field[0] }}"
class="form-control">
<option value="" selected></option>
{%- for option in include.field[1].values -%}
<option value="{{ option }}">{{ option }}</option>
{%- endfor -%}
</select>
{%- if include.field[1].help -%}
<small id="help-{{ include.field[0] }}" class="form-text">
{{ include.field[1].help }}
</small>
{%- endif -%}
</div>

View file

@ -0,0 +1 @@
<h2 id="{{ include.field[0] }}">{{ include.field[1].title }}</h2>

View file

@ -0,0 +1 @@
<hr/>

View file

@ -0,0 +1 @@
{% include input.html field=field %}

View file

@ -0,0 +1 @@
<input type="submit" class="btn btn-success" value="{{ include.field[1].label }}" />

24
_includes/form/text.html Normal file
View file

@ -0,0 +1,24 @@
<div class="form-group">
<label for="{{ include.field[0] }}">
{% if include.field[1].required %}*{% endif %}
{{ include.field[1].label }}
</label>
<textarea
{% if include.field[1].help %}
aria-describedby="help-{{ include.field[0] }}"
{% endif -%}
{% if include.field[1].required %}
required
{% endif %}
name="{{ include.field[0] }}"
id="{{ include.field[1].id | default: include.field[0] }}"
class="form-control">
</textarea>
{%- if include.field[1].help -%}
<small id="help-{{ include.field[0] }}" class="form-text">
{{ include.field[1].help }}
</small>
{%- endif -%}
</div>

1
_includes/form/url.html Normal file
View file

@ -0,0 +1 @@
{% include input.html field=field %}

1
_includes/input.html Symbolic link
View file

@ -0,0 +1 @@
form/input.html

View file

@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light d-print-block" role="navigation" aria-label="{{ site.i18n.menu.title }}">
<a class="navbar-brand" href="">
{% include_cached logo.svg %}
{% include_cached logo.html %}
</a>
{% comment %}
@ -14,14 +14,14 @@
{% endcomment %}
<li class="nav-item">
<a class="nav-link{% if page.url == item.url %} active{% endif %}" href="{{ item.url }}">
{{ item.text }}
<a class="nav-link{% if page.url == item.href %} active{% endif %}" href="{{ item.href }}">
{{ item.title }}
{%- if page.url == item.url -%}
{%- if page.url == item.href -%}
<span class="sr-only">
{{ site.i18n.menu.active | default: '(current)' }}
</span>
{%- endif %}
{%- endif -%}
</a>
</li>
{%- endfor -%}

1
_includes/number.html Symbolic link
View file

@ -0,0 +1 @@
form/number.html

View file

@ -0,0 +1 @@
form/predefined_array.html

1
_includes/section.html Symbolic link
View file

@ -0,0 +1 @@
form/section.html

1
_includes/separator.html Symbolic link
View file

@ -0,0 +1 @@
form/separator.html

1
_includes/string.html Symbolic link
View file

@ -0,0 +1 @@
form/string.html

1
_includes/submit.html Symbolic link
View file

@ -0,0 +1 @@
form/submit.html

1
_includes/text.html Symbolic link
View file

@ -0,0 +1 @@
form/text.html

1
_includes/url.html Symbolic link
View file

@ -0,0 +1 @@
form/url.html