Skip to content

Commit 4ec47f0

Browse files
committed
Proveden squash
Puvodni: Predelan styl Pridan formular pro registraci a sjednocen styl <a> a <input submit> Signed-off-by: Kosieh Barter <[email protected]> Pridan formular pro vytvoreni spolujizdy Zahrnuta i moznost pravidelne spolujizdy, jednorazova prednastavena Signed-off-by: Kosieh Barter <[email protected]> Pridany moznosti spolujizdy Pridano pole na poznamky a select pro menu ceny. Signed-off-by: Kosieh Barter <[email protected]> Pridan formular pro pridani vozidla Poznamka: SPZ vozidla je volitelny opt-in. Dobrovolne Signed-off-by: Kosieh Barter <[email protected]> Pridan styl pro info, pozn a dalsi Informace Poznamka Tlacitka - unifikovane Prechody WIP: Vyber barvy - ten je zatim v HTML5 Signed-off-by: Kosieh Barter <[email protected]> Pridano info Signed-off-by: Kosieh Barter <[email protected]> Pridany info po updatu CSS Signed-off-by: Kosieh Barter <[email protected]> Pridany checkboxy - WIP Signed-off-by: Kosieh Barter <[email protected]> Draft pro uziv panel Zatim pouze email Signed-off-by: Kosieh Barter <[email protected]> Zprehledneni formulare Signed-off-by: Kosieh Barter <[email protected]> Draft pro hlavni stranku Signed-off-by: Kosieh Barter <[email protected]> Pridan draft pro registraci a index Signed-off-by: Kosieh Barter <[email protected]> Port draftu na Django HTML Signed-off-by: Kosieh Barter <[email protected]> Pridan model pro vozidla Signed-off-by: Kosieh Barter <[email protected]> Upraven half-page vypis pro seznam Signed-off-by: Kosieh Barter <[email protected]> Pridan draft na spravu vozidel Signed-off-by: Kosieh Barter <[email protected]> Makemigrations na vozidlech Signed-off-by: Kosieh Barter <[email protected]> Opraven __str__ Signed-off-by: Kosieh Barter <[email protected]> Pridan model do admin rozhrani Signed-off-by: Kosieh Barter <[email protected]> Pridan atribut pro vlastnika vozidla Signed-off-by: Kosieh Barter <[email protected]> Opraven owner_id na owner Signed-off-by: Kosieh Barter <[email protected]> Pridan login vcetne kontroly a podpora pro nej Kumulativni update, obsahuje login a logout, upraveno a pridana podpora pro prihlaseni. Zname chyby: pri redirectu zobrazuje co redirectuje, mozna chovani pri zapnutem flagu debug=True Signed-off-by: Kosieh Barter <[email protected]> Jednotny styl - mobilni verze webu Signed-off-by: Kosieh Barter <[email protected]> Opraven link rel na ikonu, nacita ze static Signed-off-by: Kosieh Barter <[email protected]> Pridany odkazy Login, logout, uziv panel a reigstraci Signed-off-by: Kosieh Barter <[email protected]> Jednoduchy login screen, bez chybovych hlasek Signed-off-by: Kosieh Barter <[email protected]> Single-page logout odkaz Presmeruje na index.html Signed-off-by: Kosieh Barter <[email protected]> Pridan login, logout, user_mgmt a registrace Zatim vse v navrhu, funkcni login, logout registrace: WIP, uzivatelsky panel: WIP Signed-off-by: Kosieh Barter <[email protected]> Pridany URL Na: registrace, logout, uzivatelsky panel a login Signed-off-by: Kosieh Barter <[email protected]> Pridany definice formularu Poznamka: v HTML se zobrazuje jako odstavec s labelem Signed-off-by: Kosieh Barter <[email protected]> Pridan WIP na registraci uzivatele Signed-off-by: Kosieh Barter <[email protected]> Page na upravu uzivatelskych dat Dekorator: vyzaduje prihlaseni, pozor, nefunguje, jak ma Signed-off-by: Kosieh Barter <[email protected]> Napad: jednotne HTML na chybove zpravy Signed-off-by: Kosieh Barter <[email protected]> Navrh pro vyhledavani spolujizd POZOR: NENI funkcni! Signed-off-by: Kosieh Barter <[email protected]> Pridan mustr na pridavani vozidel Signed-off-by: Kosieh Barter <[email protected]> Prepracovan Login a Register (stale ve WIP) Signed-off-by: Kosieh Barter <[email protected]> Predelani na novy views.py Signed-off-by: Kosieh Barter <[email protected]>
1 parent dbb89fb commit 4ec47f0

24 files changed

+657
-74
lines changed

