toulouse-2022: add a maelis basket cell (#73962)

This commit is contained in:
Nicolas Roche 2023-01-30 03:46:38 +01:00 committed by Gitea
parent 3984cfccf8
commit 092b840f2d
2 changed files with 107 additions and 0 deletions

View File

@ -162,6 +162,27 @@
{"label": "Identifiant du connecteur", "varname": "slug", "required": true},
{"label": "URL de la démarche de réservation", "varname": "form_url", "required": true}
]
},
"toulouse-maelis-basket": {
"cache_duration": 0,
"force_async": true,
"auto_refresh": 30,
"name": "Toulouse - Maelis: Panier",
"url": "{{ passerelle_url }}toulouse-maelis/{{ slug }}/get-basket?{% if foyer_id %}family_id={{ foyer_id }}{% else %}NameID={{ user_nameid }}{% endif %}",
"form": [
{"label": "Slug du connecteur", "varname": "slug", "required": true}
],
"actions": {
"delete-line": {
"url": "{{passerelle_url}}toulouse-maelis/{{ slug }}/delete-basket-line?{% if foyer_id %}family_id={{ foyer_id }}{% else %}NameID={{ user_nameid }}{% endif %}"
},
"delete": {
"url": "{{passerelle_url}}toulouse-maelis/{{ slug }}/delete-basket?{% if foyer_id %}family_id={{ foyer_id }}{% else %}NameID={{ user_nameid }}{% endif %}"
},
"validate": {
"url": "{{passerelle_url}}toulouse-maelis/{{ slug }}/validate-basket?{% if foyer_id %}family_id={{ foyer_id }}{% else %}NameID={{ user_nameid }}{% endif %}"
}
}
}
}
}

View File

@ -0,0 +1,86 @@
<h2>Pannier</h2>
<div class="toulouse-maelis-basket--data pk-table-wrapper">
<table class="toulouse-maelis-basket--data-table pk-data-table">
<thead>
<tr>
<th class="toulouse-maelis-basket-line-person">Personne</th>
<th class="toulouse-maelis-basket-line-activity">Activité</th>
<th class="toulouse-maelis-basket-line-unit">Unité</th>
<th class="toulouse-maelis-basket-line-place">Lieu</th>
<th class="toulouse-maelis-basket-line-start-date">Début</th>
<th class="toulouse-maelis-basket-line-end-date">Fin</th>
<th class="toulouse-maelis-basket-line-unit-price">Prix unitaire</th>
<th class="toulouse-maelis-basket-line-quantity">Quantité</th>
<th class="toulouse-maelis-basket-line-amount">Total</th>
<th></th>
</tr>
</thead>
<tbody>
{% for item in json.data.lignes %}
<tr class="toulouse-maelis-basket-lines">
<td class="toulouse-maelis-basket-line-person">{{ item.personneInfo.firstname }}</td>
<td class="toulouse-maelis-basket-line-activity">{{ item.inscription.libAct }}</td>
<td class="toulouse-maelis-basket-line-unit">{{ item.inscription.libUnit }}</td>
<td class="toulouse-maelis-basket-line-place">{{ item.inscription.libLieu }}</td>
<td class="toulouse-maelis-basket-line-start-date">{{ item.inscription.dateDeb|date:'d/m/Y' }}</td>
<td class="toulouse-maelis-basket-line-end-date">{{ item.inscription.dateFin|date:'d/m/Y' }}</td>
<td class="toulouse-maelis-basket-line-unit-price">{{ item.prixUnit|default:'---' }}</td>
<td class="toulouse-maelis-basket-line-quantity">{{ item.qte|default:'---' }}</td>
<td class="toulouse-maelis-basket-line-amount">{{ item.montant|default:'---' }}</td>
<td class="toulouse-maelis-basket-line-end">
<form id="delete-basket-line" method="POST" action="{{ site_base }}{% url 'combo-public-ajax-page-cell' page_pk=cell.page.id cell_reference=cell.get_reference %}">
<input type="hidden" name="action" value="delete-line">
<input type="hidden" name="line_id" value="{{ item.id }}">
<button class="icon-trash"></button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="toulouse-maelis-basket--footer">
<form id="delete-basket" method="POST" action="{{ site_base }}{% url 'combo-public-ajax-page-cell' page_pk=cell.page.id cell_reference=cell.get_reference %}">
<input type="hidden" name="action" value="delete">
<button class="icon-trash">Vider</button>
</form>
<form id="validate-basket" method="POST" action="{{ site_base }}{% url 'combo-public-ajax-page-cell' page_pk=cell.page.id cell_reference=cell.get_reference %}">
<input type="hidden" name="action" value="validate">
<button class="icon-check">Valider</button>
</form>
</div>
<style>
.toulouse-maelis-basket--data-table {
width: 100%;
overflow: auto;
}
.toulouse-maelis-basket--data-table th.toulouse-maelis-basket-activity, th.toulouse-maelis-basket-unit, th.toulouse-maelis-basket-place {
width: 20%;
}
.toulouse-maelis-basket--data-table td.amount {
text-align: right;
}
.toulouse-maelis-basket--data-table td:last-child {
width: 8em;
}
button.icon-trash:before {
font-family: FontAwesome;
content: "\f1f8\00a0"; // trash
}
button.icon-check:before {
font-family: FontAwesome;
content: "\f00c\00a0"; // check
}
.toulouse-maelis-basket--footer {
padding-top: 1em;
display: flex;
justify-content: center;
}
</style>
</div>