mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
feat: make student card unique per user
This commit is contained in:
@ -31,7 +31,7 @@
|
||||
<p>{% trans %}Amount: {% endtrans %}{{ customer.amount }} €</p>
|
||||
|
||||
{% if counter.type == 'BAR' %}
|
||||
{{ student_card }}
|
||||
{{ student_card_fragment }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
@ -1,29 +1,22 @@
|
||||
<div id="student_card_form">
|
||||
<h3>{% trans %}Add a student card{% endtrans %}</h3>
|
||||
<form
|
||||
hx-post="{{ action }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-target="#student_card_form"
|
||||
>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p() }}
|
||||
<input type="submit" value="{% trans %}Go{% endtrans %}"/>
|
||||
|
||||
</form>
|
||||
<h6>{% trans %}Registered cards{% endtrans %}</h6>
|
||||
{% if student_cards %}
|
||||
|
||||
<ul>
|
||||
{% for card in student_cards %}
|
||||
<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 %}
|
||||
<h3>{% trans %}Student card{% endtrans %}</h3>
|
||||
{% if not customer.student_card %}
|
||||
<form
|
||||
hx-post="{{ action }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-target="#student_card_form"
|
||||
>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p() }}
|
||||
<input type="submit" value="{% trans %}Go{% endtrans %}"/>
|
||||
</form>
|
||||
<em class="no-cards">{% trans %}No student card registered.{% endtrans %}</em>
|
||||
{% else %}
|
||||
<p>
|
||||
{% trans %}Registered{% endtrans %} <i class="fa fa-check"></i> -
|
||||
<a href="{{ url('counter:delete_student_card', customer_id=customer.pk) }}">
|
||||
{% trans %}Delete{% endtrans %}
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user