52 lines
2.0 KiB
Go Template
52 lines
2.0 KiB
Go Template
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>Lishwist</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
crossorigin="anonymous"></script>
|
|
|
|
<script>
|
|
function getSubmissionNames(form) {
|
|
return Array.from(new FormData(form).keys());
|
|
}
|
|
function acceptNames(form, submitId, ...acceptedNames) {
|
|
const submissionNames = getSubmissionNames(form);
|
|
const submitter = document.getElementById(submitId);
|
|
const accepted = submissionNames.length > 0 && submissionNames.every((name) => acceptedNames.includes(name));
|
|
submitter.disabled = !accepted;
|
|
}
|
|
function acceptAttribute(form, submitId, acceptedAttribute) {
|
|
const checkedInputs = Array.from(form.querySelectorAll("input")).filter((i) => i.checked);
|
|
const submitter = document.getElementById(submitId);
|
|
const accepted = checkedInputs.length > 0 && checkedInputs.every((i) => i.hasAttribute(acceptedAttribute));
|
|
submitter.disabled = !accepted;
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div style="height: 100svh;" class="d-flex flex-column">
|
|
<div class="navbar navbar-expand-lg bg-body-tertiary">
|
|
<div class="container-fluid">
|
|
<div class="navbar-brand">Lishwist</div>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggle"
|
|
aria-controls="navbarToggle" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarToggle">
|
|
{{template "navbar" .}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{template "body" .}}
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|