Compare commits

..

2 Commits

Author SHA1 Message Date
b4ddd94c93 Improve wrapping of 4 ticks 2024-08-19 14:21:09 +10:00
019090089b Only use ticks under candidates 2024-08-19 14:20:52 +10:00

View File

@@ -57,18 +57,17 @@
$candidate_image = $media['default.png']; $candidate_image = $media['default.png'];
} }
if ($candidate['Rating'] > 1) { $candidate_rating = str_repeat("✔️", max(0, min(5, $candidate['Rating'])));
$candidate_rating = str_repeat("✔️", min(5, $candidate['Rating']));
$candidate_rating_colour = "green"; $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 string is 5 ticks, insert a zero width space entity between the 3rd and 4th ticks so that it wraps nicer
if ($candidate_rating == "✔️✔️✔️✔️✔️") { if ($candidate_rating == "✔️✔️✔️✔️✔️") {
$candidate_rating = "✔️✔️✔️​✔️✔️"; $candidate_rating = "✔️✔️✔️​✔️✔️";
} }
// If string is 4 ticks, insert a zero width space entity between the 2nd and 3rd ticks so that it wraps nicer
if ($candidate_rating == "✔️✔️✔️✔️") {
$candidate_rating = "✔️✔️​✔️✔️";
}
?> ?>
<!-- wp:image {"id":<?php echo $candidate_image['id']; ?>,"width":"200px","height":"200px","scale":"cover","align":"center","style":{"color":{}},"className":"is-resized"} --> <!-- wp:image {"id":<?php echo $candidate_image['id']; ?>,"width":"200px","height":"200px","scale":"cover","align":"center","style":{"color":{}},"className":"is-resized"} -->