wybor tla + sortowanie tabeli
This commit is contained in:
parent
28f31ebe5b
commit
8ae157c04b
BIN
hotel/db.sqlite3
BIN
hotel/db.sqlite3
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
BIN
hotel/rooms/static/images/background2.jpg
Normal file
BIN
hotel/rooms/static/images/background2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 776 KiB |
BIN
hotel/rooms/static/images/background3.jpg
Normal file
BIN
hotel/rooms/static/images/background3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 MiB |
BIN
hotel/rooms/static/images/background4.jpg
Normal file
BIN
hotel/rooms/static/images/background4.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 633 KiB |
BIN
hotel/rooms/static/images/background5.jpg
Normal file
BIN
hotel/rooms/static/images/background5.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 MiB |
@ -22,11 +22,19 @@
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
#images {
|
||||||
background: url(images/background.jpg) no-repeat center center fixed;
|
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
|
||||||
-webkit-background-size: cover;
|
border-collapse: collapse;
|
||||||
-moz-background-size: cover;
|
background-color: white;
|
||||||
-o-background-size: cover;
|
}
|
||||||
|
|
||||||
|
#images th {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: url(images/background1.jpg) no-repeat center center fixed;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,11 +5,21 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
|
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Hotel INO Scrum</title>
|
<title>Hotel INO Scrum</title>
|
||||||
|
<script>
|
||||||
|
function changeBackground(imageUrl) {
|
||||||
|
document.body.style.background = "url(" + imageUrl + ") no-repeat center center fixed";
|
||||||
|
document.body.style.backgroundSize = "cover";
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hotel INO Scrum</h1>
|
<h1>Hotel INO Scrum</h1>
|
||||||
<center><h3>Lista pokoi dostępnych w naszym hotelu</h3></center>
|
<center><h3>Lista pokoi dostępnych w naszym hotelu</h3></center>
|
||||||
<table id="hotels">
|
<table id="hotels">
|
||||||
|
<col style="width:10%">
|
||||||
|
<col style="width:30%">
|
||||||
|
<col style="width:20%">
|
||||||
|
<col style="width:40%">
|
||||||
<th>Numer pokoju</th>
|
<th>Numer pokoju</th>
|
||||||
<th>Typ pokoju</th>
|
<th>Typ pokoju</th>
|
||||||
<th>Cena</th>
|
<th>Cena</th>
|
||||||
@ -41,6 +51,15 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -8,6 +8,7 @@ from .models import *
|
|||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
rooms = Room.objects.all()
|
rooms = Room.objects.all()
|
||||||
|
rooms = rooms.order_by('room_number')
|
||||||
template = loader.get_template('index.html')
|
template = loader.get_template('index.html')
|
||||||
|
|
||||||
return HttpResponse(template.render({'rooms': rooms}, request))
|
return HttpResponse(template.render({'rooms': rooms}, request))
|
||||||
|
Loading…
Reference in New Issue
Block a user