Introducing Pillar Framework
Refactor of pillar-server and pillar-web into a single python package. This simplifies the overall architecture of pillar applications. Special thanks @sybren and @venomgfx
This commit is contained in:
34
src/templates/_macros/_node_edit_form.jade
Normal file
34
src/templates/_macros/_node_edit_form.jade
Normal file
@@ -0,0 +1,34 @@
|
||||
| {% macro render_field(field) %}
|
||||
|
||||
.form-group(class="{{field.name}}{% if field.errors %} error{% endif %}")
|
||||
|
||||
| {% if field.type == 'BooleanField' %}
|
||||
.checkbox
|
||||
label
|
||||
| {{ field(class='checkbox') }}
|
||||
| {{ field.label }}
|
||||
| {% elif field.type == 'FieldList' %}
|
||||
|
||||
ul.fieldlist#files
|
||||
| {% for file in field %}
|
||||
li.fieldlist-item
|
||||
|
||||
| {% for subfield in file %}
|
||||
| {{ render_field(subfield) }}
|
||||
| {% 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 %}
|
Reference in New Issue
Block a user