mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 10:54:18 +00:00
28 lines
794 B
Django/Jinja
28 lines
794 B
Django/Jinja
{% macro render_field(field) %}
|
|
<div class="input-field">
|
|
<i class="prefix">{{ field.name[0:1]|upper }}</i>
|
|
{{ field.label }}
|
|
{{ field(**kwargs)|safe }}
|
|
</div>
|
|
{% if field.errors %}
|
|
{% for error in field.errors %}
|
|
<span class="helper-text red-text">{{ error }}</span>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% macro render_field_with_value(field, corpus_file) %}
|
|
{% set field_name = field.name %}
|
|
{{ field_name }}
|
|
<div class="input-field">
|
|
<i class="prefix">{{ field.name[0:1]|upper }}</i>
|
|
{{ field.label }}
|
|
{{ field(value=corpus_file[field.name])| safe }}
|
|
</div>
|
|
{% if field.errors %}
|
|
{% for error in field.errors %}
|
|
<span class="helper-text red-text">{{ error }}</span>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endmacro %}
|