diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2015-07-20 11:30:59 +0200 |
---|---|---|
committer | Stephen Finucane <stephen.finucane@intel.com> | 2015-10-16 23:20:43 +0100 |
commit | e13da7b7f05d1fc12d6315d99f945c91d4ae6353 (patch) | |
tree | fc01a533cb929ee988e7824137e0908ac350f219 /patchwork/templatetags | |
parent | d6e7b50b3f70f908d51feca596cd761545910972 (diff) | |
download | patchwork-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.py | 5 |
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))) |