aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorpacien2021-07-29 18:04:48 +0200
committerpacien2021-07-29 18:04:48 +0200
commit57ff25198a82b3f6f413440e4005f0ade8dfb8d8 (patch)
tree817c43e04b3413d773a999c1950e1af43f26c3e2 /templates
parentf80c19c18eb01ed7e7c6f44cc25535c14659ba20 (diff)
downloaduge_l2_rdbms_python_proto-57ff25198a82b3f6f413440e4005f0ade8dfb8d8.tar.gz
app: render and serve proper web pages
Diffstat (limited to 'templates')
-rw-r--r--templates/_base.html.jinja71
-rw-r--r--templates/_fragments.html.jinja34
-rw-r--r--templates/homepage.html.jinja95
-rw-r--r--templates/launder.html.jinja38
-rw-r--r--templates/wallet.html.jinja140
5 files changed, 378 insertions, 0 deletions
diff --git a/templates/_base.html.jinja b/templates/_base.html.jinja
new file mode 100644
index 0000000..5649718
--- /dev/null
+++ b/templates/_base.html.jinja
@@ -0,0 +1,71 @@
1{#
2 UGE / L2 / Intro to relational databases / Python project prototype
3 Author: Pacien TRAN-GIRARD
4 Licence: EUPL-1.2
5#}
6
7{% import '_fragments.html.jinja' as fragments %}
8
9<!doctype html>
10<html>
11 <head>
12 <meta charset="utf-8">
13 <meta name="viewport" content="width=device-width, initial-scale=1.0">
14
15 <link
16 rel="shortcut icon"
17 type="image/svg+xml"
18 href="/images/favicon.svg">
19
20 {% block headers %}
21 <link
22 rel="stylesheet"
23 href="/stylesheets/pure-min.css">
24 <link
25 rel="stylesheet"
26 href="/stylesheets/grids-responsive-min.css">
27 <link
28 rel="stylesheet"
29 href="/stylesheets/main.css">
30 <link
31 rel="stylesheet"
32 href="/stylesheets/pepal.css">
33
34 <title>{% block title %}{% endblock %} - PèPal</title>
35 {% endblock %}
36 </head>
37
38 <body>
39 <div class="page">
40 <header>
41 <div class="pure-g">
42 <div class="branding pure-u-1 pure-u-md-1-2">
43 <h1><a href="/">{{ fragments.logo() }}</a></h1>
44 </div>
45
46 <div class="account-info pure-u-1 pure-u-md-1-2">
47 {{ fragments.user_header(user) if user is not none }}
48 </div>
49 </div>
50 </header>
51
52 <div class="flash-message">
53 {% block flash_messages %}
54 {{ fragments.flash_messages(messages) }}
55 {% endblock %}
56 </div>
57
58 <div class="content">
59 {% block content %}{% endblock %}
60 </div>
61
62 <footer>
63 <span class="copyright">
64 &copy; 2021 {{ fragments.logo() }} Inc.
65 Too many rights reserved.
66 </span>
67 </footer>
68 </div>
69 </body>
70</html>
71
diff --git a/templates/_fragments.html.jinja b/templates/_fragments.html.jinja
new file mode 100644
index 0000000..e5b3175
--- /dev/null
+++ b/templates/_fragments.html.jinja
@@ -0,0 +1,34 @@
1{#
2 UGE / L2 / Intro to relational databases / Python project prototype
3 Author: Pacien TRAN-GIRARD
4 Licence: EUPL-1.2
5#}
6
7
8{% macro logo() %}
9 <span class="pepal-logo">
10 <span class="dark-blue">Pè</span><span class="light-blue">Pal</span>
11 </span>
12{% endmacro %}
13
14
15{% macro user_header(user) %}
16 <a class="pure-button" href="/wallet">
17 👤 {{ user.username }}
18 </a>
19
20 <a class="pure-button" href="/wallet">
21 👛 {{ user.balance }} §
22 </a>
23
24 <form method="post" action="/account/logout">
25 <button class="pure-button">🚪 Log out</button>
26 </form>
27{% endmacro %}
28
29
30{% macro flash_messages(messages) %}
31 {% for class, message in messages %}
32 <div class="{{ class }}">{{ message }}</div>
33 {% endfor %}
34{% endmacro %}
diff --git a/templates/homepage.html.jinja b/templates/homepage.html.jinja
new file mode 100644
index 0000000..39ed94f
--- /dev/null
+++ b/templates/homepage.html.jinja
@@ -0,0 +1,95 @@
1{#
2 UGE / L2 / Intro to relational databases / Python project prototype
3 Author: Pacien TRAN-GIRARD
4 Licence: EUPL-1.2
5#}
6
7{% extends '_base.html.jinja' %}
8
9{% block title %}Homepage{% endblock %}
10
11{% block content %}
12<div class="pure-g">
13
14 <form
15 method="post"
16 action="/account/register"
17 class="pure-form pure-form-aligned pure-u-1 pure-u-md-1-2">
18
19 <h2>Create a new account</h2>
20
21 <fieldset>
22 <div class="pure-control-group">
23 <label for="register-name">Username</label>
24 <input
25 type="text"
26 id="register-name"
27 name="username"
28 minlength="4"
29 maxlength="16"
30 required />
31 </div>
32 <div class="pure-control-group">
33 <label for="register-password">Password</label>
34 <input
35 type="password"
36 id="register-password"
37 name="password"
38 minlength="4"
39 maxlength="32"
40 required />
41 </div>
42 <div class="pure-controls">
43 <label for="register-terms" class="pure-checkbox">
44 <input type="checkbox" id="register-terms" required />
45 I trust you*
46 </label>
47
48 <button
49 type="submit"
50 class="pure-button pure-button-primary dark-blue-bg">
51 ✎ Open an account
52 </button>
53 </div>
54 </fieldset>
55 </form>
56
57 <form
58 method="post"
59 action="/account/login"
60 class="pure-form pure-form-aligned pure-u-1 pure-u-md-1-2">
61
62 <h2>Log in into your account</h2>
63
64 <fieldset>
65 <div class="pure-control-group">
66 <label for="login-name">Username</label>
67 <input
68 type="text"
69 id="login-name"
70 name="username"
71 minlength="4"
72 maxlength="16"
73 required />
74 </div>
75 <div class="pure-control-group">
76 <label for="login-password">Password</label>
77 <input
78 type="password"
79 id="login-password"
80 name="password"
81 minlength="4"
82 maxlength="32"
83 required /> </div>
84 <div class="pure-controls">
85 <button
86 type="submit"
87 class="pure-button pure-button-primary light-blue-bg">
88 🔑 Log in
89 </button>
90 </div>
91 </fieldset>
92 </form>
93
94</div>
95{% endblock %}
diff --git a/templates/launder.html.jinja b/templates/launder.html.jinja
new file mode 100644
index 0000000..4d4cda7
--- /dev/null
+++ b/templates/launder.html.jinja
@@ -0,0 +1,38 @@
1{#
2 UGE / L2 / Intro to relational databases / Python project prototype
3 Author: Pacien TRAN-GIRARD
4 Licence: EUPL-1.2
5#}
6
7{% extends '_base.html.jinja' %}
8
9{% block title %}Transfer in progress...{% endblock %}
10
11{% block headers %}
12 {{ super() }}
13
14 <link rel="stylesheet" href="/stylesheets/laundry.css">
15 <meta http-equiv="refresh" content="3; url=/wallet" />
16