2016-02-23 15:45:19 +00:00
|
|
|
{% macro checkbox(
|
|
|
|
|
field,
|
|
|
|
|
hint=False,
|
2016-12-19 10:36:17 +00:00
|
|
|
width='2-3'
|
2016-02-23 15:45:19 +00:00
|
|
|
) %}
|
2016-12-19 10:36:17 +00:00
|
|
|
<div class="multiple-choice">
|
|
|
|
|
<input
|
2017-04-11 17:47:16 +01:00
|
|
|
id="{{ field.id }}" name="{{ field.name }}" type="checkbox" value="y"
|
|
|
|
|
{% if field.data %}
|
2016-12-19 10:36:17 +00:00
|
|
|
checked
|
|
|
|
|
{% endif %}
|
|
|
|
|
>
|
|
|
|
|
<label for="{{ field.id }}">
|
|
|
|
|
{{ field.label.text }}
|
|
|
|
|
{% if hint %}
|
|
|
|
|
<div class="hint">
|
|
|
|
|
{{ hint }}
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
2016-02-23 15:45:19 +00:00
|
|
|
</label>
|
2016-12-19 10:36:17 +00:00
|
|
|
</div>
|
2017-02-13 09:50:26 +00:00
|
|
|
{% endmacro %}
|
2017-09-27 10:46:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
{% macro checkbox_group(
|
|
|
|
|
legend,
|
|
|
|
|
fields
|
|
|
|
|
) %}
|
|
|
|
|
<fieldset class="form-group">
|
|
|
|
|
<legend class="form-label">
|
|
|
|
|
{{ legend }}
|
|
|
|
|
</legend>
|
|
|
|
|
{% for field in fields %}
|
|
|
|
|
{{ checkbox(field) }}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</fieldset>
|
|
|
|
|
{% endmacro %}
|