-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbooking_form.html
82 lines (62 loc) · 2.63 KB
/
booking_form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{% extends 'template.html' %}
{% block content %}
<div id="main">
<h2>{{bookings|length}} booking(s) for room {{room.number}}</h2>
<ul>
{% for booking in bookings %}
<li class="booking">
<p>
<strong>Booked by:</strong> {{booking.name}},
<strong>Email:</strong> {{booking.email}},
<strong>For:</strong> {{ booking.no_of_people }} {{ 'people' if booking.no_of_people > 1 else 'person' }}<br>
<strong>From:</strong> {{booking.time_from}},
<strong>To:</strong> {{booking.time_to}} <br>
<strong>Created On:</strong> {{booking.created}}
</p>
<a title="delete booking" href="booking?k={{room.key.urlsafe()}}&d={{booking.key.urlsafe()}}"></a>
</li>
{% endfor %}
</ul>
</div>
<div id="side">
{% if not has_bookings %}
<a href="booking?k={{room.key.urlsafe()}}&remove=1" title="delete room">
<p class="error">Delete Room</p>
</a>
{% else %}
<p class="warn" style="cursor: not-allowed;" title="cannot delete a room that has bookings">Delete room <strong>{{room.number}}</strong></p>
{% endif %}
<a href="booking?k={{room.key.urlsafe()}}&deleteAll=1" title="delete expired bookings">
<p class="error">Delete all expired bookings</p>
</a>
<h2>Add new booking</h2>
{% if error %}
<p class="error">{{error}}</p>
{% elif success %}
<p class="success">{{success}}</p>
{% endif %}
<form method="post" action= "/booking?k={{ room.key.urlsafe() }}">
<p class="gpu">
<label for="name">Full Name:</label>
<input required placeholder="John Doe" id="name" type="text" value="{{ booking.name if booking.name else '' }}" name="name" />
</p>
<p class="gpu">
<label for="email">Email:</label>
<input required placeholder="[email protected]" id="email" type="email" value="{{ booking.email if booking.email else '' }}" name="email" />
</p>
<p class="gpu">
<label for="no_of_people">No of People:</label>
<input required placeholder="1" id="no_of_people" type="number" value="{{ booking.no_of_people if booking.no_of_people else '' }}" name="no_of_people" />
</p>
<p class="gpu">
<label for="from">From:</label>
<input required id="from" type="datetime-local" value="{{ booking.time_from.strftime('%Y-%m-%dT%H:%M') if booking.time_from else '' }}" name="from" />
</p>
<p class="gpu">
<label for="to">To:</label>
<input required id="to" type="datetime-local" value="{{ booking.time_to.strftime('%Y-%m-%dT%H:%M') if booking.time_to else '' }}" name="to" />
</p>
<input type="submit" value="Book" name="button"/>
</form>
</div>
{% endblock %}