Sith/counter/templates/counter/fragments/create_student_card.jinja

31 lines
945 B
Django/Jinja

<div id="student_card_form">
<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>
<span tooltip="{% trans uid=customer.student_card.uid %}uid: {{ uid }} {% endtrans %}">
{% trans %}Card registered{% endtrans %}
<i class="fa fa-check" style="color: green"></i>
</span>
&nbsp; - &nbsp;
<button
hx-get="{{ url('counter:delete_student_card', customer_id=customer.pk) }}"
hx-swap="outerHTML"
hx-target="#student_card_form"
>
{% trans %}Delete{% endtrans %}
</button>
</p>
{% endif %}
</div>