htmx liveswap for increase/decrease

This commit is contained in:
Khaïs COLIN 2025-10-24 17:46:19 +02:00
parent 4aa1fa5731
commit d1585409a2
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
5 changed files with 7 additions and 4 deletions

View file

@ -1,4 +1,4 @@
<div class="card">
<div class="card" id="card-{{ food.id }}">
<p class="food-name">
{{ food.name }}
</p>
@ -12,8 +12,8 @@
</p>
</div>
<div class="buttons">
<button class="increase">+</button>
<button class="decrease">-</button>
<button class="increase" hx-post="/increase/{{ food.id }}" hx-target="#card-{{ food.id }}">+</button>
<button class="decrease" hx-post="/decrease/{{ food.id }}" hx-target="#card-{{ food.id }}">-</button>
</div>
<div class="checkboxes">
{% for counter in self::range(10) %}

View file

@ -1,4 +1,4 @@
<header>
<header id="header" hx-swap-oob="true">
<span>
Datum: {{ date }}
</span>