summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/account.inc15
-rw-r--r--pages/alerts.inc15
-rw-r--r--pages/api/2023ui.php5
-rw-r--r--pages/docs.inc2
-rw-r--r--pages/evening.inc308
-rw-r--r--pages/jobs.inc12
-rw-r--r--pages/lists.inc15
-rw-r--r--pages/money.inc44
-rw-r--r--pages/schedules.inc10
-rw-r--r--pages/travelling.inc6
10 files changed, 109 insertions, 323 deletions
diff --git a/pages/account.inc b/pages/account.inc
new file mode 100644
index 0000000..c1c5d52
--- /dev/null
+++ b/pages/account.inc
@@ -0,0 +1,15 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
+
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
+
+<br>
+<div class="container">
+ <div id="page-content">
+ <h2>Account and security</h2>
+ </div>
+</div>
+
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/alerts.inc b/pages/alerts.inc
new file mode 100644
index 0000000..b58a9ce
--- /dev/null
+++ b/pages/alerts.inc
@@ -0,0 +1,15 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
+
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
+
+<br>
+<div class="container">
+ <div id="page-content">
+ <h2>Alerts</h2>
+ </div>
+</div>
+
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/api/2023ui.php b/pages/api/2023ui.php
new file mode 100644
index 0000000..0501b9a
--- /dev/null
+++ b/pages/api/2023ui.php
@@ -0,0 +1,5 @@
+<?php
+
+setcookie("new2023UI", "yes", time() + 86400*365, "/", "", true, true);
+header("Location: /?ui2023intro");
+die(); \ No newline at end of file
diff --git a/pages/docs.inc b/pages/docs.inc
index 9fd9bf3..58256c7 100644
--- a/pages/docs.inc
+++ b/pages/docs.inc
@@ -395,6 +395,7 @@ function showDocument($item) { ?>
}
</script>
<style>
+ <?php global $use2023UI; if (!$use2023UI): ?>
.list-group-item {
color: #fff;
background-color: #222;
@@ -417,6 +418,7 @@ function showDocument($item) { ?>
background-color: #272727;
color: #bbb;
}
+ <?php endif; ?>
</style>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/evening.inc b/pages/evening.inc
index f40cb20..59c34e4 100644
--- a/pages/evening.inc
+++ b/pages/evening.inc
@@ -1,311 +1,11 @@
<?php
-$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", "[]");
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", "{}");
-
-if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
-$pairs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/pairs.json"), true);
-$ignored = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json"), true);
-$locked = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json"), true);
-
-if (isset($_GET["ignore"]) && isset($_GET["day"])) {
- if ($_GET["ignore"] === "1") {
- if (preg_match("/^\d{4}-\d{2}-\d{2}$/m", $_GET["day"]) === false) {
- header("Location: /-/evening");
- die();
- }
-
- if (!in_array($_GET["day"], $ignored)) {
- $ignored[] = $_GET["day"];
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", json_encode($ignored));
- header("Location: /-/evening");
- die();
- } elseif ($_GET["ignore"] === "0") {
- if (preg_match("/^\d{4}-\d{2}-\d{2}$/m", $_GET["day"]) === false) {
- header("Location: /-/evening");
- die();
- }
-
- if (in_array($_GET["day"], $ignored)) {
- unset($ignored[array_search($_GET["day"], $ignored)]);
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", json_encode($ignored));
- header("Location: /-/evening");
- die();
- }
-
- die();
-}
-
-if (isset($_GET["lock"]) && isset($_GET["day"]) && isset($_GET["data"])) {
- if (isset($locked[$_GET["day"]])) {
- unset($locked[$_GET["day"]]);
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", json_encode($locked));
- header("Location: /-/evening");
- die();
- } else {
- $locked[$_GET["day"]] = $_GET["data"];
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", json_encode($locked));
- header("Location: /-/evening");
- die();
- }
-}
-
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
-
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json", "{}");
-$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json"), true);
-
-if (!isset($cache["content"]) || date('Y-m-d') !== $cache["day"]) {
- ob_start();
-
- $members = $members = [
- ...array_map(function ($i) {
- $system = "ynmuc";
- $i["_lastFronted"] = -1;
- $id = $i["id"];
- $memberData = $i;
-
- $fronters = array_map(function ($item) {
- return $item["id"];
- }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]);
-
- if (in_array($id, $fronters)) {
- $i["_lastFronted"] = time();
- } else {
- $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true);
-
- $thisMember = array_filter($switches, function ($item) use ($memberData) {
- return in_array($memberData["id"], $item["members"]);
- });
-
- $thisMember = array_values($thisMember);
- $frontingEnd = null;
-
- if (count($thisMember) > 0) {
- $thisIndex = array_search($thisMember[0], $switches);
-
- $frontingStart = $thisMember[0];
- $frontingEnd = $switches[$thisIndex - 1];
- }
-
- if ($frontingEnd !== null && isset($frontingStart)) {
- $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]);
- }
- }
-
- return $i;
- }, array_values(array_filter(scoreOrderGlobal(), function ($i) {
- return $i["_system"] === "ynmuc";
- }))),
- ...array_map(function ($i) {
- $system = "gdapd";
- $i["_lastFronted"] = -1;
- $id = $i["id"];
- $memberData = $i;
-
- $fronters = array_map(function ($item) {
- return $item["id"];
- }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]);
-
- if (in_array($id, $fronters)) {
- $i["_lastFronted"] = time();
- } else {
- $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true);
-
- $thisMember = array_filter($switches, function ($item) use ($memberData) {
- return in_array($memberData["id"], $item["members"]);
- });
-
- $thisMember = array_values($thisMember);
- $frontingEnd = null;
-
- if (count($thisMember) > 0) {
- $thisIndex = array_search($thisMember[0], $switches);
-
- $frontingStart = $thisMember[0];
- $frontingEnd = $switches[$thisIndex - 1];
- }
-
- if ($frontingEnd !== null && isset($frontingStart)) {
- $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]);
- }
- }
-
- return $i;
- }, array_values(array_filter(scoreOrderGlobal(), function ($i) {
- return $i["_system"] === "gdapd";
- })))
- ];
-
- ?>
-
-<style>
- @media (max-width: 767px) {
- .member-name, .member-list-separator {
- display: none;
- }
-
- .member-collection {
- width: 100%;
- text-align: center;
- }
- }
-
- .member-link:hover {
- opacity: .75;
- }
-</style>
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
<br>
-<div class="container">
- <div>
- <h2><?= $pages["evening"]["name"][$lang["_name"]] ?><?= time() >= 1686787200 ? "" : " (Beta)" ?></h2>
-
- <?php if (time() < 1686787200): ?>
- <div class="alert alert-warning">
- <b>The evening schedule will replace the fronting schedule starting June 15<sup>th</sup>.</b> The fronting schedule page contains more information and shows the schedule up to that date. The evening schedule is experimental until then.
- </div>
- <?php endif; ?>
-
- <details>
- <summary style="list-style: none; outline: none; cursor: text;">
- <p>Click on the "Ignore" button to mark an evening as ignored and shift the schedule one day after. You can revert this by clicking on "Unignore".</p>
- </summary>
- <ul>
- <?php usort($pairs, function ($a, $b) use ($members) {
- $times = [];
-
- foreach ($a[0] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
- foreach ($a[1] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
-
- $timeA = time() - min($times);
- $times = [];
-
- foreach ($b[0] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
- foreach ($b[1] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
-
- $timeB = time() - min($times);
-
- return $timeB - $timeA;
- }); $pairs = array_values($pairs); foreach ($pairs as $pair): $times = []; ?>
- <li>
- <?php foreach ($pair[0] as $id): ?>
- <img style="width: 24px;" src="<?= getAsset("ynmuc", $id) ?>"> <?= getMemberWithoutSystem($id)["display_name"] ?>
- <?php $times[] = getLastFronted($members, $id); endforeach; ?>
- with
- <?php foreach ($pair[1] as $id): ?>
- <img style="width: 24px;" src="<?= getAsset("gdapd", $id) ?>"> <?= getMemberWithoutSystem($id)["display_name"] ?>
- <?php $times[] = getLastFronted($members, $id); endforeach; ?>
- (<?= time() - max($times) ?>)
- </li>
- <?php endforeach; ?>
- </ul>
- </details>
-
- <?php $listI = 0; for ($i = 0; $i < 15; $i++): $pair = $pairs[$listI];
- $realPair = $pair;
-
- if (isset($locked[date('Y-m-d', time() + 86400 * $i)])) {
- $pair = array_map(function ($i) {
- return explode(",", $i);
- }, explode("|", $locked[date('Y-m-d', time() + 86400 * $i)]));
- }
-
- if (time() + 86400 * $i >= 1686787200): ?>
- <h4><?= date('l j', time() + 86400 * $i) ?></h4>
- <div style="display: grid; grid-template-columns: repeat(2, 1fr) 100px 150px; grid-gap: 20px; margin-bottom: 10px;">
- <div style="display: flex; align-items: center;<?php if (in_array(date('Y-m-d', time() + 86400 * $i), $ignored)): ?>opacity: .75; filter: saturate(0);<?php endif; ?>">
- <div class="member-collection">
- <?php foreach ($pair[0] as $id): ?>
- <a class="member-link <?php if (isset($locked[date('Y-m-d', time() + 86400 * $i)])): ?>text-warning" style="font-weight: bold;<?php endif; ?>" href="/<?= getMemberWithoutSystem($id)["name"] ?>"><img style="width: 24px;" src="<?= getAsset("ynmuc", $id, "heads") ?>"> <span class="member-name" style="<?php if (in_array(date('Y-m-d', time() + 86400 * $i), $ignored)): ?>text-decoration: line-through;<?php endif; ?>"><?= getMemberWithoutSystem($id)["display_name"] ?></span></a><br class="member-list-separator">
- <?php $times[] = getLastFronted($members, $id); endforeach; ?>
- </div>
- </div>
- <div style="display: flex; align-items: center;<?php if (in_array(date('Y-m-d', time() + 86400 * $i), $ignored)): ?>opacity: .75; filter: saturate(0);<?php endif; ?>">
- <div class="member-collection">
- <?php foreach ($pair[1] as $id): ?>
- <a class="member-link <?php if (isset($locked[date('Y-m-d', time() + 86400 * $i)])): ?>text-warning" style="font-weight: bold;<?php endif; ?>" href="/<?= getMemberWithoutSystem($id)["name"] ?>"><img style="width: 24px;" src="<?= getAsset("gdapd", $id, "heads") ?>"> <span class="member-name" style="<?php if (in_array(date('Y-m-d', time() + 86400 * $i), $ignored)): ?>text-decoration: line-through;<?php endif; ?>"><?= getMemberWithoutSystem($id)["display_name"] ?></span></a><br class="member-list-separator">
- <?php $times[] = getLastFronted($members, $id); endforeach; ?>
- </div>
- </div>
- <div style="display: flex; align-items: center; justify-content: center;">
- <?php
-
- $times = [];
-
- foreach ($pair[0] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
- foreach ($pair[1] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
-
- $time = time() - min($times);
- echo(timeAgo(time() - $time));
-
- ?>
- </div>
- <div style="display: flex; align-items: center; justify-content: center;">
- <?php if (isset($locked[date('Y-m-d', time() + 86400 * $i)])): ?>
- <a href="?lock&day=<?= date('Y-m-d', time() + 86400 * $i) ?>&data=<?= implode(",", $pair[0]) . "|" . implode(",", $pair[1]) ?>" class="btn btn-outline-secondary">Unlock</a>
- <?php else: ?>
- <a href="?lock&day=<?= date('Y-m-d', time() + 86400 * $i) ?>&data=<?= implode(",", $pair[0]) . "|" . implode(",", $pair[1]) ?>" class="btn btn-outline-primary">Lock</a>
- <?php endif; ?>&nbsp;&nbsp;
- <?php if (in_array(date('Y-m-d', time() + 86400 * $i), $ignored)): ?>
- <a href="?ignore=0&day=<?= date('Y-m-d', time() + 86400 * $i) ?>" class="btn btn-outline-success">Unignore</a>
- <?php else: ?>
- <a href="?ignore=1&day=<?= date('Y-m-d', time() + 86400 * $i) ?>" class="btn btn-outline-danger">Ignore</a>
- <?php endif; ?>
- </div>
- </div>
- <?= $i < 14 ? "<hr>" : "" ?>
- <?php endif;
-
- if (
- (!isset($locked[date('Y-m-d', time() + 86400 * $i)]) && !in_array(date('Y-m-d', time() + 86400 * $i), $ignored))
- || (isset($locked[date('Y-m-d', time() + 86400 * $i)]) && $locked[date('Y-m-d', time() + 86400 * $i)] === implode(",", $realPair[0]) . "|" . implode(",", $realPair[1]))
- ) {
- $listI++;
- }
-
- if ($listI === count($pairs)) $listI = 0; endfor; ?>
- </div>
-</div>
-<?php
-
- $cache["content"] = ob_get_contents();
- $cache["day"] = date('Y-m-d');
- ob_end_clean();
-}
-
-echo($cache["content"]);
-file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json", json_encode($cache));
-
-?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fragments/evening.inc"; ?>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/jobs.inc b/pages/jobs.inc
index c00e35c..3c0bb3d 100644
--- a/pages/jobs.inc
+++ b/pages/jobs.inc
@@ -17,6 +17,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
<style>
+ <?php global $use2023UI; if (!$use2023UI): ?>
.list-group-item {
color: #fff;
background-color: #222;
@@ -40,16 +41,27 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
color: #bbb;
}
+ <?php endif; ?>
+
details[open] summary {
font-weight: bold;
}
+ <?php if ($use2023UI): ?>
+ pre {
+ background: var(--palette-4);
+ color: var(--palette-6);
+ padding: 10px 20px;
+ margin-top: 10px;
+ }
+ <?php else: ?>
pre {
background: #000000;
color: #ffffff;
padding: 10px 20px;
margin-top: 10px;
}
+ <?php endif; ?>
pre.last {
margin-bottom: 0;
diff --git a/pages/lists.inc b/pages/lists.inc
new file mode 100644
index 0000000..2b507f4
--- /dev/null
+++ b/pages/lists.inc
@@ -0,0 +1,15 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
+
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
+
+<br>
+<div class="container">
+ <div id="page-content">
+ <h2>Member lists</h2>
+ </div>
+</div>
+
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/money.inc b/pages/money.inc
index 7c6fc55..aa2e57e 100644
--- a/pages/money.inc
+++ b/pages/money.inc
@@ -185,6 +185,7 @@ function getMonthlyEarnings(): array {
opacity: .5;
}
+ <?php global $use2023UI; if (!$use2023UI): ?>
.list-group-item {
color: #fff;
background-color: #222;
@@ -216,6 +217,7 @@ function getMonthlyEarnings(): array {
border: 1px solid rgba(255, 255, 255, .2);
background-color: #111;
}
+ <?php endif; ?>
.btn-close {
filter: invert(1);
@@ -276,6 +278,8 @@ function getMonthlyEarnings(): array {
$dates[] = date('j M Y, H:i', strtotime($transaction["date"]));
}
+ global $palette;
+
?>
<script>
const ctx3 = document.getElementById('history').getContext('2d');
@@ -286,8 +290,9 @@ function getMonthlyEarnings(): array {
datasets: [{
label: 'Balance',
data: JSON.parse(`<?= json_encode($history) ?>`),
- borderColor: '#b9f1ef',
- backgroundColor: '#B9F1EF77'
+ borderColor: '#<?= $use2023UI ? $palette[9] : "b9f1ef" ?>',
+ backgroundColor: '#<?= $use2023UI ? $palette[9] : "b9f1ef77" ?>',
+ lineTension: 0.4
}]
},
options: {
@@ -308,7 +313,7 @@ function getMonthlyEarnings(): array {
},
elements: {
point: {
- radius: 5
+ radius: 0
}
},
plugins: {
@@ -420,8 +425,9 @@ function getMonthlyEarnings(): array {
datasets: [{
label: 'Balance',
data: JSON.parse(`<?= json_encode($history) ?>`),
- borderColor: '#ff6ae6',
- backgroundColor: '#ff6ae677'
+ borderColor: '#<?= $use2023UI ? $palette[9] : "ff6ae6" ?>',
+ backgroundColor: '#<?= $use2023UI ? $palette[9] : "ff6ae677" ?>',
+ lineTension: 0.4
}]
},
options: {
@@ -442,7 +448,7 @@ function getMonthlyEarnings(): array {
},
elements: {
point: {
- radius: 5
+ radius: 0
}
},
plugins: {
@@ -572,8 +578,9 @@ function getMonthlyEarnings(): array {
datasets: [{
label: 'Balance',
data: JSON.parse(`<?= json_encode($history) ?>`),
- borderColor: '#d7e1ff',
- backgroundColor: '#d7e1ff77'
+ borderColor: '#<?= $use2023UI ? $palette[9] : "d7e1ff" ?>',
+ backgroundColor: '#<?= $use2023UI ? $palette[9] : "d7e1ff77" ?>',
+ lineTension: 0.4
}]
},
options: {
@@ -594,7 +601,7 @@ function getMonthlyEarnings(): array {
},
elements: {
point: {
- radius: 5
+ radius: 0
}
},
plugins: {
@@ -617,7 +624,7 @@ function getMonthlyEarnings(): array {
<?php else: $account = array_values(array_filter($accounts, function ($i) use ($parts) { return $i["_name"] === $parts[2]; }))[0]; ?>
<h2>
<?= $account["owner"] === "cloudburst" ? "Cloudburst System" : "Raindrops System" ?> · <?= $account["name"] ?><?php if ($account["default"]): ?><span class="text-muted"> (default)</span><?php endif; ?>
- <a href="/-/money" class="small btn btn-outline-light" style="float:right;margin-top:5px;vertical-align:middle;opacity:1 !important; color:white;">Back</a>
+ <a href="/-/money" class="small btn btn-outline-<?= $use2023UI ? "primary" : "light" ?>" style="float:right;margin-top:5px;vertical-align:middle;opacity:1 !important; <?= $use2023UI ? "" : "color: white;" ?>">Back</a>
</h2>
<div style="display: grid; grid-template-columns: max-content 1fr; grid-gap: 15px;">
<h3 style="margin-bottom: 0; display: flex; align-items: center; justify-content: center;"><?= $account["currency"] === "gbp" ? "£" : "€" ?><?= calculateFullAmount($account) ?></h3>
@@ -644,6 +651,8 @@ function getMonthlyEarnings(): array {
$dates[] = date('j M Y, H:i', strtotime($transaction["date"]));
}
+ global $palette;
+
?>
<script>
const ctx = document.getElementById('history').getContext('2d');
@@ -654,8 +663,9 @@ function getMonthlyEarnings(): array {
datasets: [{
label: 'Balance',
data: JSON.parse(`<?= json_encode($history) ?>`),
- borderColor: '#<?= $account["owner"] === "cloudburst" ? "ff6ae6" : "d7e1ff" ?>',
- backgroundColor: '#<?= $account["owner"] === "cloudburst" ? "ff6ae6" : "d7e1ff" ?>77'
+ borderColor: '#<?= $use2023UI ? $palette[9] : ($account["owner"] === "cloudburst" ? "ff6ae6" : "d7e1ff") ?>',
+ backgroundColor: '#<?=$use2023UI ? $palette[9] : ($account["owner"] === "cloudburst" ? "ff6ae677" : "d7e1ff77") ?>',
+ lineTension: 0.4
}]
},
options: {
@@ -676,7 +686,7 @@ function getMonthlyEarnings(): array {
},
elements: {
point: {
- radius: 5
+ radius: 0
}
},
plugins: {
@@ -699,9 +709,9 @@ function getMonthlyEarnings(): array {
<hr>
<div class="list-group">
- <a href="#" data-bs-toggle="modal" data-bs-target="#create" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;"><img src="/assets/icons/add.svg" style="filter: invert(1); margin-right: 10px; height: 32px; width: 32px;"><div style="display: flex; align-items: center;"><b>Add new transaction</b></div></a>
+ <a href="#" data-bs-toggle="modal" data-bs-target="#create" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;"><img src="<?= $use2023UI ? icon('add', null, true) : "/assets/icons/add.svg" ?>" style="filter: invert(1); margin-right: 10px; height: 32px; width: 32px;"><div style="display: flex; align-items: center;"><b>Add new transaction</b></div></a>
<?php foreach ($account["transactions"] as $index => $transaction): $member = getMemberWithoutSystem($transaction["author"]) ?? getMemberWithoutSystem("zdtsg"); ?>
- <a id="transaction-<?= $index ?>" onclick="deleteTransaction(<?= $index ?>)" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;cursor:pointer;"><div style="display: flex; align-items: center;"><img src="<?= getAsset($member["_system"], $member["id"]) ?>" style="border-radius: 999px; width: 32px; height: 32px; margin-right: 10px;"></div><div style="display: flex; align-items: center;"><div><b><?= $member["display_name"] ?? $member["name"] ?></b><?= $transaction["amount"] < 0 ? " removed" : " added" ?>&nbsp;<span class="<?= $transaction["amount"] < 0 ? "text-danger" : "text-success" ?>"><?= $account["currency"] === "gbp" ? "£" : "€" ?><?= number_format(abs($transaction["amount"]), 2, '.', ',') ?>&nbsp;</span><?= timeAgo($transaction["date"]) ?><?php if (isset($transaction["description"]) && trim($transaction["description"]) !== "" && (!isset($transaction["initial"]) || !$transaction["initial"])): ?>: <?= strip_tags(trim($transaction["description"])) ?><?php endif; ?><?php if (isset($transaction["initial"]) && $transaction["initial"]): ?> <span class="badge bg-secondary rounded-pill">Initial amount</span><?php endif; ?></div></div></a>
+ <a id="transaction-<?= $index ?>" onclick="deleteTransaction(<?= $index ?>)" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;cursor:pointer;"><div style="display: flex; align-items: center;"><img src="<?= getAsset($member["_system"], $member["id"]) ?>" style="border-radius: 999px; width: 32px; height: 32px; margin-right: 10px;"></div><div style="display: flex; align-items: center;"><div><b><?= $member["display_name"] ?? $member["name"] ?></b><?= $transaction["amount"] < 0 ? " removed" : " added" ?>&nbsp;<span class="<?= $transaction["amount"] < 0 ? "text-danger" : "text-success" ?>"><?= $account["currency"] === "gbp" ? "£" : "€" ?><?= number_format(abs($transaction["amount"]), 2, '.', ',') ?>&nbsp;</span><?= timeAgo($transaction["date"]) ?><?php if (isset($transaction["description"]) && trim($transaction["description"]) !== "" && (!isset($transaction["initial"]) || !$transaction["initial"])): ?>: <?= strip_tags(trim($transaction["description"])) ?><?php endif; ?><?php if (isset($transaction["initial"]) && $transaction["initial"]): ?> <span class="badge bg-<?= $use2023UI ? "success" : "secondary" ?> rounded-pill">Initial amount</span><?php endif; ?></div></div></a>
<?php endforeach; ?>
</div>
@@ -733,7 +743,7 @@ function getMonthlyEarnings(): array {
</p>
<p>Deleting a transaction takes effect immediately and cannot be undone.</p>
- <a href="#" id="delete-link" class="btn btn-danger">Delete</a>
+ <a href="#" id="delete-link" class="btn btn-<?= $use2023UI ? "primary" : "danger" ?>">Delete</a>
</div>
</div>
</div>
@@ -769,7 +779,7 @@ function getMonthlyEarnings(): array {
</p>
<p>Adding a transaction takes effect immediately and cannot be modified afterwards.</p>
- <button id="delete-link" class="btn btn-success">Create</button>
+ <button id="delete-link" class="btn btn-<?= $use2023UI ? "primary" : "success" ?>">Create</button>
</form>
</div>
</div>
diff --git a/pages/schedules.inc b/pages/schedules.inc
index 55f7670..03277cc 100644
--- a/pages/schedules.inc
+++ b/pages/schedules.inc
@@ -1,8 +1,11 @@
<?php
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $app;
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly; global $isNormallyLoggedIn;
+global $use2023UI;
+
?>
<style>
@@ -30,6 +33,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; glob
<div class="container">
<h2>Schedules</h2>
+ <h4>World clock</h4>
+
<div id="schedules" style="margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 20px;">
<div>
<div id="live-time-other2-outer" class="day-gradient" style="text-align: center; background-color: rgba(255, 255, 255, .1); padding: 20px 0; border-radius: 10px; margin-bottom: 20px;">
@@ -143,4 +148,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; glob
}, 10000);
</script>
+<?php if ($use2023UI) {
+ echo "<div class='container'><hr></div>";
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fragments/evening.inc";
+} ?>
+
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/travelling.inc b/pages/travelling.inc
index 7eb3dfa..c7eaadf 100644
--- a/pages/travelling.inc
+++ b/pages/travelling.inc
@@ -106,6 +106,8 @@ if (isset($_GET['toggleTravel']) && $isLoggedIn) {
die();
}
+global $use2023UI;
+
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
global $travelling;
@@ -163,7 +165,7 @@ global $travelling;
<div>
<?php if ($travelling[$member['id']]["travelling"]): ?>
<div class="dropdown">
- <button type="button" class="btn btn-outline-danger dropdown-toggle" data-bs-toggle="dropdown" <?= $isLowerLoggedIn ? "disabled" : "" ?>>
+ <button type="button" class="btn btn-outline-<?= $use2023UI ? "primary" : "danger" ?> dropdown-toggle" data-bs-toggle="dropdown" <?= $isLowerLoggedIn ? "disabled" : "" ?>>
Stop travelling
</button>
<ul class="dropdown-menu">
@@ -172,7 +174,7 @@ global $travelling;
</div>
<?php else: ?>
<div class="dropdown">
- <button type="button" class="btn btn-outline-success dropdown-toggle" data-bs-toggle="dropdown" <?= $isLowerLoggedIn ? "disabled" : "" ?>>
+ <button type="button" class="btn btn-outline-<?= $use2023UI ? "primary" : "success" ?> dropdown-toggle" data-bs-toggle="dropdown" <?= $isLowerLoggedIn ? "disabled" : "" ?>>
Start travelling
</button>
<ul class="dropdown-menu">