From 2b00e6c0ac25195770f73d7a821222ee9db72bc1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 8 Jun 2026 10:03:14 +0200 Subject: [PATCH] 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 --- patchwork/templatetags/patch.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/patchwork/templatetags/patch.py b/patchwork/templatetags/patch.py index c22dfa336..20b4ec824 100644 --- a/patchwork/templatetags/patch.py +++ b/patchwork/templatetags/patch.py @@ -39,12 +39,21 @@ def patch_checks(patch): counts = patch.check_count check_elements = [] + all_empty = True + for state in required: + if counts[state]: + all_empty = False + break + for state in required[::-1]: if counts[state]: color = dict(Check.STATE_CHOICES).get(state) count = str(counts[state]) else: - color = '' + if all_empty: + color = 'nochecks' + else: + color = '' count = '-' check_elements.append(