apps/web/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
admin.site.register(models.Comment)
77
admin.site.register(models.Waypoint)
88
admin.site.register(models.Passanger)
9+
admin.site.register(models.Vehicle)
910
admin.site.register(models.JourneyWaypoints)
1011

1112

apps/web/forms.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from django import forms
2+
from random import randint
3+
4+
5+
class RegisterForm(forms.Form):
6+
7+
def rand_anti_question():
8+
day_list = ["pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota", "neděle"]
9+
10+
rand_day_num = randint(0, len(day_list))
11+
rand_addition = randint(0, len(day_list))
12+
correct_day_num = rand_day_num + rand_addition
13+
correct_day_index = correct_day_num
14+
15+
if correct_day_index >= len(day_list):
16+
correct_day_index = correct_day_index - len(day_list)
17+
18+
print (len(day_list))
19+
print (correct_day_index)
20+
21+
question = "Dnes je %s. V případě, že je toto tvrzení pravdivé, co bude za %s dny?" % (day_list[rand_day_num], rand_addition)
22+
return (question, day_list[correct_day_index])
23+
24+
user_email = forms.CharField(max_length = 100, label = "Vaše emailová adresa")
25+
user_email_confirm = forms.CharField(max_length = 100, label = "Vaše emailová adresa - kontrola")
26+
user_password = forms.CharField(widget = forms.PasswordInput(), label = "Vaše heslo")
27+
user_password_confirm = forms.CharField(widget = forms.PasswordInput(), label = "Vaše heslo - kontrola")
28+
29+
cont_question, correct_day = rand_anti_question()
30+
random_antibot = forms.CharField(max_length = 50, label = cont_question)
31+
32+
class LoginForm(forms.Form):
33+
user_name = forms.CharField(max_length = 100, label = "Váš email")
34+
user_pass = forms.CharField(widget = forms.PasswordInput(), label = "Vaše heslo")
35+
36+
class ManageForm(forms.Form):
37+
user_mail = forms.EmailField(max_length = 100, label = "Váš email")
38+
user_mail_confirm = forms.EmailField(max_length = 100, label = "Váš email - kontrola")
39+
user_pass = forms.CharField(max_length = 100, widget = forms.PasswordInput(), label = "Vaše heslo")
40+
user_pass_confirm = forms.EmailField(max_length = 100, widget = forms.PasswordInput(), label = "Vaše heslo - kontrola")
41+
42+
class CarManageForm(forms.Form):
43+
pass

apps/web/migrations/0002_vehicle.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.2 on 2016-02-24 06:27
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('web', '0001_initial'),
12+
]
13+
14+
operations = [
15+
migrations.CreateModel(
16+
name='Vehicle',
17+
fields=[
18+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
19+
('name', models.CharField(max_length=20)),
20+
('owner', models.IntegerField(default=None)),
21+
('register', models.CharField(blank=True, default=None, max_length=20)),
22+
('color', models.CharField(max_length=10)),
23+
('wifi_on_board', models.BooleanField(default=False)),
24+
('animals_allowed', models.BooleanField(default=False)),
25+
('highway_mark', models.BooleanField(default=False)),
26+
('smoking_allowed', models.BooleanField(default=False)),
27+
('air_conditioning', models.BooleanField(default=True)),
28+
],
29+
),
30+
]

apps/web/models.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@
99
from django.contrib.auth.models import User
1010

1111

