Set active tag selection
This commit is contained in:
@@ -99,7 +99,11 @@ def main_page():
|
|||||||
sorted_watches.sort(key=lambda x: x['last_changed'], reverse=True)
|
sorted_watches.sort(key=lambda x: x['last_changed'], reverse=True)
|
||||||
|
|
||||||
existing_tags = datastore.get_all_tags()
|
existing_tags = datastore.get_all_tags()
|
||||||
output = render_template("watch-overview.html", watches=sorted_watches, messages=messages, tags=existing_tags)
|
output = render_template("watch-overview.html",
|
||||||
|
watches=sorted_watches,
|
||||||
|
messages=messages,
|
||||||
|
tags=existing_tags,
|
||||||
|
active_tag=limit_tag)
|
||||||
|
|
||||||
# Show messages but once.
|
# Show messages but once.
|
||||||
messages = []
|
messages = []
|
||||||
|
|||||||
@@ -140,11 +140,15 @@ body:after, body:before {
|
|||||||
|
|
||||||
.button-tag {
|
.button-tag {
|
||||||
background: rgb(99, 99, 99);
|
background: rgb(99, 99, 99);
|
||||||
/* this is a green */
|
color: #fff;
|
||||||
color: #fff;
|
font-size: 65%;
|
||||||
font-size: 65%;
|
border-bottom-left-radius: initial;
|
||||||
|
border-bottom-right-radius: initial;
|
||||||
|
}
|
||||||
|
.button-tag.active {
|
||||||
|
background: #9c9c9c;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-error {
|
.button-error {
|
||||||
background: rgb(202, 60, 60);
|
background: rgb(202, 60, 60);
|
||||||
/* this is a maroon */
|
/* this is a maroon */
|
||||||
|
|||||||
@@ -15,11 +15,12 @@
|
|||||||
<!-- user/pass r = requests.get('https://api.github.com/user', auth=('user', 'pass')) -->
|
<!-- user/pass r = requests.get('https://api.github.com/user', auth=('user', 'pass')) -->
|
||||||
</form>
|
</form>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
{% for tag in tags %}
|
{% for tag in tags %}
|
||||||
{% if tag == "" %}
|
{% 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 %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user