summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-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
4 files changed, 58 insertions, 17 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>
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",