diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/court.j2 | 2 | ||||
| -rw-r--r-- | templates/courts.j2 | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/templates/court.j2 b/templates/court.j2 index 425e7d5..5eeb65a 100644 --- a/templates/court.j2 +++ b/templates/court.j2 @@ -1 +1 @@ -<button class={% if court.status %} "button is-success" {% else %} "button is-danger" {% endif %} hx-post="{{ "/court-toggle/" ~ court.number}}" hx-trigger="click" hx-swap="outerHTML">{{ court.number }}</button>
\ No newline at end of file +<button class={% if status %} "button is-success" {% else %} "button is-danger" {% endif %} hx-post="{{ "/court-toggle/" ~ id}}" hx-trigger="click" hx-swap="outerHTML">{{ id }}</button>
\ No newline at end of file diff --git a/templates/courts.j2 b/templates/courts.j2 index 64fd44a..4e3cb3a 100644 --- a/templates/courts.j2 +++ b/templates/courts.j2 @@ -1,8 +1,8 @@ <div class="fixed-grid has-12-cols"> <div class="grid"> -{% for court in courts %} +{% for key, value in courts.items() %} <div class="cell"> - <button class={% if court.status %} "button is-success" {% else %} "button is-danger" {% endif %} hx-post="{{ "/court-toggle/" ~ court.number}}" hx-trigger="click" hx-swap="outerHTML">{{ court.number }}</button> + <button class={% if value %} "button is-success" {% else %} "button is-danger" {% endif %} hx-post="{{ "/court-toggle/" ~ key}}" hx-trigger="click" hx-swap="outerHTML">{{ key }}</button> </div> {% endfor %} </div> |
