restreinte des index si on est pas ROLE_ADMIN

This commit is contained in:
Tykayn 2025-02-26 18:19:05 +01:00 committed by tykayn
parent b79fc2ac9f
commit 20611e96c2
16 changed files with 116 additions and 35 deletions

View file

@ -3,8 +3,9 @@
{% block title %}Expense index{% endblock %}
{% block body %}
<h1>Expense index</h1>
<h1>Index des dépenses</h1>
<a href="{{ path('app_expense_new') }}"class="btn btn-primary btn-create" >Créer</a>
<table class="table">
<thead>
<tr>
@ -33,5 +34,5 @@
</tbody>
</table>
<a href="{{ path('app_expense_new') }}">Create new</a>
<a href="{{ path('app_expense_new') }}"class="btn btn-primary btn-create" >Créer</a>
{% endblock %}

View file

@ -3,7 +3,7 @@
{% block title %}Festival index{% endblock %}
{% block body %}
<h1>Festival index</h1>
<h1>Index des Festivals</h1>
<table class="table">
<thead>
@ -56,5 +56,5 @@
</tbody>
</table>
<a href="{{ path('app_festival_new') }}">Create new</a>
<a href="{{ path('app_festival_new') }}"class="btn btn-primary btn-create" >Créer</a>
{% endblock %}

View file

@ -3,8 +3,9 @@
{% block title %}GroupOfProducts index{% endblock %}
{% block body %}
<h1>GroupOfProducts index</h1>
<h1>Index des groupes de produits (ou catégories)</h1>
<a href="{{ path('app_group_of_products_new') }}"class="btn btn-primary btn-create" >Créer</a>
<table class="table">
<thead>
<tr>
@ -31,5 +32,5 @@
</tbody>
</table>
<a href="{{ path('app_group_of_products_new') }}">Create new</a>
<a href="{{ path('app_group_of_products_new') }}"class="btn btn-primary btn-create" >Créer</a>
{% endblock %}

View file

@ -132,9 +132,15 @@
{{ vente.sum }}
</td>
<td>
<a href="{{ path('app_selling_delete',{id: vente.id }) }}"
class="btn btn-warning pull-right">
<i class="fa fa-trash"></i>
{% if is_granted('ROLE_ADMIN') %}
<a href="{{ path('app_selling_delete',{id: vente.id }) }}"
class="btn btn-warning pull-right">
<i class="fa fa-trash"></i>
</a>
{% endif %}
<a href="{{ path('app_selling_show', {id: vente.id}) }}"
class="btn btn-primary pull-right">
<i class="fa fa-eye"></i>
</a>
</td>
</tr> {% endfor %}

View file

@ -5,7 +5,8 @@
{% block body %}
<h1>Product index</h1>
<h1>Index des produits</h1>
<a href="{{ path('app_product_new') }}"class="btn btn-primary btn-create" >Créer</a>
<table class="table">
<thead>
@ -47,5 +48,5 @@
</tbody>
</table>
<a href="{{ path('app_product_new') }}">Create new</a>
<a href="{{ path('app_product_new') }}"class="btn btn-primary btn-create" >Créer</a>
{% endblock %}

View file

@ -35,5 +35,5 @@
</tbody>
</table>
<a href="{{ path('app_selling_new') }}">Create new</a>
<a href="{{ path('app_selling_new') }}"class="btn btn-primary btn-create" >Créer</a>
{% endblock %}

View file

@ -17,18 +17,56 @@
</tr>
<tr>
<th>Sum</th>
<td>{{ selling.sum }}</td>
<td>{{ selling.sum }}</td>
</tr>
<tr>
<th>Reduction</th>
<td>{{ selling.reduction }}</td>
<td>{{ selling.reduction }}</td>
</tr>
<tr>
<th>Date</th>
<td>{{ selling.date ? selling.date|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>Comment</th>
<td>{{ selling.note }}</td>
</tr>
<tr>
<th>Festival</th>
<td>
{% if selling.festival %}
<a href="{{ path('app_festival_show', {'id': selling.festival.id}) }}">
{{ selling.festival.name }},
{{ selling.festival.dateStart|date('d/m/Y') }} - {{ selling.festival.dateEnd|date('d/m/Y') }}
</a>
{% else %}
Aucun festival associé
{% endif %}
</td>
</tr>
<tr>
<th>Products</th>
<td>
<ul>
{% for product in selling.products %}
<li>
<a href="{{ path('app_product_show', {'id': product.id}) }}">
{{ product.name }}
</a>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_selling_index') }}">back to list</a>
<a class="btn btn-default" href="{{ path('app_selling_index') }}">back to list</a>
<a href="{{ path('app_selling_edit', {'id': selling.id}) }}">edit</a>
<a class="btn btn-primary" href="{{ path('app_selling_edit', {'id': selling.id}) }}">edit</a>
{% if is_granted('ROLE_ADMIN') %}
{{ include('selling/_delete_form.html.twig') }}
{% endif %}
{{ include('selling/_delete_form.html.twig') }}
{% endblock %}

View file

@ -35,5 +35,5 @@
</tbody>
</table>
<a href="{{ path('app_serie_festival_new') }}">Create new</a>
<a href="{{ path('app_serie_festival_new') }}"class="btn btn-primary btn-create" >Créer</a>
{% endblock %}