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">
|
2018-11-08 11:56:29 +00:00
|
|
|
{{ checkbox_input(field.id, field.name, field.data) }}
|
2016-12-19 10:36:17 +00:00
|
|
|
<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
|
|
|
|
|
|
|
|
|
2018-11-08 11:56:29 +00:00
|
|
|
{% macro checkbox_input(id, name, data=None, value="y") %}
|
|
|
|
|
<input
|
|
|
|
|
id="{{ id }}" name="{{ name }}" type="checkbox" value="{{ value }}"
|
|
|
|
|
{% if data %}
|
|
|
|
|
checked
|
|
|
|
|
{% endif %}
|
|
|
|
|
>
|
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
|
|
{% macro unlabelled_checkbox(id, name, data=None, value="y") %}
|
|
|
|
|
<div class="multiple-choice">
|
|
|
|
|
{{ checkbox_input(id, name, data, value) }}
|
|
|
|
|
<label></label>
|
|
|
|
|
</div>
|
|
|
|
|
{% 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 %}
|