aboutsummaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
authorKaran Jayachandra <karan.jayachandra@nxp.com>2025-07-25 16:06:20 +0200
committerKaran Jayachandra <karan.jayachandra@nxp.com>2025-07-25 16:06:20 +0200
commit63e1b52e1b76e136e6534949980d85ffe413f0c9 (patch)
treea4f8e5745ad11be7e2f79740f3c590f4a67224a4 /app/templates
parentc041e74af8c69e8fb0680558e23dd7be542afcf6 (diff)
Working mobile and desktop version
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/controls.j212
-rw-r--r--app/templates/games.j22
-rw-r--r--app/templates/index.j24
-rw-r--r--app/templates/macros.j24
-rw-r--r--app/templates/players.j214
5 files changed, 13 insertions, 23 deletions
diff --git a/app/templates/controls.j2 b/app/templates/controls.j2
index 14e7520..8e7440e 100644
--- a/app/templates/controls.j2
+++ b/app/templates/controls.j2
@@ -1,10 +1,4 @@
{% from "macros.j2" import court_button %}
-<h3>Courts</h3>
-<div class="parent">
-{% for court in courts %}
- {{ court_button(court) }}
-{% endfor %}
-</div>
<h3>Generation</h3>
<div class="grid">
<div class="select is-responsive">
@@ -47,4 +41,10 @@
<div class="grid">
<button id="timer-start"><i class="fas fa-light fa-play"></i></button>
<button id="timer-stop"><i class="fas fa-light fa-stop"></i></button>
+</div>
+<h3>Courts</h3>
+<div class="parent">
+{% for court in courts %}
+ {{ court_button(court) }}
+{% endfor %}
</div> \ No newline at end of file
diff --git a/app/templates/games.j2 b/app/templates/games.j2
index ce2a412..5041ce1 100644
--- a/app/templates/games.j2
+++ b/app/templates/games.j2
@@ -10,7 +10,7 @@
</thead>
<tbody>
{% for game in games %}
- <tr {% if game.team_1[0].first_name == 'RESERVED' %} class="is-danger" {% endif %}>
+ <tr {% if game.team_1[0].first_name == 'RESERVED' %} data-theme="dark" {% endif %}>
<th align="center" style="width: 8%;">{{ game.court.id }}</th>
<td style="width: 23%;"><strong>{{ game.team_1[0].first_name }}</strong>{{ " " + game.team_1[0].last_name }}</th>
<td style="width: 23%;"><strong>{{ game.team_1[1].first_name }}</strong>{{ " " + game.team_1[1].last_name }}</th>
diff --git a/app/templates/index.j2 b/app/templates/index.j2
index 8a13fa0..af6ca4c 100644
--- a/app/templates/index.j2
+++ b/app/templates/index.j2
@@ -3,7 +3,7 @@
<html lang="en">
{{ header(url_for) }}
<body>
- <header class="container">{{ navbar(url_for) }}</header>
+ <header class="container">{{ navbar(url_for, login_status) }}</header>
<main class="container">
<h2>Games</h2>
<div hx-post="/clear" hx-swap="outerHTML" hx-trigger="load"></div>
@@ -11,6 +11,6 @@
<div hx-get="/control" hx-swap="outerHTML" hx-trigger="load"></div>
</main>
<footer class="container">{{ footer() }}</footer>
- <script defer src="{{ url_for('static', filename='custom.js') }}"></script>
+ <script src="{{ url_for('static', filename='timer.js') }}"></script>
</body>
</html>
diff --git a/app/templates/macros.j2 b/app/templates/macros.j2
index 17a2940..e82b910 100644
--- a/app/templates/macros.j2
+++ b/app/templates/macros.j2
@@ -31,7 +31,7 @@
{%- endmacro %}
-{% macro navbar(url_for) -%}
+{% macro navbar(url_for, login_status) -%}
<nav>
<ul>
<li><strong>Match Up!</strong></li>
@@ -39,7 +39,7 @@
<ul>
<li><a href="/">Games</a></li>
<li><a href="/players">Players</a></li>
- <li><a href="/login/">Admin</a></li>
+ {% if login_status %}<li><a href="/logout/">Logout</a></li>{% else %}<li><a href="/login/">Login</a></li>{% endif %}
</ul>
</nav>
{%- endmacro %} \ No newline at end of file
diff --git a/app/templates/players.j2 b/app/templates/players.j2
index 4b9660e..bacb215 100644
--- a/app/templates/players.j2
+++ b/app/templates/players.j2
@@ -3,7 +3,7 @@
<html lang="en">
{{ header(url_for) }}
<body>
- <header class="container">{{ navbar(url_for) }}</header>
+ <header class="container">{{ navbar(url_for, login_status) }}</header>
<main class="container">
<h3 >Members</h3>
<div class="parent">
@@ -34,17 +34,7 @@
</form>
</div>
<footer class="container">{{ footer() }}</footer>
- <script>
- const fileInput = document.querySelector("#file-js input[type=file]");
- if (fileInput !== null) {
- fileInput.onchange = () => {
- if (fileInput.files.length > 0) {
- const fileName = document.querySelector("#file-js .file-name");
- fileName.textContent = fileInput.files[0].name;
- }
- }
- };
- </script>
+ <script src="{{ url_for('static', filename='file.js') }}"></script>
</main>
</body>
</html> \ No newline at end of file