From ae766d28c07628e71629a72452261898ea72057a Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 21 Dec 2022 18:09:20 +0100 Subject: Update - This is an automated commit --- includes/banner.inc | 6 +- includes/bitset.inc | 1 + includes/days.json | 5 ++ includes/details.inc | 10 ++- includes/metadata.inc | 6 +- includes/planner.inc | 209 +++++++++++++------------------------------- includes/system/compare.inc | 13 +++ 7 files changed, 98 insertions(+), 152 deletions(-) create mode 100644 includes/days.json (limited to 'includes') diff --git a/includes/banner.inc b/includes/banner.inc index 4678a5a..1d33b43 100644 --- a/includes/banner.inc +++ b/includes/banner.inc @@ -66,7 +66,11 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $prefixes = []; foreach ($member['proxy_tags'] as $proxy) { if ($travelling[$member['id']]["travelling"]) { - $prefixes[] = "+" . $proxy["prefix"] . ($proxy["suffix"] !== "" && $proxy["suffix"] !== null ? "..." . $proxy["suffix"] : ""); + if (isset($travelling[$member['id']]['equestria']) && $travelling[$member['id']]['equestria']) { + $prefixes[] = null; + } else { + $prefixes[] = "+" . $proxy["prefix"] . ($proxy["suffix"] !== "" && $proxy["suffix"] !== null ? "..." . $proxy["suffix"] : ""); + } } else { $prefixes[] = $proxy["prefix"] . ($proxy["suffix"] !== "" && $proxy["suffix"] !== null ? "..." . $proxy["suffix"] : ""); } diff --git a/includes/bitset.inc b/includes/bitset.inc index 7d5a963..96c6bfd 100644 --- a/includes/bitset.inc +++ b/includes/bitset.inc @@ -106,6 +106,7 @@ function parseMetadata ($metadata) { $m["median"] = $metadata["median"] ?? null; $m["birth"] = $metadata["birth"] ?? null; $m["heat"] = $metadata["heat"] ?? null; + $m["code"] = $metadata["code"] ?? null; } else { $m = $metadata; } diff --git a/includes/days.json b/includes/days.json new file mode 100644 index 0000000..bfbcefa --- /dev/null +++ b/includes/days.json @@ -0,0 +1,5 @@ +{ + "2022-12-24": "Christmas Eve", + "2022-12-25": "Christmas Day", + "2022-12-31": "New Year's Eve" +} \ No newline at end of file diff --git a/includes/details.inc b/includes/details.inc index e4ee519..8fee082 100644 --- a/includes/details.inc +++ b/includes/details.inc @@ -1,5 +1,5 @@ -
; margin-left: -20px; margin-right: -20px;"> +
; margin-left: -20px; margin-right: -20px;">

+
+
+ + + + - + +
\ No newline at end of file diff --git a/includes/metadata.inc b/includes/metadata.inc index 1aa7329..04b6a9e 100644 --- a/includes/metadata.inc +++ b/includes/metadata.inc @@ -8,7 +8,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
-

+

">

@@ -45,6 +45,10 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member Age (for ponies with fixed age):
">

+

+ Member code:
+ "> +

diff --git a/includes/planner.inc b/includes/planner.inc index 72c82a5..c537d17 100644 --- a/includes/planner.inc +++ b/includes/planner.inc @@ -73,9 +73,18 @@ foreach ($raindrops as $id => $day) { function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; ?> + } + + $d = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/days.json"), true); + $t = date('Y-m-d', time() + (86400 * $diff)); + + if (isset($d[$t])) { + $display = "$display ($d[$t])"; + } + + ?> style="opacity: .75; pointer-events: none;"> - + ": - display = "today"; - break; - - case "": - display = "tomorrow"; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - } + let display = formatDate(date).display; window.selectedFronting = { system: system === "cloudburst" ? "ynmuc" : "gdapd", @@ -476,37 +435,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis } function openEditCofronter(system, id, date) { - let display; - - switch (date) { - case "": - display = "today"; - break; - - case "": - display = "tomorrow"; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - - case "": - display = "on "; - break; - } + let display = formatDate(offset).display; window.selectedFronting = { system: system === "cloudburst" ? "ynmuc" : "gdapd", @@ -525,47 +454,91 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis modal.show(); } - function addCofronter(system, offset, index) { + function formatDate(offset) { let date; let display; switch (offset) { case 0: + case "": date = ""; display = "today"; break; case 1: + case "": date = ""; display = "tomorrow"; break; case 2: + case "": date = ""; display = "on "; break; case 3: + case "": date = ""; display = "on "; break; case 4: + case "": date = ""; display = "on "; break; case 5: + case "": date = ""; display = "on "; break; case 6: + case "": date = ""; display = "on "; break; + + case 7: + case "": + date = ""; + display = "on "; + break; + + case 8: + case "": + date = ""; + display = "on "; + break; + + case 9: + case "": + date = ""; + display = "on "; + break; + + case 10: + case "": + date = ""; + display = "on "; + break; + + case 11: + case "": + date = ""; + display = "on "; + break; } + return {date, display}; + } + + function addCofronter(system, offset, index) { + let date = formatDate(offset).date; + let display = formatDate(offset).display; + window.selectedFronting = { system: system === "cloudburst" ? "ynmuc" : "gdapd", date: date, @@ -593,70 +566,8 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis } function addFronter(system, offset, index) { - let date; - let display; - - switch (offset) { - case 0: - date = ""; - display = "today"; - break; - - case 1: - date = ""; - display = "tomorrow"; - break; - - case 2: - date = ""; - display = "on "; - break; - - case 3: - date = ""; - display = "on "; - break; - - case 4: - date = ""; - display = "on "; - break; - - case 5: - date = ""; - display = "on "; - break; - - case 6: - date = ""; - display = "on "; - break; - - case 7: - date = ""; - display = "on "; - break; - - case 8: - date = ""; - display = "on "; - break; - - case 9: - date = ""; - display = "on "; - break; - - case 10: - date = ""; - display = "on "; - break; - - case 11: - date = ""; - display = "on "; - break; - } + let date = formatDate(offset).date; + let display = formatDate(offset).display; window.currentWorkingDate = date; window.addIndex = index; diff --git a/includes/system/compare.inc b/includes/system/compare.inc index 4f9711d..ea12582 100644 --- a/includes/system/compare.inc +++ b/includes/system/compare.inc @@ -37,6 +37,14 @@ function getMember(string $id) { " data-bs-toggle="tooltip"> " data-bs-toggle="tooltip"> + + Code + Code + Code + Code + Code + Code + " data-bs-toggle="tooltip"> " data-bs-toggle="tooltip"> @@ -120,6 +128,11 @@ function getMember(string $id) { } ?>" style="width:24px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/.png" alt=""> + + + + - + -- cgit