Cleaning up our make reservation page and testing everything

This commit is contained in:
2024-07-10 22:34:27 +02:00
parent 5a646a2b27
commit 95cddfc950
4 changed files with 56 additions and 20 deletions

View File

@ -6,9 +6,19 @@
<h1 class="text-center mt-3">Make reservation</h1>
{{$res := index .Data "reservation"}}
<p><strong>Reservation Details</strong><br>
Room: {{$res.Room.RoomName}}<br>
Arrival: {{index .StringMap "start_date"}}<br>
Departure: {{index .StringMap "end_date"}}
</p>
<!-- <form method="post" action="" class="needs-validation" novalidate> -->
<form method="post" action="" class="" novalidate>
<form method="post" action="/make-reservation" class="" novalidate>
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<input type="hidden" name="start_date" value="{{index .StringMap "start_date"}}">
<input type="hidden" name="end_date" value="{{index .StringMap "end_date"}}">
<input type="hidden" name="room_id" value="{{$res.RoomID}}">
<div class="form-group mt-5">
<label for="first_name">First name:</label>
@ -27,20 +37,6 @@
value="{{$res.LastName}}" required autocomplete="off">
</div>
<div class="form-group mt-5">
<label for="start_date">Start date:</label>
<input type="text" name="start_date" id="start_date" class="form-control"
required autocomplete="off">
</div>
<div class="form-group mt-5">
<label for="end_date">End date:</label>
<input type="text" name="end_date" id="end_date" class="form-control"
required autocomplete="off">
</div>
<input type="hidden" name="room_id" value="1">
<div class="form-group mt-5">
<label for="email">Email:</label>
{{with .Form.Errors.Get "email"}}