Hotel/hotel/rooms/templates/index.html
2019-01-22 20:34:02 +01:00

73 lines
3.1 KiB
HTML

{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
<meta charset="UTF-8">
<title>Hotel INO Scrum</title>
<script>
function changeBackground(imageUrl) {
if(imageUrl != null) {
document.body.style.background = "url(" + imageUrl + ") no-repeat center center fixed";
document.body.style.backgroundSize = "cover";
localStorage.backgroundImage = imageUrl;
}
}
</script>
</head>
<body onLoad="changeBackground(imageUrl = localStorage.backgroundImage)">
<h1>Hotel INO Scrum</h1>
<center><h3>Lista pokoi dostępnych w naszym hotelu</h3></center>
<table id="hotels">
<col style="width:10%">
<col style="width:30%">
<col style="width:15%">
<col style="width:45%">
<th>Numer pokoju</th>
<th>Typ pokoju</th>
<th>Cena</th>
<th>Rezerwacja</th>
{% for room in rooms %}
<tr>
<td>{{ room.room_number }}</td>
<td>{{ room.room_type }}</td>
<td>{{ room.price }} zł</td>
<td>
{% if room.reserved %}
<form action="{% url 'reservation' %}" method="POST">
{% csrf_token %}
<input type="hidden" name="room" value="{{ room.room_number }}">
<div class="button-box" >
Od: <input type="date" name="begindate">
Do: <input type="date" name="enddate"><br>
<button>Rezerwuj</button>
</div>
</form>
{% else %}
<form action="{% url 'reservation' %}" method="POST">
{% csrf_token %}
<input type="hidden" name="room" value="{{ room.room_number }}">
<div class="button-box" >
Od: <input type="date" name="begindate">
Do: <input type="date" name="enddate"><br>
<button>Rezerwuj</button>
</div>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
<br><br>
<center>
<table id="images">
<th><input type="image" src="static/images/background1.jpg" height="150px" width="250px" onClick="changeBackground(imageUrl='static/images/background1.jpg')"/></th>
<th><input type="image" src="static/images/background2.jpg" height="150px" width="250px" onClick="changeBackground(imageUrl='static/images/background2.jpg')"/></th>
<th><input type="image" src="static/images/background3.jpg" height="150px" width="250px" onClick="changeBackground(imageUrl='static/images/background3.jpg')"/></th>
<th><input type="image" src="static/images/background4.jpg" height="150px" width="250px" onClick="changeBackground(imageUrl='static/images/background4.jpg')"/></th>
<th><input type="image" src="static/images/background5.jpg" height="150px" width="250px" onClick="changeBackground(imageUrl='static/images/background5.jpg')"/></th>
</table>
</center>
</body>
</html>