add: single_use products

This commit is contained in:
trisua 2025-08-08 14:17:40 -04:00
parent 7fbc732290
commit e5e6d5cddb
12 changed files with 149 additions and 7 deletions

View file

@ -28,12 +28,19 @@
(icon (text "badge-cent"))
(text "{{ product.price }}"))
(text "{% if user.id != product.owner -%}")
(text "{% if not already_purchased -%}")
(button
("onclick" "purchase()")
("disabled" "{{ product.stock == 0 }}")
(icon (text "piggy-bank"))
(str (text "economy:action.buy")))
(text "{% else %}")
(span
("class" "green flex items_center gap_2")
(icon (text "circle-check"))
(str (text "economy:label.already_purchased")))
(text "{%- endif %}")
(text "{% else %}")
(a
("class" "button")
("href" "/product/{{ product.id }}/edit")