actix-admin/templates/head.html

71 lines
2.4 KiB
HTML
Raw Normal View History

2022-10-07 17:03:09 +02:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Actix Admin</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
<script src="https://unpkg.com/htmx.org@1.8.4"></script>
2022-10-07 17:03:09 +02:00
<script>
function checkAll(bx) {
var cbs = document.getElementsByTagName('input');
for (var i = 0; i < cbs.length; i++) {
if (cbs[i].type == 'checkbox') {
cbs[i].checked = bx.checked;
}
}
}
function sort_by(column) {
document.getElementById("sort_by").value = column;
current_sort_order = document.getElementById("sort_order").value;
if(current_sort_order == "asc") {
document.getElementById("sort_order").value = "desc";
} else {
document.getElementById("sort_order").value = "asc";
}
document.getElementById('search_form').submit();
}
2022-10-07 17:03:09 +02:00
document.addEventListener('DOMContentLoaded', () => {
// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
// Add a click event on each of them
$navbarBurgers.forEach(el => {
el.addEventListener('click', () => {
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
});
htmx.on("htmx:responseError", function () {
document.getElementById("notifications").insertAdjacentHTML(
"afterend",
"<div class=\"notification mb-4 is-light is-danger\"><button class=\"delete\" onclick=\"this.parentElement.remove()\"></button>An Error occurred</div>");
})
2022-10-07 17:03:09 +02:00
</script>
<style>
.loader-wrapper {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: flex;
background: rgba(255, 255, 255, 0.3);
justify-content: center;
align-items: center;
z-index: 6;
2022-10-07 17:03:09 +02:00
pointer-events: none
}
</style>