mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Revert "Re-introduce govuk checkboxes"
This commit is contained in:
46
app/templates/components/checkbox.html
Normal file
46
app/templates/components/checkbox.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{% from "components/select-input.html" import select_nested, select %}
|
||||
|
||||
{% 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 checkboxes_nested(field, child_map, hint=None, disable=[], option_hints={}, hide_legend=False, collapsible_opts={}, legend_style="text") %}
|
||||
{{ select_nested(field, child_map, hint, disable, option_hints, hide_legend, collapsible_opts, legend_style, input="checkbox") }}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
{% macro checkboxes(field, hint=None, disable=[], option_hints={}, hide_legend=False, collapsible_opts={}) %}
|
||||
{{ select(field, hint, disable, option_hints, hide_legend, collapsible_opts, input="checkbox") }}
|
||||
{% 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 %}
|
||||
Reference in New Issue
Block a user