summaryrefslogtreecommitdiff
path: root/pages/money.inc
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-07-20 18:29:09 +0200
committerRaindropsSys <contact@minteck.org>2023-07-20 18:29:09 +0200
commit46251292b5c8b431de66aeff473594ccec60e04c (patch)
treec9f2c196e50f064a66625813660148379212d9d7 /pages/money.inc
parent93c96fd1d89782570de9478c26f17b406e9dd7a0 (diff)
downloadpluralconnect-46251292b5c8b431de66aeff473594ccec60e04c.tar.gz
pluralconnect-46251292b5c8b431de66aeff473594ccec60e04c.tar.bz2
pluralconnect-46251292b5c8b431de66aeff473594ccec60e04c.zip
Updated 19 files and added 26 files (automated)
Diffstat (limited to 'pages/money.inc')
-rw-r--r--pages/money.inc44
1 files changed, 27 insertions, 17 deletions
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>