diff --git a/static/css/clif.css b/static/css/clif.css index 3a4612f..5cbebc0 100644 --- a/static/css/clif.css +++ b/static/css/clif.css @@ -262,6 +262,12 @@ div.threads { .filters .buttons { margin-top: 1rem; } + + .filters select { + border: 0; + background: transparent; + text-align: right; + } .thread { } diff --git a/templates/mailing_list/emails.html b/templates/mailing_list/emails.html index 0214e3a..6b277ec 100644 --- a/templates/mailing_list/emails.html +++ b/templates/mailing_list/emails.html @@ -3,8 +3,8 @@ {% block page_title %}Mailing list: {{ list_address }}{% endblock %} {% block content %} - -
+ +
Filters
@@ -12,7 +12,14 @@
{{ tag }}: {% for value in tags[tag]|sort %} - + {% set selected = null %} + {% if '+'+value in query_tags[tag] %}{% set selected = true %}{% endif %} + {% if '-'+value in query_tags[tag] %}{% set selected = false %}{% endif %} + {% endfor %}
{% endfor %} diff --git a/web.py b/web.py index d3c7cbd..4b5d942 100644 --- a/web.py +++ b/web.py @@ -790,7 +790,16 @@ def threads(repository): keep = True for key in query_tags.keys(): for value in query_tags[key]: - if value not in thread_tags.get(key, []): + action, value = value[0], value[1:] + + if action not in [ '+', '-' ]: + bottle.abort(400, 'Bad request: {}'.format(key)) + + if action == '+' and value not in thread_tags.get(key, []): + keep = False + break + + if action == '-' and value in thread_tags.get(key, []): keep = False break