htmx liveswap for increase/decrease
This commit is contained in:
parent
4aa1fa5731
commit
d1585409a2
5 changed files with 7 additions and 4 deletions
|
|
@ -14,3 +14,6 @@ tower-http = { version = "0.6.6", features = ["trace"] }
|
||||||
tower-request-id = "0.3.0"
|
tower-request-id = "0.3.0"
|
||||||
tracing = "0.1.41"
|
tracing = "0.1.41"
|
||||||
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
|
||||||
|
|
||||||
|
[profile.dev.package.askama_derive]
|
||||||
|
opt-level = 3
|
||||||
|
|
|
||||||
BIN
foods.db
BIN
foods.db
Binary file not shown.
BIN
foods.db-journal
BIN
foods.db-journal
Binary file not shown.
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="card">
|
<div class="card" id="card-{{ food.id }}">
|
||||||
<p class="food-name">
|
<p class="food-name">
|
||||||
{{ food.name }}
|
{{ food.name }}
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button class="increase">+</button>
|
<button class="increase" hx-post="/increase/{{ food.id }}" hx-target="#card-{{ food.id }}">+</button>
|
||||||
<button class="decrease">-</button>
|
<button class="decrease" hx-post="/decrease/{{ food.id }}" hx-target="#card-{{ food.id }}">-</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="checkboxes">
|
<div class="checkboxes">
|
||||||
{% for counter in self::range(10) %}
|
{% for counter in self::range(10) %}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<header>
|
<header id="header" hx-swap-oob="true">
|
||||||
<span>
|
<span>
|
||||||
Datum: {{ date }}
|
Datum: {{ date }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue