Child: [14e3f4] (diff)

Download this file

forge_form.html    48 lines (45 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<form method="{{method}}"
{% if enctype %}enctype="{{enctype}}"{% endif %}
action="{{action}}">
{% set extra_width = 0 %}
{% if style == 'wide' %}
{% set extra_width = 4 %}
{% endif %}
{% if errors and not errors.iteritems and show_errors %}
<div class="grid-{{19 + extra_width}}"><span {{widget.j2_attrs({'class':error_class})}}>{{errors}}</span></div>
{% endif %}
{% for field in widget.fields %}
{% set ctx=widget.context_for(field) %}
{% if field.field_type != 'hidden' %}
<div class="fieldcontainer
{% if ctx.errors and field.show_errors %}fielderror{% endif %}">
{% if field.show_label and field.label %}
<label for="{{ctx.id}}" class="grid-4">{{field.label}}:</label>
{{field.display(**ctx)}}
{% else %}
{{field.display(**ctx)}}
{% endif %}
<span {{widget.j2_attrs({'class':error_class})}}>
<div class="arrow"></div>
<span class="msg">
{% if ctx.errors and field.show_errors -%}
{{ctx.errors}}
{% endif %}
</span>
</span>
</div>
{% else %}
{{field.display(**ctx)}}
{% endif %}
{% endfor %}
{% if buttons %}
<label class="grid-4">&nbsp;</label>
<div class="grid-{{15 + extra_width}}">
{% for b in buttons %}
{{b.display()}}
{% endfor %}
</div>
{% endif %}
{% if widget.antispam %}{% for fld in g.antispam.extra_fields() %}
{{fld}}{% endfor %}{% endif %}
</form>