walidacja formularza

This commit is contained in:
Hokan 2019-01-22 20:28:51 +01:00
commit 57520b10fa
11 changed files with 59 additions and 13 deletions

Binary file not shown.

Binary file not shown.

View File

@ -9,7 +9,13 @@ class ClientForm(ModelForm):
model = Client
fields = '__all__'
labels = {
<<<<<<< HEAD
'id_number': 'Numer dowodu: ',
'name': 'Imię: ',
'surname': 'Nazwisko: '
=======
'id_number': _('Numer dowodu '),
'name': _('Imię '),
'surname': _('Nazwisko ')
>>>>>>> 79787db1a58d1e3a363982eba9f484be10a87aaf
}

View File

@ -56,3 +56,12 @@ a {
padding: 30px;
border: 2px solid grey;
}
#reservationform {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 30px;
background-color: white;
color: black;
width: 40%;
padding: 10px;
border: 2px solid grey;
}

View File

@ -4,14 +4,29 @@
<head>
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
<meta charset="UTF-8">
<title>Title</title>
<title>Formularz rezerwacji</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>
<body onLoad="changeBackground(imageUrl = localStorage.backgroundImage)">
<br>
<center>
<h1>Formularz rezerwacji</h1>
<div id="reservationform">
<form action="" method="post">
{{ error }}
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit">
<input type="submit" value="Rezerwuj">
</form>
</center>
</div>
</body>
</html>

View File

@ -7,19 +7,22 @@
<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>
<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:20%">
<col style="width:40%">
<col style="width:25%">
<col style="width:35%">
<th>Numer pokoju</th>
<th>Typ pokoju</th>
<th>Cena</th>
@ -35,7 +38,9 @@
{% csrf_token %}
<input type="hidden" name="room" value="{{ room.room_number }}">
<div class="button-box" >
<button>Rezerwuj</button>
<button>Rezerwuj</button><br>
<input type="date" name="begindate">
<input type="date" name="enddate">
</div>
</form>
{% else %}
@ -43,7 +48,9 @@
{% csrf_token %}
<input type="hidden" name="room" value="{{ room.room_number }}">
<div class="button-box" >
<button>Rezerwuj</button>
<button>Rezerwuj</button><br>
<input type="date" name="begindate">
<input type="date" name="enddate">
</div>
</form>
{% endif %}

View File

@ -4,9 +4,18 @@
<head>
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
<meta charset="UTF-8">
<title>Zarezerwowano pokój</title>
<title>Rezerwacja</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>
<body onLoad="changeBackground(imageUrl = localStorage.backgroundImage)">
<br>
<center>
<div id="reservationbox">