home » zplus/clif.git
Author zPlus <zplus@peers.community> 2022-08-10 04:39:37
Committer zPlus <zplus@peers.community> 2022-08-10 04:39:37
Commit 2345b8d (patch)
Tree 0e29332
Parent(s)

fix: Duplicated mail lists filters Only show mailing-list filters once; avoid duplicate names.


commits diff: aa65aa5..2345b8d
2 files changed, 4 insertions, 5 deletionsdownload


Diffstat
-rw-r--r-- templates/mailing_list/emails.html 4
-rw-r--r-- web.py 5

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+2/-2 M   templates/mailing_list/emails.html
index 84cc3d9..0214e3a
old size: 2K - new size: 2K
@@ -8,10 +8,10 @@
8 8 <summary>Filters</summary>
9 9
10 10 <form action="" method="get">
11 - {% for tag in tags %}
11 + {% for tag in tags.keys()|sort %}
12 12 <div class="tag">
13 13 <b>{{ tag }}:</b>
14 - {% for value in tags[tag] %}
14 + {% for value in tags[tag]|sort %}
15 15 <label><input type="checkbox" name="{{ tag }}" value="{{ value }}" {{ 'checked' if value in query_tags[tag] }} /> {{ value }}</label>
16 16 {% endfor %}
17 17 </div>

+2/-3 M   web.py
index eae3fc6..d3c7cbd
old size: 28K - new size: 28K
@@ -777,15 +777,14 @@ def threads(repository):
777 777
778 778 thread_date, thread_time, thread_id, thread_title = obj.name.split(' ', 3)
779 779
780 - thread_tags = {}
781 780 try:
782 781 thread_tags = parse_thread_tags(obj['tags'].data.decode('UTF-8'))
783 782
784 783 # Collect tags for filters
785 784 for k, v in thread_tags.items():
786 - tags[k] = tags.get(k, []) + v
785 + tags[k] = tags.get(k, set()).union(v)
787 786 except:
788 - pass
787 + thread_tags = {}
789 788
790 789 # Check if we should filter out this thread from the list
791 790 keep = True