Files
notifications-admin/app/templates/components/checkbox.html
Chris Hill-Scott 2743216519 Show form elements for templates and folders
This commit adds:
- checkboxes to let you select a template or folder
- radio buttons to let you select where to move those template(s) and/or
  folder(s) to

It only does the `get` part of this work; handling the `post` and
calling API will be done in a subsequent commit.
2018-11-12 08:37:46 +00:00

49 lines
1001 B
HTML

{% macro checkbox(
field,
hint=False,
width='2-3'
) %}
<div class="multiple-choice">
{{ checkbox_input(field.id, field.name, field.data) }}
<label for="{{ field.id }}">
{{ field.label.text }}
{% if hint %}
<div class="hint">
{{ hint }}
</div>
{% endif %}
</label>
</div>
{% endmacro %}
{% 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 %}
{% macro checkbox_group(
legend,
fields
) %}
<fieldset class="form-group">
<legend class="form-label">
{{ legend }}
</legend>
{% for field in fields %}
{{ checkbox(field) }}
{% endfor %}
</fieldset>
{% endmacro %}