aboutsummaryrefslogtreecommitdiff
path: root/templates/macros.j2
diff options
context:
space:
mode:
authorKaran Jayachandra <mail@karanjayachandra.com>2024-10-16 21:41:27 +0000
committerKaran Jayachandra <mail@karanjayachandra.com>2024-10-16 21:41:27 +0000
commit36cc7d82a55cbd8167e1f52637dd1938497dd8cc (patch)
tree096d2b629818f79674d22a14eff124f082449b6e /templates/macros.j2
parentd18e5880b47fcdf6542bcb9502e8cf35a4276f05 (diff)
parent9d25fd163d2b8ba8978747c1edc1fc0d2073f076 (diff)
Merge branch 'feature/db' into 'develop'
Full Functionality See merge request KaranJayachandra/match_up!2
Diffstat (limited to 'templates/macros.j2')
-rw-r--r--templates/macros.j223
1 files changed, 23 insertions, 0 deletions
diff --git a/templates/macros.j2 b/templates/macros.j2
new file mode 100644
index 0000000..7117d11
--- /dev/null
+++ b/templates/macros.j2
@@ -0,0 +1,23 @@
+{% macro court(id, status) -%}
+<button class= "button is-large is-responsive {% if status %}is-success{% else %}is-danger{% endif %}"
+ hx-post="{{ "/court-toggle/" ~ id}}"
+ hx-swap="outerHTML">{{ id }}</button>
+{%- endmacro %}
+
+{% macro player(id, status, name) -%}
+<button class="button is-medium is-responsive {% if status %}is-success{% else %}is-danger {% endif %}"
+ hx-post="{{ "/player-toggle/" ~ id}}"
+ hx-swap="outerHTML"> {{ name }} </button>
+{%- endmacro %}
+
+{% macro guests(count) -%}
+<div class="control" id="guests">
+ <input class="input is-large is-responsive" type="text" style="text-align:center" value="{{ count }} Guests" disabled>
+</div>
+{%- endmacro %}
+
+{% macro timer(mins, secs) -%}
+<div hx-get="/time" hx-swap="outerHTML" hx-trigger="every 1s">
+ <p class="title">Timer: {{mins}}:{{secs}}</p>
+</div>
+{%- endmacro %} \ No newline at end of file