diff options
| author | Karan Jayachandra <mail@karanjayachandra.com> | 2025-07-13 18:20:04 +0200 |
|---|---|---|
| committer | Karan Jayachandra <mail@karanjayachandra.com> | 2025-07-13 18:20:04 +0200 |
| commit | d5d64f2b1047f864811d23f19f109a6513c22a2a (patch) | |
| tree | ccea4ca1a4e58e65f74819daa67b8997d583ec71 /app/templates | |
| parent | 673361f4475f0fde43fefa57735d766b4cb22c30 (diff) | |
Working version with several bugs
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/controls.j2 | 4 | ||||
| -rw-r--r-- | app/templates/games.j2 | 12 | ||||
| -rw-r--r-- | app/templates/macros.j2 | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/app/templates/controls.j2 b/app/templates/controls.j2 index 0183c97..eba086d 100644 --- a/app/templates/controls.j2 +++ b/app/templates/controls.j2 @@ -1,8 +1,8 @@ {% from "macros.j2" import court_button %} <div class="fixed-grid has-6-cols"> <div class="grid"> - {% for key, value in courts.items() %} - {{ court_button(key, value) }} + {% for court in courts %} + {{ court_button(court.id, court.status) }} {% endfor %} </div> </div> diff --git a/app/templates/games.j2 b/app/templates/games.j2 index 46150f7..ccfd395 100644 --- a/app/templates/games.j2 +++ b/app/templates/games.j2 @@ -9,12 +9,12 @@ </thead> <tbody> {% for game in games %} - <tr {% if game.team1.player1.first == 'RESERVED' %} class="is-danger" {% endif %}> - <th align="center" style="width: 8%;">{{ game.court }}</th> - <td style="width: 23%;"><strong>{{ game.team1.player1.first }}</strong>{{ " " + game.team1.player1.last }}</th> - <td style="width: 23%;"><strong>{{ game.team1.player2.first }}</strong>{{ " " + game.team1.player2.last }}</th> - <td style="width: 23%;"><strong>{{ game.team2.player1.first }}</strong>{{ " " + game.team2.player1.last }}</th> - <td style="width: 23%;"><strong>{{ game.team2.player2.first }}</strong>{{ " " + game.team2.player2.last }}</th> + <tr {% if game.team_1.player_1.first_name == 'RESERVED' %} class="is-danger" {% endif %}> + <th align="center" style="width: 8%;">{{ game.court_id }}</th> + <td style="width: 23%;"><strong>{{ game.team_1.player_1.first_name }}</strong>{{ " " + game.team_1.player_1.last_name }}</th> + <td style="width: 23%;"><strong>{{ game.team_1.player_2.first_name }}</strong>{{ " " + game.team_1.player_2.last_name }}</th> + <td style="width: 23%;"><strong>{{ game.team_2.player_1.first_name }}</strong>{{ " " + game.team_2.player_1.last_name }}</th> + <td style="width: 23%;"><strong>{{ game.team_2.player_2.first_name }}</strong>{{ " " + game.team_2.player_2.last_name }}</th> </tr> {% endfor %} </tbody> diff --git a/app/templates/macros.j2 b/app/templates/macros.j2 index 2974744..a4b2fc1 100644 --- a/app/templates/macros.j2 +++ b/app/templates/macros.j2 @@ -7,7 +7,7 @@ {% macro player_button(player) -%} <button class="button is-responsive {% if player.status %}is-success{% else %}is-danger {% endif %}" hx-post="{{ "/player-toggle/" ~ player.id}}" - hx-swap="outerHTML"> {{ player.first + " " + player.last}} </button> + hx-swap="outerHTML"> {{ player.first_name + " " + player.last_name}} </button> {%- endmacro %} {% macro guest_control(level, value) -%} |
