bux fixing on new eboutic (#493)

- les alt des images des produits n'étaient pas bonnes
- les noms de produits avec une apostrophe dedans n'étaient pas cliquables
This commit is contained in:
thomas girod 2022-11-16 19:08:58 +01:00 committed by GitHub
parent 1281104d96
commit 96510b270d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 50 additions and 50 deletions

View File

@ -23,56 +23,56 @@
<h1 id="eboutic-title">{% trans %}Eboutic{% endtrans %}</h1> <h1 id="eboutic-title">{% trans %}Eboutic{% endtrans %}</h1>
<div id="eboutic" x-data="basket"> <div id="eboutic" x-data="basket">
<div id="basket"> <div id="basket">
<h3>Panier</h3> <h3>Panier</h3>
{% if errors %} {% if errors %}
<div class="error-message"> <div class="error-message">
{% for error in errors %} {% for error in errors %}
<p>{{ error }}</p> <p>{{ error }}</p>
{% endfor %} {% endfor %}
{% trans %}Your basket has been cleaned accordingly to those errors.{% endtrans %} {% trans %}Your basket has been cleaned accordingly to those errors.{% endtrans %}
</div> </div>
{% endif %} {% endif %}
<ul class="item-list"> <ul class="item-list">
{# Starting money #} {# Starting money #}
<li> <li>
<span class="item-name"> <span class="item-name">
<strong>{% trans %}Current account amount: {% endtrans %}</strong> <strong>{% trans %}Current account amount: {% endtrans %}</strong>
</span> </span>
<span class="item-price"> <span class="item-price">
<strong>{{ "%0.2f"|format(customer_amount) }} €</strong> <strong>{{ "%0.2f"|format(customer_amount) }} €</strong>
</span> </span>
</li>
<template x-for="item in items" :key="item.id">
<li class="item-row" x-show="item.quantity > 0">
<span class="item-name" x-text="item.name"></span>
<div class="item-quantity">
<i class="fa fa-minus fa-xs" @click="remove(item.id)"></i>
<span x-text="item.quantity"></span>
<i class="fa fa-plus" @click="add(item)"></i>
</div>
<span class="item-price" x-text="(item.unit_price * item.quantity).toFixed(2) + ' €'"></span>
</li> </li>
</template> <template x-for="item in items" :key="item.id">
{# Total price #} <li class="item-row" x-show="item.quantity > 0">
<li style="margin-top: 20px"> <span class="item-name" x-text="item.name"></span>
<span class="item-name"><strong>{% trans %}Basket amount: {% endtrans %}</strong></span> <div class="item-quantity">
<span x-text="get_total().toFixed(2) + ' €'" class="item-price"></span> <i class="fa fa-minus fa-xs" @click="remove(item.id)"></i>
</li> <span x-text="item.quantity"></span>
</ul> <i class="fa fa-plus" @click="add(item)"></i>
<div class="catalog-buttons"> </div>
<button @click="clear_basket()" class="clear"> <span class="item-price" x-text="(item.unit_price * item.quantity).toFixed(2) + ' €'"></span>
<i class="fa fa-trash"></i> </li>
{% trans %}Clear{% endtrans %} </template>
</button> {# Total price #}
<form method="post" action="{{ url('eboutic:command') }}"> <li style="margin-top: 20px">
{% csrf_token %} <span class="item-name"><strong>{% trans %}Basket amount: {% endtrans %}</strong></span>
<button class="validate"> <span x-text="get_total().toFixed(2) + ' €'" class="item-price"></span>
<i class="fa fa-check"></i> </li>
<input type="submit" value="{% trans %}Validate{% endtrans %}"/> </ul>
<div class="catalog-buttons">
<button @click="clear_basket()" class="clear">
<i class="fa fa-trash"></i>
{% trans %}Clear{% endtrans %}
</button> </button>
</form> <form method="post" action="{{ url('eboutic:command') }}">
{% csrf_token %}
<button class="validate">
<i class="fa fa-check"></i>
<input type="submit" value="{% trans %}Validate{% endtrans %}"/>
</button>
</form>
</div>
</div> </div>
</div>
<div id="catalog"> <div id="catalog">
{% if not request.user.date_of_birth %} {% if not request.user.date_of_birth %}
<div class="alert" x-data="{show_alert: true}" x-show="show_alert" x-transition> <div class="alert" x-data="{show_alert: true}" x-show="show_alert" x-transition>
@ -102,10 +102,10 @@
<div class="product-group"> <div class="product-group">
{% for p in items %} {% for p in items %}
<button class="product-button" <button class="product-button"
@click="add_from_catalog({{ p.id }}, '{{ p.name }}', {{ p.selling_price }})"> @click='add_from_catalog({{ p.id }}, {{ p.name|tojson }}, {{ p.selling_price }})'>
{% if p.icon %} {% if p.icon %}
<img src="{{ p.icon.url }}" alt="image de {{ p.product_name }}" width="40px" <img src="{{ p.icon.url }}" alt="image de {{ p.name }}"
height="40px"> width="40px" height="40px">
{% else %} {% else %}
<i class="fa fa-2x fa-picture-o"></i> <i class="fa fa-2x fa-picture-o"></i>
{% endif %} {% endif %}