mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Add ‘optional text’ macro
This pattern of value or grey text saying `None` is common enough in our app that we should codify it into a pattern. Which this commit does.
This commit is contained in:
@@ -92,6 +92,13 @@
|
||||
{% endcall %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro optional_text_field(text, default=None) -%}
|
||||
{{ text_field(
|
||||
text or default,
|
||||
status='' if text else 'default'
|
||||
) }}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro link_field(text, link) -%}
|
||||
{% call field() %}
|
||||
<a href="{{ link }}">{{ text }}</a>
|
||||
|
||||
Reference in New Issue
Block a user