mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-14 02:03:22 +00:00
70 lines
2.1 KiB
Django/Jinja
70 lines
2.1 KiB
Django/Jinja
{% extends "core/base.jinja" %}
|
|
|
|
{% block title %}
|
|
{% trans %}Basket state{% endtrans %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<h3>{% trans %}Eboutic{% endtrans %}</h3>
|
|
|
|
<div>
|
|
<p>{% trans %}Basket: {% endtrans %}</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<td>Article</td>
|
|
<td>Quantity</td>
|
|
<td>Unit price</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in basket.items.all() %}
|
|
<tr>
|
|
<td>{{ item.product_name }}</td>
|
|
<td>{{ item.quantity }}</td>
|
|
<td>{{ item.product_unit_price }} €</td>
|
|
</tr>
|
|
{% endfor %}
|
|
<tbody>
|
|
</table>
|
|
|
|
<p>
|
|
<strong>{% trans %}Basket amount: {% endtrans %}{{ "%0.2f"|format(basket.get_total()) }} €</strong>
|
|
|
|
{% if customer_amount != None %}
|
|
<br>
|
|
{% trans %}Current account amount: {% endtrans %}<strong>{{ "%0.2f"|format(customer_amount) }} €</strong>
|
|
|
|
{% if not basket.contains_refilling_item %}
|
|
<br>
|
|
{% trans %}Remaining account amount: {% endtrans %}<strong>{{ "%0.2f"|format(customer_amount - basket.get_total()) }} €</strong>
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
{% if settings.SITH_EBOUTIC_CB_ENABLED %}
|
|
<form method="post" action="{{ settings.SITH_EBOUTIC_ET_URL }}">
|
|
<p>
|
|
{% for (field_name,field_value) in et_request.items() -%}
|
|
<input type="hidden" name="{{ field_name }}" value="{{ field_value }}">
|
|
{% endfor %}
|
|
<input type="submit" value="{% trans %}Pay with credit card{% endtrans %}" />
|
|
</p>
|
|
</form>
|
|
{% endif %}
|
|
{% if basket.contains_refilling_item %}
|
|
<p>{% trans %}AE account payment disabled because your basket contains refilling items.{% endtrans %}</p>
|
|
{% else %}
|
|
<form method="post" action="{{ url('eboutic:pay_with_sith') }}">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="action" value="pay_with_sith_account">
|
|
<input type="submit" value="{% trans %}Pay with Sith account{% endtrans %}" />
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|