Skip to content

Commit 4c91b2a

Browse files
committed
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 66e9108 commit 4c91b2a

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
@@ -39,12 +39,21 @@ def patch_checks(patch):
3939
counts = patch.check_count
4040

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

5059
check_elements.append(

0 commit comments

Comments
 (0)