Files
pillar/src/templates/_macros/_node_edit_form.jade

44 lines
882 B
Plaintext
Raw Normal View History

2016-11-02 11:42:23 +01:00
| {% macro render_field(field, type) %}
.form-group(class="{{field.name}}{% if field.errors %} error{% endif %}")
| {% if field.type == 'BooleanField' %}
.checkbox
label
| {{ field(class='checkbox') }}
2016-11-02 19:42:44 +01:00
label {{ field.name | undertitle }}
| {% elif field.type == 'FieldList' %}
2016-11-02 11:42:23 +01:00
ul.fieldlist(id="{{ type }}")
| {% for file in field %}
li.fieldlist-item
| {% for subfield in file %}
| {{ render_field(subfield) }}
| {% if subfield.name.endswith('slug') %}
button.fieldlist-action-button.js-append-attachment(
type="button")
i.pi-plus
| Append to Description
| {% endif %}
| {% endfor %}
| {% endfor %}
| {% else %}
| {{ field.label }}
| {{ field(class='form-control') }}
| {% endif %}
| {% if field.errors %}
ul.error
| {% for error in field.errors %}
li {{ error }}
| {% endfor %}
| {% endif %}
| {% endmacro %}