94 lines
4.6 KiB
HTML
94 lines
4.6 KiB
HTML
{{ define "bottom_controls" }}
|
|
|
|
<div class="row justify-content-between border-top pt-4 position-relative mb-5">
|
|
<div class="col-auto position-absolute start-0">
|
|
<div class="btn-toolbar" role="toolbar">
|
|
<a class="btn btn-lg btn-outline-secondary text-secondary-emphasis me-2" href="/logout">
|
|
<i class="bi bi-door-closed" data-bs-toggle="tooltip" data-bs-title="Abmelden"></i>
|
|
</a>
|
|
<!--
|
|
<button class="btn btn-lg btn-outline-secondary text-secondary-emphasis me-2" data-bs-toggle="modal" data-bs-target="#settingsModal">
|
|
<i class="bi bi-gear-fill" data-bs-toggle="tooltip" data-bs-title="Einstellungen"></i>
|
|
</button>
|
|
-->
|
|
{{ if (eq .UserRole "ADMIN") }}
|
|
<div class="dropdown">
|
|
<button class="btn btn-lg btn-outline-secondary text-secondary-emphasis dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
|
<i class="bi bi-tools"></i>
|
|
</button>
|
|
<ul class="dropdown-menu">
|
|
<li><h6 class="dropdown-header">ACCOUNTS</h6></li>
|
|
<li>
|
|
<button class="dropdown-item fs-5 text-info-emphasis"
|
|
hx-post="/admin/create_code" hx-trigger="confirmed" hx-swap="none"
|
|
onclick="createCodeDialog(this)">
|
|
Create Code
|
|
</button>
|
|
</li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><h6 class="dropdown-header">TOOLS</h6></li>
|
|
<li>
|
|
<button class="dropdown-item fs-5 text-warning-emphasis"
|
|
hx-delete="/admin/clear_cache" hx-trigger="confirmed" hx-swap="none"
|
|
onclick="confirmAndTrigger(this)">
|
|
Clear Cache
|
|
</button>
|
|
</li>
|
|
<li>
|
|
<button class="dropdown-item fs-5 text-warning-emphasis visually-hidden"
|
|
hx-get="/admin/update_cache" hx-trigger="confirmed" hx-swap="none"
|
|
onclick="alert('Not implemented yet')">
|
|
Update Cache
|
|
</button>
|
|
</li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><h6 class="dropdown-header">DANGER ZONE</h6></li>
|
|
<li>
|
|
<button class="dropdown-item fs-5 text-danger-emphasis"
|
|
hx-delete="/admin/purge_players" hx-trigger="confirmed" hx-swap="none"
|
|
onclick="confirmAndTrigger(this)">
|
|
Purge Players
|
|
</button>
|
|
</li>
|
|
<li>
|
|
<button class="dropdown-item fs-5 text-danger-emphasis"
|
|
hx-delete="/admin/purge_clans" hx-trigger="confirmed" hx-swap="none"
|
|
onclick="confirmAndTrigger(this)">
|
|
Purge Clans
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
<div class="col-auto position-absolute start-50 translate-middle-x">
|
|
<button class="btn btn-lg btn-primary" id="fullCalcBtn" data-bs-toggle="modal" data-bs-target="#fullCalcModal">
|
|
<i class="bi bi-calculator-fill me-2"></i>
|
|
Berechnen
|
|
</button>
|
|
</div>
|
|
<div class="col-auto position-absolute end-0">
|
|
<button class="btn btn-lg btn-outline-secondary text-secondary-emphasis" id="singleCalcBtn" onclick="showSingleCalcDialog(this)">
|
|
<i class="bi bi-person me-2"></i>
|
|
Einzel-Abfrage
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.body.addEventListener('htmx:afterRequest', function (event) {
|
|
let detail = event.detail;
|
|
let reqPath = detail.pathInfo.requestPath;
|
|
let method = detail.requestConfig.verb;
|
|
let xhr = detail.xhr;
|
|
|
|
if (reqPath.startsWith("/admin/")) {
|
|
showAdminActionExecutedDialog(xhr, method);
|
|
} else if (reqPath.startsWith("/score/") && method === "post") {
|
|
showSingleCalcResultDialog(xhr, method);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
{{ end }} |