Set active tag selection

This commit is contained in:
Leigh Morresi
2021-01-30 12:26:22 +01:00
parent 3eaccfe5da
commit a8ae9d54aa
3 changed files with 16 additions and 7 deletions

View File

@@ -15,11 +15,12 @@
<!-- user/pass r = requests.get('https://api.github.com/user', auth=('user', 'pass')) -->
</form>
<div>
{% for tag in tags %}
{% if tag == "" %}
<a href="/" class="pure-button button-tag ">All</a>
<a href="/" class="pure-button button-tag {{'active' if active_tag == tag }}">All</a>
{% else %}
<a href="/?tag={{ tag}}" class="pure-button button-tag ">{{ tag }}</a>
<a href="/?tag={{ tag}}" class="pure-button button-tag {{'active' if active_tag == tag }}">{{ tag }}</a>
{% endif %}
{% endfor %}
</div>