Skip to content

Commit 20e742e

Browse files
mchehabstephenfin
authored andcommitted
Add an extra style when no checks are present
On projects where all patches are meant to be checked, not having any checks mean that either the CI is still running or that CI didn't run for an specific patch. At the first case, the maintainers need to be aware to wait for CI to run; at the last case, if it takes too long, they may need to manually re-run CI or double-check resuls. Anyway, this is a sort of "error" status, so allow CSS to be able to customize it, by adding a "nochecks" state-like CSS style. Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent a844ac5 commit 20e742e

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎patchwork/templatetags/patch.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,21 @@ def patch_checks(patch):
4040
counts = patch.check_count
4141

4242
check_elements = []
43+
all_empty = True
44+
for state in required:
45+
if counts[state]:
46+
all_empty = False
47+
break
48+
4349
for state in required[::-1]:
4450
if counts[state]:
4551
color = dict(Check.STATE_CHOICES).get(state)
4652
count = str(counts[state])
4753
else:
48-
color = ''
54+
if all_empty:
55+
color = 'nochecks'
56+
else:
57+
color = ''
4958
count = '-'
5059

5160
check_elements.append(

0 commit comments

Comments
 (0)