From 019090089b5be08de896a411a5696e5ea474f427 Mon Sep 17 00:00:00 2001 From: Matt Way Date: Mon, 19 Aug 2024 14:20:52 +1000 Subject: [PATCH] Only use ticks under candidates --- php-template/template.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/php-template/template.php b/php-template/template.php index 3eac697..fbd64e8 100644 --- a/php-template/template.php +++ b/php-template/template.php @@ -57,13 +57,8 @@ $candidate_image = $media['default.png']; } - if ($candidate['Rating'] > 1) { - $candidate_rating = str_repeat("✔️", min(5, $candidate['Rating'])); - $candidate_rating_colour = "green"; - } else { - $candidate_rating = "❌"; - $candidate_rating_colour = "red"; - } + $candidate_rating = str_repeat("✔️", max(0, min(5, $candidate['Rating']))); + $candidate_rating_colour = "green"; // If string is 5 ticks, insert a zero width space between the 3rd and 4th ticks so that it wraps nicer if ($candidate_rating == "✔️✔️✔️✔️✔️") {