mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-25 02:24:26 +00:00
Intercept htmx on submit requests, this allows auto submit from nfc fields
This commit is contained in:
parent
0aa17279f0
commit
55fb89a63e
@ -1,15 +1,14 @@
|
|||||||
<div id="student_card_form">
|
<div id="student_card_form">
|
||||||
<h3>{% trans %}Add a student card{% endtrans %}</h3>
|
<h3>{% trans %}Add a student card{% endtrans %}</h3>
|
||||||
<form>
|
<form
|
||||||
|
hx-trigger="submit"
|
||||||
|
hx-post="{{ action }}"
|
||||||
|
hx-swap="outerHTML"
|
||||||
|
hx-target="#student_card_form"
|
||||||
|
>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form.as_p() }}
|
{{ form.as_p() }}
|
||||||
<button
|
<button>{% trans %}Go{% endtrans %}</button>
|
||||||
hx-post="{{ action }}"
|
|
||||||
hx-swap="outerHTML"
|
|
||||||
hx-target="#student_card_form"
|
|
||||||
>
|
|
||||||
{% trans %}Go{% endtrans %}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
<h6>{% trans %}Registered cards{% endtrans %}</h6>
|
<h6>{% trans %}Registered cards{% endtrans %}</h6>
|
||||||
|
@ -30,11 +30,13 @@
|
|||||||
{{ user_subscription(customer.user) }}
|
{{ user_subscription(customer.user) }}
|
||||||
<p>{% trans %}Amount: {% endtrans %}{{ customer.amount }} €</p>
|
<p>{% trans %}Amount: {% endtrans %}{{ customer.amount }} €</p>
|
||||||
|
|
||||||
<div
|
{% if counter.type == 'BAR' %}
|
||||||
hx-get="{{ url('counter:add_student_card_fragment', counter_id=counter.id, customer_id=customer.pk) }}"
|
<div
|
||||||
hx-trigger="load"
|
hx-get="{{ url('counter:add_student_card_fragment', counter_id=counter.id, customer_id=customer.pk) }}"
|
||||||
hx-swap="outerHTML"
|
hx-trigger="load"
|
||||||
></div>
|
hx-swap="outerHTML"
|
||||||
|
></div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="click_form">
|
<div id="click_form">
|
||||||
|
Loading…
Reference in New Issue
Block a user