summaryrefslogtreecommitdiff
path: root/patchwork/templatetags
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-20 11:30:59 +0200
committerStephen Finucane <stephen.finucane@intel.com>2015-10-16 23:20:43 +0100
commite13da7b7f05d1fc12d6315d99f945c91d4ae6353 (patch)
treefc01a533cb929ee988e7824137e0908ac350f219 /patchwork/templatetags
parentd6e7b50b3f70f908d51feca596cd761545910972 (diff)
downloadpatchwork-e13da7b7f05d1fc12d6315d99f945c91d4ae6353.tar
patchwork-e13da7b7f05d1fc12d6315d99f945c91d4ae6353.tar.gz
Highlight patches with Acked/Reviewed/Tested tags
A little while ago, accounting of the number of Acked-by, Reviewed-by and Tested-by tags was added to patchwork. The count of such tags per patch is shown in the "A / R / T" column. However, since the values are shown for all patches regardless of whether they are zero or not, it makes it not very easy to spot the patches that have at least one Acked-by, Tested-by or Reviewed-by tag. Therefore, this patch proposes to replace a count of "0" by a "-". So patches with no tags will have "- - -" in their A/R/T column, and patches with some tags may get "1 - 1" for example. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
Diffstat (limited to 'patchwork/templatetags')
-rw-r--r--patchwork/templatetags/patch.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/patchwork/templatetags/patch.py b/patchwork/templatetags/patch.py
index 496dcfc..3b28158 100644
--- a/patchwork/templatetags/patch.py
+++ b/patchwork/templatetags/patch.py
@@ -30,7 +30,10 @@ def patch_tags(patch):
for tag in patch.project.tags:
count = getattr(patch, tag.attr_name)
titles.append('%d %s' % (count, tag.name))
- counts.append(str(count))
+ if count == 0:
+ counts.append("-")
+ else:
+ counts.append(str(count))
return mark_safe('<span title="%s">%s</span>' % (
' / '.join(titles),
' '.join(counts)))