Add check-avalability js

This commit is contained in:
Muyao CHEN 2024-06-29 21:42:15 +02:00
parent 0ca6de59fd
commit 592d5241d1
3 changed files with 40 additions and 23 deletions

View File

@ -218,27 +218,6 @@
}
}
// document.getElementById("dummy").addEventListener('click', () => {
// notify("This is a message", "success");
// // notifyModal("title", "text", "success", "confirm");
// // Prompt().toast({msg: "Prompt Test"})
// Prompt().success({msg: "Success!"})
// // Prompt().error({msg: "Ooops"})
//
// let html = `
// <form action="reservation.html" method="get" novalidate class="needs-validation">
// <div id="reservation-dates-modal" class="row">
// <div class="col mb-3">
// <input disabled required type="text" class="form-control" name="start" id="start" placeholder="Arrival">
// </div>
// <div class="col mb-3">
// <input disabled required type="text" class="form-control" name="end" id="end" placeholder="Departure">
// </div>
// </div>
// </form>
// `;
// Prompt().custom({title: "Choose your dates", msg: html})
// });
</script>
{{block "js" .}}

View File

@ -23,8 +23,27 @@
<div class="row">
<div class="d-flex justify-content-center py-3">
<a href="/make-reservation-gq" class="btn btn-success">Check Availability</a>
<button id="make-reservation" class="btn btn-success">Check Availability</button>
</div>
</div>
</div>
{{end}}
{{define "js"}}
<script>
document.getElementById("make-reservation").addEventListener('click', () => {
let html = `
<form action="reservation.html" method="get" novalidate class="needs-validation">
<div id="reservation-dates-modal" class="row">
<div class="col mb-3">
<input disabled required type="text" class="form-control" name="start" id="start" placeholder="Arrival">
</div>
<div class="col mb-3">
<input disabled required type="text" class="form-control" name="end" id="end" placeholder="Departure">
</div>
</div>
</form>
`;
Prompt().custom({title: "Choose your dates", msg: html})
});
</script>
{{end}}

View File

@ -23,8 +23,27 @@
<div class="row">
<div class="d-flex justify-content-center py-3">
<a href="/make-reservation-ms" class="btn btn-success">Check Availability</a>
<button id="make-reservation" class="btn btn-success">Check Availability</button>
</div>
</div>
</div>
{{end}}
{{define "js"}}
<script>
document.getElementById("make-reservation").addEventListener('click', () => {
let html = `
<form action="reservation.html" method="get" novalidate class="needs-validation">
<div id="reservation-dates-modal" class="row">
<div class="col mb-3">
<input disabled required type="text" class="form-control" name="start" id="start" placeholder="Arrival">
</div>
<div class="col mb-3">
<input disabled required type="text" class="form-control" name="end" id="end" placeholder="Departure">
</div>
</div>
</form>
`;
Prompt().custom({title: "Choose your dates", msg: html})
});
</script>
{{end}}