home » zplus/clif.git
Author zPlus <zplus@peers.community> 2022-07-29 12:52:33
Committer zPlus <zplus@peers.community> 2022-07-29 12:52:33
Commit 01a4203 (patch)
Tree 505508a
Parent(s)

Show labels in threads list. Add labels to the list of threads in a mailing list.


commits diff: d006c2a..01a4203
3 files changed, 26 insertions, 5 deletionsdownload


Diffstat
-rw-r--r-- static/css/clif.css 7
-rw-r--r-- templates/mailing_list/emails.html 7
-rw-r--r-- web.py 17

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+7/-0 M   static/css/clif.css
index dadeb6a..be2516c
old size: 5K - new size: 5K
@@ -207,6 +207,13 @@ div.threads {
207 207 font-size: 0.8rem;
208 208 padding-top: .5rem;
209 209 }
210 +
211 + div.threads div.subtitle .tag {
212 + background: gray;
213 + border-radius: .2rem;
214 + color: white;
215 + padding: .1rem .5rem;
216 + }
210 217
211 218 .thread {
212 219 }

+7/-0 M   templates/mailing_list/emails.html
index 25166b2..ac36efc
old size: 474B - new size: 760B
@@ -9,7 +9,14 @@
9 9 <a href="{{ url('thread', repository=repository[:-10], thread_id=thread.id) }}">{{ thread.title }}</a>
10 10 </div>
11 11 <div class="subtitle">
12 + #{{ thread.id }}
12 13 Created {{ thread.datetime|ago }}
14 +
15 + {% if 'label' in thread['tags'] %}
16 + {% for label in thread['tags']['label'] %}
17 + <span class="tag">{{ label }}</span>
18 + {% endfor %}
19 + {% endif %}
13 20 </div>
14 21 </div>
15 22 {% endfor %}

+12/-5 M   web.py
index dfdc1f7..662f336
old size: 21K - new size: 22K
@@ -602,19 +602,26 @@ def threads(repository):
602 602 if obj.type != pygit2.GIT_OBJ_TREE:
603 603 continue
604 604
605 - threads_list.append(obj.name)
606 -
607 - threads_list.sort(reverse=True)
605 + threads_list.append(obj)
608 606
609 607 for i in range(0, len(threads_list)):
610 - thread_date, thread_time, thread_id, thread_title = threads_list[i].split(' ', 3)
608 + thread_date, thread_time, thread_id, thread_title = threads_list[i].name.split(' ', 3)
609 +
610 + thread_tags = {}
611 + try:
612 + thread_tags = parse_thread_tags(threads_list[i]['tags'].data.decode('UTF-8'))
613 + except:
614 + pass
611 615
612 616 threads_list[i] = {
613 617 'datetime': thread_date + ' ' + thread_time,
614 618 'id': thread_id,
615 - 'title': thread_title
619 + 'title': thread_title,
620 + 'tags': thread_tags
616 621 }
617 622
623 + threads_list.reverse()
624 +
618 625 return template('mailing_list/emails.html', threads=threads_list,
619 626 list_address=list_address,
620 627 repository=repository)