Make StudentCardFormView fragment only

This commit is contained in:
2024-12-07 17:28:34 +01:00
parent b81cf49d0a
commit d4b9c3afb1
8 changed files with 234 additions and 188 deletions

View File

@ -32,7 +32,7 @@
{% if counter.type == 'BAR' %}
<div
hx-get="{{ url('counter:add_student_card_fragment', counter_id=counter.id, customer_id=customer.pk) }}"
hx-get="{{ url('counter:add_student_card', customer_id=customer.pk) }}"
hx-trigger="load"
hx-swap="outerHTML"
>

View File

@ -1,7 +1,6 @@
<div id="student_card_form">
<h3>{% trans %}Add a student card{% endtrans %}</h3>
<form
hx-trigger="submit"
hx-post="{{ action }}"
hx-swap="outerHTML"
hx-target="#student_card_form"
@ -16,10 +15,15 @@
<ul>
{% for card in student_cards %}
<li>{{ card.uid }}</li>
<li>
{{ card.uid }}
<a href="{{ url('counter:delete_student_card', customer_id=customer.pk, card_id=card.id) }}">
{% trans %}Delete{% endtrans %}
</a>
</li>
{% endfor %}
</ul>
{% else %}
{% trans %}No card registered{% endtrans %}
<em class="no-cards">{% trans %}No student card registered.{% endtrans %}</em>
{% endif %}
</div>