summaryrefslogtreecommitdiff
path: root/includes/components/planner.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/components/planner.inc')
-rw-r--r--includes/components/planner.inc64
1 files changed, 48 insertions, 16 deletions
diff --git a/includes/components/planner.inc b/includes/components/planner.inc
index 5ec1984..36a21ae 100644
--- a/includes/components/planner.inc
+++ b/includes/components/planner.inc
@@ -290,22 +290,6 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
}
?>
-<h2>Front planner</h2>
-<table id="planner">
- <tbody>
- <?php day("Yesterday", -1) ?>
- <?php day("Today", 0) ?>
- <?php day("Tomorrow", 1) ?>
- <?php day(date('l', time() + 86400 * 2), 2) ?>
- <?php day(date('l', time() + 86400 * 3), 3) ?>
- <?php day(date('l', time() + 86400 * 4), 4) ?>
- <?php day(date('l', time() + 86400 * 5), 5) ?>
- <?php day(date('l', time() + 86400 * 6), 6) ?>
- <?php day(date('l', time() + 86400 * 7), 7) ?>
- <?php day(date('l', time() + 86400 * 8), 8) ?>
- </tbody>
-</table>
-
<style>
#planner {
margin-top: 10px;
@@ -483,6 +467,22 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
</style>
+<h2>Front planner</h2>
+<table id="planner">
+ <tbody>
+ <?php day("Yesterday", -1) ?>
+ <?php day("Today", 0) ?>
+ <?php day("Tomorrow", 1) ?>
+ <?php day(date('l', time() + 86400 * 2), 2) ?>
+ <?php day(date('l', time() + 86400 * 3), 3) ?>
+ <?php day(date('l', time() + 86400 * 4), 4) ?>
+ <?php day(date('l', time() + 86400 * 5), 5) ?>
+ <?php day(date('l', time() + 86400 * 6), 6) ?>
+ <?php day(date('l', time() + 86400 * 7), 7) ?>
+ <?php day(date('l', time() + 86400 * 8), 8) ?>
+ </tbody>
+</table>
+
<!--suppress JSUnresolvedVariable, JSUnresolvedFunction -->
<script>
window.currentWorkingDate;
@@ -772,6 +772,18 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
});
}
+ function moveFronterBottom() {
+ Array.from(document.getElementsByClassName("edit-fronter-link")).forEach((i) => {
+ i.classList.add("disabled");
+ });
+
+ document.getElementById("edit-fronter-close").classList.add("disabled");
+
+ window.fetch("/api/fronter?t=bottom&d=" + window.selectedFronting["date"] + "&i=" + window.selectedFronting["index"] + "&s=" + window.selectedFronting["system"]).then(() => {
+ location.reload();
+ });
+ }
+
function viewFronterPage() {
let id = fronting[window.selectedFronting["system"] === "ynmuc" ? "cloudburst" : "raindrops"][window.selectedFronting["date"]][window.selectedFronting["index"]][0];
location.href = "/" + id;
@@ -793,6 +805,18 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
location.reload();
});
}
+
+ function moveFronterTop() {
+ Array.from(document.getElementsByClassName("edit-fronter-link")).forEach((i) => {
+ i.classList.add("disabled");
+ });
+
+ document.getElementById("edit-fronter-close").classList.add("disabled");
+
+ window.fetch("/api/fronter?t=top&d=" + window.selectedFronting["date"] + "&i=" + window.selectedFronting["index"] + "&s=" + window.selectedFronting["system"]).then(() => {
+ location.reload();
+ });
+ }
</script>
<div class="modal" id="new-fronter" data-bs-backdrop="static" data-bs-keyboard="false">
@@ -873,6 +897,10 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<img src="/assets/icons/delete.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Delete</span>
</a>
+ <a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="moveFronterTop();">
+ <img src="/assets/icons/top.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
+ <span style="vertical-align: middle;">Move to the top</span>
+ </a>
<a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="moveFronterUp();">
<img src="/assets/icons/up.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Move up</span>
@@ -881,6 +909,10 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<img src="/assets/icons/down.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Move down</span>
</a>
+ <a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="moveFronterBottom();">
+ <img src="/assets/icons/bottom.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
+ <span style="vertical-align: middle;">Move to the bottom</span>
+ </a>
<a class="list-group-item list-group-item-action edit-fronter-link" onclick="viewFronterPage();">
<img src="/assets/icons/page.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">View page</span>