summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-10-31 10:24:10 +0100
committerWojtek Kosior <koszko@koszko.org>2022-10-31 10:28:20 +0100
commitad3e7bfb2dee90dd6b5bdec73251fb0c9e9ad8aa (patch)
tree2a06f7d1ffb6a04447c44db602451a615a08659e /templates
parent987fd1483329c53a77b97b95242fdf51b209f6d6 (diff)
downloadhydrilla-common-html-jinja-templates-ad3e7bfb2dee90dd6b5bdec73251fb0c9e9ad8aa.tar.gz
hydrilla-common-html-jinja-templates-ad3e7bfb2dee90dd6b5bdec73251fb0c9e9ad8aa.zip
make section labels more flexible
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html.jinja6
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/base.html.jinja b/templates/base.html.jinja
index b0025bd..d7ec692 100644
--- a/templates/base.html.jinja
+++ b/templates/base.html.jinja
@@ -60,10 +60,12 @@ code in a proprietary work, I am not going to enforce this in court.
</aside>
{% endmacro %}
-{% macro label(label_text, label_name=none) %}
+{% macro label(label_text=none, label_name=none) %}
{% set for_attr = label_name and (label_name + "_field") %}
<label {{ {'for': for_attr, 'class': 'section-label'}|xmlattr }}>
- <span>{{ label_text }}</span>
+ {% if label_text is not none %}
+ <span>{{ label_text }}</span>
+ {% endif %}
{% if caller is defined %}
{{ caller() }}
{% endif %}