summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/icons/bottom.svg1
-rw-r--r--assets/icons/top.svg11
-rw-r--r--includes/components/planner.inc64
-rw-r--r--includes/exchange.txt2
-rw-r--r--includes/flags.json1
-rw-r--r--includes/util/banner.inc8
-rw-r--r--pages/api/fronter.php30
7 files changed, 100 insertions, 17 deletions
diff --git a/assets/icons/bottom.svg b/assets/icons/bottom.svg
new file mode 100644
index 0000000..b72452c
--- /dev/null
+++ b/assets/icons/bottom.svg
@@ -0,0 +1 @@
+<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m11.25 13.75-.085-.073a.75.75 0 0 0-.976.072l-.69.69v-6.69l-.007-.102a.75.75 0 0 0-.743-.648l-.102.007A.75.75 0 0 0 8 7.749v6.692l-.69-.692-.084-.072a.75.75 0 0 0-.976 1.133l1.969 1.97.084.073a.75.75 0 0 0 .977-.072l1.97-1.971.073-.084a.75.75 0 0 0-.072-.977ZM1.999 12c0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.524-4.477-10-10-10s-10 4.476-10 10Zm18.5 0a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Zm-2.75 1.75-.084-.073a.75.75 0 0 0-.976.072l-.69.69v-6.69l-.007-.102a.75.75 0 0 0-.743-.648l-.102.007a.75.75 0 0 0-.648.743v6.691l-.69-.69-.083-.073a.75.75 0 0 0-.977 1.133l1.969 1.97.084.073a.75.75 0 0 0 .977-.072l1.97-1.971.073-.084a.75.75 0 0 0-.072-.977Z" fill="#000000"/></svg> \ No newline at end of file
diff --git a/assets/icons/top.svg b/assets/icons/top.svg
new file mode 100644
index 0000000..ee8f6c3
--- /dev/null
+++ b/assets/icons/top.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
+<path d="M12.7,10.2L12.7,10.2c0.4,0.3,0.8,0.3,1.1,0l0.7-0.7v6.7l0,0.1c0.1,0.4,0.4,0.6,0.7,0.6l0.1,0c0.4-0.1,0.6-0.4,0.6-0.7V9.6
+ l0.7,0.7l0.1,0.1c0.3,0.2,0.8,0.2,1-0.2c0.2-0.3,0.2-0.7-0.1-1l-2-2l-0.1-0.1c-0.3-0.2-0.7-0.2-1,0.1l-2,2l-0.1,0.1
+ C12.5,9.6,12.5,10,12.7,10.2L12.7,10.2z M22,12c0-5.5-4.5-10-10-10S2,6.5,2,12c0,5.5,4.5,10,10,10S22,17.5,22,12z M3.5,12
+ c0-4.7,3.8-8.5,8.5-8.5s8.5,3.8,8.5,8.5s-3.8,8.5-8.5,8.5S3.5,16.7,3.5,12z M6.2,10.2L6.2,10.2c0.4,0.3,0.8,0.3,1.1,0L8,9.6v6.7
+ l0,0.1C8.1,16.7,8.4,17,8.7,17l0.1,0c0.4-0.1,0.6-0.4,0.6-0.7V9.6l0.7,0.7l0.1,0.1c0.3,0.2,0.8,0.2,1-0.2c0.2-0.3,0.2-0.7-0.1-1
+ l-2-2L9.2,7.1C8.9,6.9,8.5,7,8.2,7.2l-2,2L6.2,9.3C6,9.6,6,10,6.2,10.2L6.2,10.2z"/>
+</svg>
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>
diff --git a/includes/exchange.txt b/includes/exchange.txt
index 79156ae..d04fb11 100644
--- a/includes/exchange.txt
+++ b/includes/exchange.txt
@@ -1 +1 @@
-0.88 \ No newline at end of file
+0.885 \ No newline at end of file
diff --git a/includes/flags.json b/includes/flags.json
index 9b5c360..7af1374 100644
--- a/includes/flags.json
+++ b/includes/flags.json
@@ -21,6 +21,7 @@
"not_fronting": "!!Doesn't front evenly",
"persecutor": "!!Persecutor",
"punished": "Punished",
+ "alcohol": "Drinks alcohol",
"private": "Hide from public listings",
"pacifier": "Sleeps with pacifier",
"other": "Having sex with %other%",
diff --git a/includes/util/banner.inc b/includes/util/banner.inc
index 0db683f..2a493f8 100644
--- a/includes/util/banner.inc
+++ b/includes/util/banner.inc
@@ -478,6 +478,14 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
}
}
+ if (($isLoggedIn || $isLowerLoggedIn) && $metadata["alcohol"] !== null && $metadata["alcohol"] !== false) {
+ $badges[] = [
+ "id" => "alcohol",
+ "color" => "secondary",
+ "html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Alcohol</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' drinks alcohol, and thus may be drunk or hungover at times." class="badge rounded-pill bg-secondary">Alcohol</span>'
+ ];
+ }
+
return [
'id' => $member['name'],
'color' => $member["color"] ?? "000000",
diff --git a/pages/api/fronter.php b/pages/api/fronter.php
index 9ef5571..9f70fdc 100644
--- a/pages/api/fronter.php
+++ b/pages/api/fronter.php
@@ -105,6 +105,21 @@ switch ($type) {
break;
+ case "bottom":
+ if (!isset($index) || trim($index) === "" || !is_integer($index)) {
+ if ($index !== null) peh_error("Invalid index", 400);
+ }
+
+ $day = $list[$date];
+
+ if (!isset($day[$index])) {
+ if ($index !== null) peh_error("Index not found", 404);
+ }
+
+ moveElement($list[$date], $index, count($list[$date]) - 1);
+
+ break;
+
case "up":
if (!isset($index) || trim($index) === "" || !is_integer($index)) {
if ($index !== null) peh_error("Invalid index", 400);
@@ -120,6 +135,21 @@ switch ($type) {
break;
+ case "top":
+ if (!isset($index) || trim($index) === "" || !is_integer($index)) {
+ if ($index !== null) peh_error("Invalid index", 400);
+ }
+
+ $day = $list[$date];
+
+ if (!isset($day[$index])) {
+ if ($index !== null) peh_error("Index not found", 404);
+ }
+
+ moveElement($list[$date], $index, 0);
+
+ break;
+
default:
peh_error("Invalid type name", 400);
break;