udemy-go-web-1/templates/make-reservation.page.tmpl

61 lines
2.9 KiB
Cheetah
Raw Permalink Normal View History

2024-06-29 19:30:06 +00:00
{{template "base" .}}
{{define "content"}}
<div class="container">
<div class="row">
<div class="col">
<h1 class="text-center mt-3">Make reservation</h1>
2024-07-01 11:37:03 +00:00
{{$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>
2024-06-30 15:08:47 +00:00
<!-- <form method="post" action="" class="needs-validation" novalidate> -->
<form method="post" action="/make-reservation" class="" novalidate>
2024-06-30 15:08:47 +00:00
<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}}">
2024-06-30 17:35:59 +00:00
2024-06-29 19:30:06 +00:00
<div class="form-group mt-5">
<label for="first_name">First name:</label>
2024-06-30 17:35:59 +00:00
{{with .Form.Errors.Get "first_name"}}
<label class="text-danger">{{.}}</label>
{{end}}
<input type="text" name="first_name" id="first_name" class="form-control {{with .Form.Errors.Get "first_name"}} is-invalid {{end}}"
2024-07-01 11:37:03 +00:00
value="{{$res.FirstName}}" required autocomplete="off">
2024-06-29 19:30:06 +00:00
</div>
<div class="form-group mt-5">
<label for="last_name">Last name:</label>
2024-07-01 11:37:03 +00:00
{{with .Form.Errors.Get "last_name"}}
<label class="text-danger">{{.}}</label>
{{end}}
<input type="text" name="last_name" id="last_name" class="form-control {{with .Form.Errors.Get "last_name"}} is-invalid {{end}}"
value="{{$res.LastName}}" required autocomplete="off">
2024-06-29 19:30:06 +00:00
</div>
2024-06-29 19:30:06 +00:00
<div class="form-group mt-5">
<label for="email">Email:</label>
2024-07-01 11:37:03 +00:00
{{with .Form.Errors.Get "email"}}
<label class="text-danger">{{.}}</label>
{{end}}
<input type="email" name="email" id="email" class="form-control {{with .Form.Errors.Get "email"}} is-invalid {{end}}"
value="{{$res.Email}}" required autocomplete="off">
2024-06-29 19:30:06 +00:00
</div>
<div class="form-group mt-5">
<label for="phone">Phone number:</label>
2024-07-01 11:37:03 +00:00
<input type="text" name="phone" id="phone" class="form-control" value="{{$res.Phone}}" autocomplete="off">
2024-06-29 19:30:06 +00:00
</div>
<hr>
<input type="submit" class="btn btn-primary" value="Make Reservation">
</form>
</div>
</div>
</div>
{{end}}