home » zplus/clif.git
Author zPlus <zplus@peers.community> 2022-08-12 08:36:21
Committer zPlus <zplus@peers.community> 2022-08-12 08:36:21
Commit f8b00f1 (patch)
Tree c9da532
Parent(s)

Add option for escluding tags (instead of including only) from mailing-list filters.


commits diff: 8733282..f8b00f1
3 files changed, 26 insertions, 4 deletionsdownload


Diffstat
-rw-r--r-- static/css/clif.css 6
-rw-r--r-- templates/mailing_list/emails.html 13
-rw-r--r-- web.py 11

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+6/-0 M   static/css/clif.css
index 3a4612f..5cbebc0
old size: 10K - new size: 10K
@@ -262,6 +262,12 @@ div.threads {
262 262 .filters .buttons {
263 263 margin-top: 1rem;
264 264 }
265 +
266 + .filters select {
267 + border: 0;
268 + background: transparent;
269 + text-align: right;
270 + }
265 271
266 272 .thread {
267 273 }

+10/-3 M   templates/mailing_list/emails.html
index 0214e3a..6b277ec
old size: 2K - new size: 2K
@@ -3,8 +3,8 @@
3 3 {% block page_title %}Mailing list: {{ list_address }}{% endblock %}
4 4
5 5 {% block content %}
6 -
7 - <details class="filters">
6 +
7 + <details class="filters" open>
8 8 <summary>Filters</summary>
9 9
10 10 <form action="" method="get">
@@ -12,7 +12,14 @@
12 12 <div class="tag">
13 13 <b>{{ tag }}:</b>
14 14 {% for value in tags[tag]|sort %}
15 - <label><input type="checkbox" name="{{ tag }}" value="{{ value }}" {{ 'checked' if value in query_tags[tag] }} /> {{ value }}</label>
15 + {% set selected = null %}
16 + {% if '+'+value in query_tags[tag] %}{% set selected = true %}{% endif %}
17 + {% if '-'+value in query_tags[tag] %}{% set selected = false %}{% endif %}
18 + <select name="{{ tag }}">
19 + <option disabled {{ 'selected' if selected == null }}>{{ value }}</option>
20 + <option {{ 'selected' if selected == true }}>+{{ value }}</option>
21 + <option {{ 'selected' if selected == false }}>-{{ value }}</option>
22 + </select>
16 23 {% endfor %}
17 24 </div>
18 25 {% endfor %}

+10/-1 M   web.py
index d3c7cbd..4b5d942
old size: 28K - new size: 29K
@@ -790,7 +790,16 @@ def threads(repository):
790 790 keep = True
791 791 for key in query_tags.keys():
792 792 for value in query_tags[key]:
793 - if value not in thread_tags.get(key, []):
793 + action, value = value[0], value[1:]
794 +
795 + if action not in [ '+', '-' ]:
796 + bottle.abort(400, 'Bad request: {}'.format(key))
797 +
798 + if action == '+' and value not in thread_tags.get(key, []):
799 + keep = False
800 + break
801 +
802 + if action == '-' and value in thread_tags.get(key, []):
794 803 keep = False
795 804 break
796 805