From: Thomas Petazzoni Date: Mon, 20 Jul 2015 09:30:59 +0000 (+0200) Subject: Highlight patches with Acked/Reviewed/Tested tags X-Git-Tag: v1.0.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e13da7b7f05d1fc12d6315d99f945c91d4ae6353;p=thirdparty%2Fpatchwork.git 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 Reviewed-by: Stephen Finucane --- diff --git a/patchwork/templatetags/patch.py b/patchwork/templatetags/patch.py index 496dcfcc..3b281586 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('%s' % ( ' / '.join(titles), ' '.join(counts)))