From 26a9ed4ad423669a17492036e2beb18d33b021b4 Mon Sep 17 00:00:00 2001 From: Matt Way Date: Mon, 19 Aug 2024 00:09:58 +1000 Subject: [PATCH] Show a single red cross for candidates rated 1 or below --- php-template/template.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/php-template/template.php b/php-template/template.php index 86c6d71..328dbed 100644 --- a/php-template/template.php +++ b/php-template/template.php @@ -57,8 +57,13 @@ $candidate_image = $media['default.png']; } - $candidate_rating = str_repeat("✔️", min(5, $candidate['Rating'])); - $candidate_rating_colour = "green"; + if ($candidate['Rating'] > 1) { + $candidate_rating = str_repeat("✔️", min(5, $candidate['Rating'])); + $candidate_rating_colour = "green"; + } else { + $candidate_rating = "❌"; + $candidate_rating_colour = "red"; + } // If string is 5 ticks, insert a zero width space between the 3rd and 4th ticks so that it wraps nicer if ($candidate_rating == "✔️✔️✔️✔️✔️") {