aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorKaran Jayachandra <karan.jayachandra@nxp.com>2024-10-04 18:23:33 +0200
committerKaran Jayachandra <karan.jayachandra@nxp.com>2024-10-04 18:23:33 +0200
commit88d7300021cd3963f2d6a6202609b0f6e956cdab (patch)
treed9e9e186d86572e57253a188467ebb4084535039 /templates
parentc58caf5b8b8801ba826b0ff6b241d7f25a333bc8 (diff)
Added the games view
Diffstat (limited to 'templates')
-rw-r--r--templates/courts.j23
-rw-r--r--templates/games.j218
-rw-r--r--templates/index.j212
3 files changed, 29 insertions, 4 deletions
diff --git a/templates/courts.j2 b/templates/courts.j2
new file mode 100644
index 0000000..a7893a7
--- /dev/null
+++ b/templates/courts.j2
@@ -0,0 +1,3 @@
+<form hx-post="/courts" hx-trigger="change" hx-swap="outerHTML">
+ <input type="number" disabled id="courts" min="1" max="15" name="courts" value="{{ courts }}">
+</form> \ No newline at end of file
diff --git a/templates/games.j2 b/templates/games.j2
new file mode 100644
index 0000000..22ea936
--- /dev/null
+++ b/templates/games.j2
@@ -0,0 +1,18 @@
+<div class="games">
+<table>
+<tr>
+ <th> Court </th>
+ <th colspan="2"> Team 1 </th>
+ <th colspan="2"> Team 2 </th>
+</tr>
+{% for game in games %}
+ <tr>
+ <th>{{ loop.index }}</th>
+ <td>{{ game.team1.player1.name }}</th>
+ <td>{{ game.team1.player2.name }}</th>
+ <td>{{ game.team2.player1.name }}</th>
+ <td>{{ game.team2.player2.name }}</th>
+ </tr>
+{% endfor %}
+</table>
+</div> \ No newline at end of file
diff --git a/templates/index.j2 b/templates/index.j2
index 82c3c80..be92207 100644
--- a/templates/index.j2
+++ b/templates/index.j2
@@ -30,16 +30,20 @@
</head>
<body>
<header>
- <h1>🏸Match Up!</h1>
- <p class="tagline"> Come play with the <a href="https://www.bctsf.nl/">Smashing Fellows</a>! </p>
+ <h1>🏸The Smashing Fellows </h1>
+ <h4> Total Courts: 8</h4>
</header>
- <hr>
+ <div>
+ <h2>Games</h2>
+ <div class="games" hx-get="/game-list" hx-swap="outerHTML" hx-trigger="revealed"></div>
+ </div>
+ <button hx-post="/new-games" hx-trigger="click" hx-target=".games" hx-swap="outerHTML"> New Games </button>
<div class="players">
<h2>Players</h2>
<div hx-get="/player-list" hx-swap="outerHTML" hx-trigger="revealed"></div>
</div>
<footer>
- Made by <a href="https://karanjayachandra.com/">Karan Jayachandra</a> using <a href="https://htmx.org/">HTMX</a> and <a href="https://flask.palletsprojects.com">Flask</a>
+ Made by <a href="https://karanjayachandra.com/">K. Jayachandra</a> using <a href="https://htmx.org/">HTMX</a> and <a href="https://flask.palletsprojects.com">Flask</a>
</footer>
</body>
</html> \ No newline at end of file