Marking a resercation as processed

This commit is contained in:
2024-07-25 13:51:31 +02:00
parent ca1e72c676
commit fcd29cc082
5 changed files with 54 additions and 6 deletions

View File

@ -50,7 +50,25 @@ Reservation
<input type="submit" class="btn btn-primary" value="Save">
<a href="/admin/reservations-{{$src}}" class="btn btn-warning">Cancel</a>
<a href="#" class="btn btn-info" onclick="processRes({{$res.ID}})">Mark as Processed</a>
</form>
</div>
{{end}}
{{define "js"}}
{{$src := index .StringMap "src"}}
<script>
function processRes(id) {
attention.custom({
icon: 'warning',
msg: 'Are you sure?',
callback: function(result) {
if (result != false) {
window.location.href = "/admin/process-reservation/{{$src}}/" + id;
}
}
})
}
</script>
{{end}}

View File

@ -14,6 +14,7 @@
<!-- plugin css for this page -->
<!-- End plugin css for this page -->
<!-- inject:css -->
<link rel="stylesheet" type="text/css" href="https://unpkg.com/notie/dist/notie.min.css">
<link rel="stylesheet" href="/static/admin/css/style.css">
<!-- endinject -->
<link rel="shortcut icon" href="/static/admin/images/favicon.png" />
@ -25,6 +26,9 @@
label {
font-weight: bold;
}
.notie-container {
z-index: 50000;
}
</style>
{{block "css" .}}
@ -132,8 +136,25 @@
<script src="/static/admin/js/todolist.js"></script>
<!-- endinject -->
<!-- Custom js for this page-->
<script src="https://unpkg.com/notie"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="/static/js/app.js"></script>
<script src="/static/admin/js/dashboard.js"></script>
<!-- End custom js for this page-->
<script>
let attention = Prompt()
{{with .Error}}
notify("{{.}}", "error")
{{end}}
{{with .Warning}}
notify("{{.}}", "warning")
{{end}}
{{with .Flash}}
notify("{{.}}", "success")
{{end}}
</script>
{{block "js" .}}
{{end}}