Only show tags if they exist.
parent
b1b7779309
commit
8d9bdff1e2
|
@ -47,20 +47,22 @@
|
|||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<section class="tags">
|
||||
<h2>{{ snipt.tags.all|length }} tag{{ snipt.tags.all|pluralize }}</h2>
|
||||
<ul>
|
||||
{% for tag in snipt.sorted_tags %}
|
||||
<li {% if forloop.counter > 3 and not detail %}class="hidden"{% endif %}>
|
||||
{% if public %}
|
||||
<a href="/public/tag/{{ tag.slug }}/">{{ tag }}</a>
|
||||
{% else %}
|
||||
<a href="/{{ snipt.user.username }}/tag/{{ tag.slug }}/">{{ tag }}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% if snipt.tags.all %}
|
||||
<section class="tags">
|
||||
<h2>{{ snipt.tags.all|length }} tag{{ snipt.tags.all|pluralize }}</h2>
|
||||
<ul>
|
||||
{% for tag in snipt.sorted_tags %}
|
||||
<li {% if forloop.counter > 3 and not detail %}class="hidden"{% endif %}>
|
||||
{% if public %}
|
||||
<a href="/public/tag/{{ tag.slug }}/">{{ tag }}</a>
|
||||
{% else %}
|
||||
<a href="/{{ snipt.user.username }}/tag/{{ tag.slug }}/">{{ tag }}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
</aside>
|
||||
</div>
|
||||
<footer>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<section class="tags">
|
||||
<h1>{{ user.username }}'s tags</h1>
|
||||
<ul>
|
||||
{% for t in tags %}
|
||||
<li>
|
||||
<a {% if tag.name == t.name %}class="active"{% endif %} href="/{{ user.username }}/tag/{{ t.slug }}/">{{ t.name }} ({{ t.count }})</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% if tags %}
|
||||
<section class="tags">
|
||||
<h1>{{ user.username }}'s tags</h1>
|
||||
<ul>
|
||||
{% for t in tags %}
|
||||
<li>
|
||||
<a {% if tag.name == t.name %}class="active"{% endif %} href="/{{ user.username }}/tag/{{ t.slug }}/">{{ t.name }} ({{ t.count }})</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue