aboutsummaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
authorKaran Jayachandra <mail@karanjayachandra.com>2025-07-14 20:16:07 +0200
committerKaran Jayachandra <mail@karanjayachandra.com>2025-07-14 20:16:07 +0200
commitb73e8f510f1b3a13d942e1ad42c8a04401eb6b8c (patch)
tree26612c20e03adb3cb26c36f36d31576f3c77dc1c /app/templates
parent072d546490ba6cd4422cbc9cd6644b455f58fd46 (diff)
parent895ed4be433a4159250b276bd99f574c9c39c98e (diff)
Merge branch 'develop' into 'main'3.0
Develop See merge request KaranJayachandra/match_up!17
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/controls.j22
-rw-r--r--app/templates/index.j29
-rw-r--r--app/templates/login.html23
-rw-r--r--app/templates/login.j225
-rw-r--r--app/templates/macros.j230
5 files changed, 39 insertions, 50 deletions
diff --git a/app/templates/controls.j2 b/app/templates/controls.j2
index eba086d..0acf5a6 100644
--- a/app/templates/controls.j2
+++ b/app/templates/controls.j2
@@ -2,7 +2,7 @@
<div class="fixed-grid has-6-cols">
<div class="grid">
{% for court in courts %}
- {{ court_button(court.id, court.status) }}
+ {{ court_button(court) }}
{% endfor %}
</div>
</div>
diff --git a/app/templates/index.j2 b/app/templates/index.j2
index 656b187..ce0d531 100644
--- a/app/templates/index.j2
+++ b/app/templates/index.j2
@@ -7,15 +7,6 @@
{{ navbar(url_for) }}
<div hx-post="/clear" hx-swap="outerHTML" hx-trigger="load"></div>
<div hx-get="/control" hx-swap="outerHTML" hx-trigger="load"></div>
- {% with messages = get_flashed_messages() %}
- {% if messages %}
- <ul>
- {% for message in messages %}
- <li>{{ message }}</li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endwith %}
{{ footer() }}
</section>
</body>
diff --git a/app/templates/login.html b/app/templates/login.html
new file mode 100644
index 0000000..a42f2c5
--- /dev/null
+++ b/app/templates/login.html
@@ -0,0 +1,23 @@
+{% from "macros.j2" import header, footer, navbar %}
+<!doctype html>
+<html lang="en">
+{{ header(url_for) }}
+<body>
+ <section class="section">
+ {{ navbar(url_for) }}
+ <form action="{{ url_for('simplelogin.login') }}" method="post">
+ <div class="form-group">
+ {{ form.csrf_token }}
+ {{form.username.label(class_="label")}}<div class="control form-control">{{ form.username(class_="input") }}
+ </div><br>
+ {{form.password.label(class_="label")}}<div class="control form-control"> {{ form.password(class_="input") }}
+ </div><br>
+ {% if next %}<input type="hidden" name="next" value="{{next}}">{% endif %}
+ </form>
+ <input class="button is-dark" type="submit" value="Login">
+ </form>
+ {{ footer() }}
+ </section>
+</body>
+
+</html> \ No newline at end of file
diff --git a/app/templates/login.j2 b/app/templates/login.j2
deleted file mode 100644
index fe898cb..0000000
--- a/app/templates/login.j2
+++ /dev/null
@@ -1,25 +0,0 @@
-{% from "macros.j2" import header, footer, navbar %}
-<!doctype html>
-<html lang="en">
- {{ header(url_for) }}
- <body>
- <section class="section">
- {{ navbar(url_for) }}
- <h1>Sign In</h1>
- <form action="" method="post" novalidate>
- {{ form.hidden_tag() }}
- <p>
- {{ form.username.label }}<br>
- {{ form.username(size=32) }}
- </p>
- <p>
- {{ form.password.label }}<br>
- {{ form.password(size=32) }}
- </p>
- <p>{{ form.remember_me() }} {{ form.remember_me.label }}</p>
- <p>{{ form.submit() }}</p>
- </form>
- {{ footer() }}
- </section>
- </body>
-</html>
diff --git a/app/templates/macros.j2 b/app/templates/macros.j2
index a4b2fc1..e8030e7 100644
--- a/app/templates/macros.j2
+++ b/app/templates/macros.j2
@@ -1,7 +1,7 @@
-{% macro court_button(id, status) -%}
-<button class= "button is-responsive {% if status %}is-success{% else %}is-danger{% endif %}"
- hx-post="{{ "/court-toggle/" ~ id}}"
- hx-swap="outerHTML"> Court {{ id }}</button>
+{% macro court_button(court) -%}
+<button class= "button is-responsive {% if court.status %}is-success{% else %}is-danger{% endif %}"
+ hx-post="{{ "/court-toggle/" ~ court.id}}"
+ hx-swap="outerHTML"> Court {{ court.id }}</button>
{%- endmacro %}
{% macro player_button(player) -%}
@@ -34,17 +34,17 @@
{% macro header(url_for) -%}
<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Match Up!</title>
- <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
- <link rel="stylesheet" href="{{ url_for('static', filename='bulma.min.css') }}">
- <link rel="stylesheet" href="{{ url_for('static', filename='notyf.min.css') }}">
- <link rel="stylesheet" href="{{ url_for('static', filename='custom.css') }}">
- <script src="{{ url_for('static', filename='htmx.min.js') }}"></script>
- <script src="{{ url_for('static', filename='notyf.min.js') }}"></script>
- <script src="{{ url_for('static', filename='fontawesome.js') }}"></script>
- <script defer src="{{ url_for('static', filename='custom.js') }}"></script>
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>Match Up!</title>
+<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
+<link rel="stylesheet" href="{{ url_for('static', filename='bulma.min.css') }}">
+<link rel="stylesheet" href="{{ url_for('static', filename='notyf.min.css') }}">
+<link rel="stylesheet" href="{{ url_for('static', filename='custom.css') }}">
+<script src="{{ url_for('static', filename='htmx.min.js') }}"></script>
+<script src="{{ url_for('static', filename='notyf.min.js') }}"></script>
+<script src="{{ url_for('static', filename='fontawesome.js') }}"></script>
+<script defer src="{{ url_for('static', filename='custom.js') }}"></script>
</head>
{%- endmacro %}