Skip to content

Commit dfc14ea

Browse files
committed
Add description as hovertext for tags
1 parent 7ae88ae commit dfc14ea

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pgcommitfest/commitfest/templates/commitfest.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ <h3>{{p.is_open|yesno:"Active patches,Closed patches"}}</h3>
6262
<td><span class="label label-{{p.status|patchstatuslabel}}">{{p.status|patchstatusstring}}</span></td>
6363
<td style="width: min-content;">
6464
{%for t in p.tag_ids%}
65-
6665
<a href="?tag={{t}}">
67-
<span class="label" style="background: {{all_tags|tagcolor:t}};">{{all_tags|tagname:t}}</span>
66+
<span class="label" style="background: {{all_tags|tagcolor:t}};" title="{{all_tags|tagdescription:t}}">{{all_tags|tagname:t}}</span>
6867
</a>
6968
{%endfor%}
7069
</td>

pgcommitfest/commitfest/templatetags/commitfest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ def tagname(value, arg):
5656
return value[arg].name
5757

5858

59+
@register.filter(name="tagdescription")
60+
def tagdescription(value, arg):
61+
"""
62+
Looks up a tag by ID and returns its name. The filter value is the map of
63+
tags, and the argument is the ID. (Unlike tagcolor, there is no
64+
argument-less variant; just use tag.name directly.)
65+
66+
Example:
67+
tag_map|tagname:tag_id
68+
"""
69+
return value[arg].description
70+
71+
5972
@register.filter(name="tagcolor")
6073
def tagcolor(value, key=None):
6174
"""

0 commit comments

Comments
 (0)