mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00
Don't render empty <dl> tags
This commit is contained in:
parent
2c578bd15b
commit
0862b2b31c
1 changed files with 9 additions and 6 deletions
|
@ -56,15 +56,18 @@
|
|||
</div>
|
||||
|
||||
{# additional properties #}
|
||||
<dl>
|
||||
{% set dl_started = false %}
|
||||
{% for key, value in hcard %}
|
||||
{# exclude all properties previously displayed #}
|
||||
{% if key not in ['enable', 'with_mail', 'with_social_links', 'homepage', 'full_name', 'avatar', 'biography', 'p_nickname'] %}
|
||||
{% if key not in ['enable', 'with_mail', 'with_social_links', 'homepage', 'full_name', 'avatar', 'biography', 'p_nickname'] %}
|
||||
{% if not dl_started %}
|
||||
<dl>
|
||||
{% set dl_started = true %}
|
||||
{% endif %}
|
||||
<dt>{{ key | replace(from="p_", to="") | replace(from="u_", to="") | replace(from="dt_", to="") | replace(from="_", to=" ") | capitalize }}</dt>
|
||||
<dd class="{{ key | replace(from="_", to="-") }}">{{ value }}</dd>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
{% if dl_started %}
|
||||
</dl>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue