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 deletions
—
download
Diffstat
Diff options
+6/-0
M static/css/clif.css
+10/-3
M templates/mailing_list/emails.html
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
|
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
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
|
|
|