mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Refactor on/off table fields into component
There’s a lot of repeated code in our Jinja templates for the settings page. We already have a `boolean_field` component, but it’s not used anywhere (it was just lifted from Digital Marketplace). So this commit changes the `boolean_field` component to be useful for our on/off use case, and wires it into the settings page.
This commit is contained in:
@@ -105,10 +105,8 @@
|
||||
{% endcall %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro boolean_field(yes) -%}
|
||||
{% call field(status='yes' if yes else 'no') %}
|
||||
{{ "Yes" if yes else "No" }}
|
||||
{% endcall %}
|
||||
{% macro boolean_field(value) -%}
|
||||
{{ text_field('On' if value else 'Off') }}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro right_aligned_field_heading(text) %}
|
||||
|
||||
Reference in New Issue
Block a user