Compare commits

...

2 Commits

2 changed files with 51 additions and 37 deletions

View File

@ -1,40 +1,43 @@
<div class="{{ content.css_classes }}">
{% block root %}
<div class="{{ content.css_classes }}">
{% block errors %}
{% if content.errors|length %}
<ul class="form-field-errors">
{% for error in content.errors %}
<li class="error">{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
{% block label %}
{% if content.label %}
<label {% if content.id %}for="{{ content.id }}"{% endif %}>{{ content.label }}</label>
{% endif %}
{% endblock %}
{% block field %}
<input
{% if content.id %}
id="{{ content.id }}"
{% block label %}
{% if content.label %}
<label {% if content.id %}for="{{ content.id }}"{% endif %}>{{ content.label }}</label>
{% endif %}
{% if not content.valid %}
class="invalid"
{% endif %}
type="{{ content.input_type }}"
name="{{ content.name_qualified }}"
{% if not content.value is none %}
value="{{ content.value }}"
{% endif %}
/>
{% endblock %}
{% endblock %}
{% block help %}
{% if content.help %}
<aside class="form-field-help">{{ content.help }}</aside>
{% endif %}
{% endblock %}
</div>
{% block field %}
<input
{% if content.id %}
id="{{ content.id }}"
{% endif %}
{% if not content.valid %}
class="invalid"
{% endif %}
type="{{ content.input_type }}"
name="{{ content.name_qualified }}"
{% if not content.value is none %}
value="{{ content.value }}"
{% endif %}
/>
{% endblock %}
{% block help %}
{% if content.help %}
<aside class="form-field-help">{{ content.help }}</aside>
{% endif %}
{% endblock %}
{% block errors %}
{% if content.errors|length %}
<ul class="form-field-errors">
{% for error in content.errors %}
<li class="error">{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
</div>
{% endblock %}

View File

@ -23,3 +23,14 @@
{% endif %}
/>
{% endblock %}
{% block root %}
<div class="{{ content.css_classes }}">
{{ self.field() }}
{{ self.label() }}
{{ self.help() }}
{{ self.errors() }}
</div>
{% endblock %}