Only generate tags T div if photo has tags

This commit is contained in:
voussoir 2017-03-30 18:54:18 -07:00
parent 791172e073
commit 0580a7f162

View file

@ -45,16 +45,17 @@
<a target="_blank" href="/photo/{{photo.id}}">{{photo.basename}}</a> <a target="_blank" href="/photo/{{photo.id}}">{{photo.basename}}</a>
</div> </div>
<div class="photo_card_grid_file_metadata"> <div class="photo_card_grid_file_metadata">
<div class="photo_card_grid_tags"> {% set tags = photo.tags() %}
{% set tags = photo.tags() %} {% set tag_names = [] %}
{% set tag_names = [] %} {% for tag in tags %}
{% for tag in tags %} {% do tag_names.append(tag.name) %}
{% do tag_names.append(tag.name) %} {% endfor %}
{% endfor %} {% if tag_names %}
{% if tags %} <div class="photo_card_grid_tags">
<span title="{{", ".join(tag_names)}}">T</span> {% set tag_names = ", ".join(tag_names) %}
{% endif %} <span title="{{tag_names}}">T</span>
</div> </div>
{% endif %}
<span> <span>
{% if photo.width %} {% if photo.width %}
{{photo.width}}&times;{{photo.height}}, {{photo.width}}&times;{{photo.height}},