12+
class Vehicle(models.Model):
13+
name = models.CharField(max_length=20, blank=False)
14+
owner = models.IntegerField(blank=False, default = None)
15+
register = models.CharField(max_length=20, blank = True, default = None)
16+
color = models.CharField(max_length=10, blank=False)
17+
18+
wifi_on_board = models.BooleanField(default=False)
19+
animals_allowed = models.BooleanField(default=False)
20+
highway_mark = models.BooleanField(default=False)
21+
smoking_allowed = models.BooleanField(default=False)
22+
air_conditioning = models.BooleanField(default=True)
23+
24+
def __str__(self):
25+
ret_str = "Vehicle basic attrs:\n\
26+
name: %s, register: %s, \
27+
color: %s\, owner_id: %s, \
28+
wifi_on_board: %s, animals_allowed: %s, \
29+
highway_mark: %s\nsmoking_allowed: %s, \
30+
air_conditioning: %s" % (self.name, self.register,
31+
self.color, self.owner.id,
32+
self.wifi_on_board, self.animals_allowed,
33+
self.highway_mark,self.smoking_allowed,
34+
self.air_conditioning)
35+
return ret_str
36+
37+
1238
class UserProfile(models.Model):
1339
user = models.OneToOneField(
1440
settings.AUTH_USER_MODEL,

apps/web/static/web/css/styles.css

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
1-
table td, table th {
2-
border: 1px solid black;
3-
}
4-
table th {
5-
background-color: #ccc;
6-
}
1+
/* Zaklady. Nejdrive zakladni veci, ktere sjednocuji drtivou vetsinu nastaveni. */
2+
3+
body { background: black; padding: 0px; margin: 0 auto; max-width: 1280px; font-family: arial;}
4+
5+
h1 { margin: 0px; padding: 5px; text-align: right; color: white;}
6+
h2 { padding: 10px; margin: 0px; text-align: center;}
7+
h4 { padding: 10px; margin: 0px; text-align: center;}
8+
9+
a {text-align: center; padding: 10px; border: 2px solid black; border-radius: 10px; text-decoration: none; display: inline-block; width: 50%; box-sizing: border-box; margin: -1px}
10+
p { padding: 4px; margin: 0px;border: 1px solid black; border-radius: 10px;}
11+
label {text-align: center;}
12+
13+
input { width: 100%; text-align: center; box-sizing: border-box; border-radius: 10px; padding: 5px; margin-top: 2px; margin-bottom: 2px; }
14+
select {width: 100%; text-align: center; padding: 5px;}
15+
textarea {width: 100%; box-sizing: border-box;}
16+
17+
/* Spolecne pro div a vzhled zakladu */
18+
#hlavicka { background: #4b9320; }
19+
#prechod {background: linear-gradient(#4b9320, #71c900)}
20+
#stranka {background: #71c900;}
21+
#vyber_barvy { height: 64px;}
22+
23+
/* Nastaveni k dialogu ceny */
24+
#cena_spolujizdy {width: 49%; box-sizing: border-box;}
25+
#cena_spolujizdy_sel {width: 49%; box-sizing: border-box;}
26+
27+
/* Nastaveni pro chybu */
28+
#chyba {text-align: center ; background: red; font-size: 20px;}
29+
30+
/* Nastaveni pro tlacitko typu submit */
31+
.tlacitko {width: 100%; box-sizing: border-box; background-color: #094100; color: white;}
32+
.tlacitko:hover {background-color: #1f9900; border: 2px solid white;}
33+
/* Chceme sjednotit tlacitko typu a a submit? */
34+
.tlacitko {width: 100%; background-color: #094100; color: white; border: 2px solid black;}
35+
.tlacitko:hover {background-color: #1f9900; border: 2px solid white;}
36+
37+
.poznamka {background: orange; font-size: 20px; text-align: center;}
38+
.informace {background: #4e7fff; font-size: 20px; text-align: center;}
39+
.vlas_voz { width: 20px;}
40+
.pulsegment { width: 50%; float: left; background: #71c900;}
41+
.nadpis_hod {font-size: 20px;}
42+
.text_hod { font-size: 20px;}
43+
44+
.vyber_spolujizdy {width: 100%; text-align: center; background: #03a200; color: white; border: 1px solid black; border-radius: 15px; display: block;}
45+
.vyber_spolujizdy:hover { background: #b6ff6c; color: black;}

apps/web/templates/base.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
{% load i18n %}
22
{% load static from staticfiles %}
3-
<!DOCTYPE html>
4-
<html lang="en">
3+
4+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5+
<html>
56
<head>
6-
<meta charset="UTF-8">
7-
<title>Title</title>
8-
<link type="text/css" rel="stylesheet" href="{% static 'web/css/styles.css' %}">
7+
<title>Jizdoteka</title>
8+
9+
<link rel="icon" type="image/png" href="{% static 'web/jizdoteka.svg' %}" />
10+
<meta charset="utf-8">
11+
<meta name="viewport" content="width=device-width, initial-scale=1">
12+
<link type="text/css" rel="stylesheet" href="{% static 'web/css/styles.css' %}">
913
</head>
1014
<body>
11-
12-
{% block content %}Here is missing {block}!{% endblock %}
13-
14-
</body>
15-
</html>
15+
<div id="hlavicka"><h1>Jizdoteka.cz</h1></div>
16+
{% block content %}
17+
{% endblock %}
18+
</body>
19+
</html>

apps/web/templates/draft.css

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1+
/* Zaklady. Nejdrive zakladni veci, ktere sjednocuji drtivou vetsinu nastaveni. */
2+
13
body { background: black; padding: 0px; margin: 0 auto; max-width: 1280px; font-family: arial;}
4+
div { background: #4b9320; }
5+
26
h1 { margin: 0px; padding: 5px; text-align: right; color: white;}
7+
h2 { padding: 10px; margin: 0px; text-align: center;}
38
h4 { padding: 10px; margin: 0px; text-align: center;}
9+
10+
a {width: 100%; text-align: center; box-sizing: border-box; border-radius: 10px; padding: 5px; margin-top: 2px; margin-bottom: 2px;}
411
p { padding: 4px; margin: 2px;border: 1px solid black; border-radius: 10px;}
12+
513
input { width: 100%; text-align: center; box-sizing: border-box; border-radius: 10px; padding: 5px; margin-top: 2px; margin-bottom: 2px; }
6-
div { background: #4b9320; }
14+
select {width: 100%; text-align: center; padding: 5px;}
15+
textarea {width: 100%; box-sizing: border-box;}
16+
17+
#prechod {background: linear-gradient(#4b9320, #71c900)}
18+
#stranka {background: #71c900;}
19+
#vyber_barvy { height: 64px;}
20+
21+
/* Nastaveni pro tlacitko typu submit */
22+
#login_tlacitko {width: 100%; box-sizing: border-box; background-color: #094100; color: white; border: 2px solid black;}
23+
#login_tlacitko:hover {background-color: #1f9900; border: 2px solid white;}
24+
/* Chceme sjednotit tlacitko typu a a submit? */
25+
#tlacitko {width: 100%; box-sizing: border-box; background-color: #094100; color: white; border: 2px solid black; display: block;}
26+
#tlacitko:hover {background-color: #1f9900; border: 2px solid white;}
27+
28+
/* Nastaveni k dialogu ceny */
29+
#cena_spolujizdy {width: 49%; box-sizing: border-box;}
30+
#cena_spolujizdy_sel {width: 49%; box-sizing: border-box;}
731

8-
#prechod {background: linear-gradient(#4b9320, #80e400);}
9-
#stranka {background: #80e400;}
32+
.poznamka {background: orange; font-size: 20px; text-align: center;}
33+
.informace {background: #4e7fff; font-size: 20px; text-align: center;}
34+
.vlas_voz { width: 20px;}

apps/web/templates/draft_index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+
<html>
3+
<head>
4+
<title>Jizdoteka</title>
5+
6+
<link rel="icon" type="image/png" href="draft_jizdoteka.svg" />
7+
<meta charset="utf-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<link rel="stylesheet" href="../static/web/css/styles.css">
10+
</head>
11+
<body>
12+
<div id="hlavicka"><h1>Jizdoteka.cz</h1></div>
13+
</body>
14+
</html>

apps/web/templates/draft_login.html

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html
2+
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4+
<html>
5+
<head>
6+
<title>Jizdoteka - Přidat vozidlo</title>
7+
8+
<link rel="icon" type="image/png" href="draft_jizdoteka.svg" />
9+
<meta charset="utf-8">
10+
<meta name="viewport" content="width=device-width, initial-scale=1">
11+
<link rel="stylesheet" href="../static/web/css/styles.css">
12+
</head>
13+
<body>
14+
<div id="hlavicka"><h1>Jizdoteka.cz</h1></div>
15+
<div id="prechod"><h2>Přidat vozidlo</h2></div>
16+
<div id="stranka">
17+
<form class="" action="draft_pridat_vozidlo.html" method="post">
18+
<h4>Značka Vašeho vozidla</h4>
19+
<input type="text" name="znacka_voz" />
20+
<h4>Barva Vašeho vozidla</h4>
21+
<input type="color" name="barva_voz" id="vyber_barvy" />
22+
<h4>Další vlastnosti</h4>
23+
<label>Ve vozidle je klimatizace:</label><input class="vlas_voz" type="checkbox" name="vlastnost" value="klimatizace" /><br />
24+
<label>Ve vozidle se smí kouřit:</label><input class="vlas_voz" type="checkbox" name="vlastnost" value="kourit" /><br />
25+
<label>Ve vozidle se smí přepravovat pes / zvíře:</label><input class="vlas_voz" type="checkbox" name="vlastnost" value="preprava_zvirat" /><br />
26+
<label>Vozidlo má dálniční známku:</label><input class="vlas_voz" type="checkbox" name="vlastnost" value="dalnicni_znamka" /><br />
27+
<h4>SPZ Vašeho vozidla</h4>
28+
<p class="informace">
29+
Poznámka:<br />
30+
SPZ Vašeho vozidla vyplňovat NEMUSÍTE, jedná se o dobrovolný údaj.<br />
31+
V případě vyplnění ulehčíte spolucestujícím snažší nalezení.
32+
</p>
33+
<input type="text" name="spz_vozidla" />
34+
<input type="submit" value="Uložit vozidlo" id="tlacitko"/>
35+
</form>
36+
</div>
37+
</body>
38+
</html>

0 commit comments

Comments
 (0)