Skip to content
Snippets Groups Projects
Commit 741624cc authored by AKIFI NAIL's avatar AKIFI NAIL
Browse files

backoffice admin

parent 9e5a2f23
Branches
No related merge requests found
......@@ -1110,6 +1110,7 @@ aside article{
background-color: red;
color: white;
transition: all 0.6s ease;
cursor: pointer;
}
.form-field{
......@@ -1328,3 +1329,84 @@ margin-top: 10rem;
transition: all .4s ease;
cursor: pointer;
}
.admin-title{
margin-left: 2rem;
font-size: 2rem;
}
.table {
width: 90%;
border-collapse: collapse;
margin: auto;
}
.table th,
.table td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
.table th {
background-color: #e0b8ff;
}
.table tbody tr:nth-child(even) {
background-color: #f2f2f2;
}
.table tbody tr:hover {
background-color: #ddd;
}
.table td a {
display: inline-block;
margin-right: 5px;
text-decoration: none;
}
.blue{
color: #3b82f6;
}
.table2 {
width: 90%;
border-collapse: collapse;
margin: auto;
}
.table2 th,
.table2 td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
.table2 th {
background-color: #39c0fd;
}
.table2 tbody tr:nth-child(even) {
background-color: #f2f2f2;
}
.table2 tbody tr:hover {
background-color: #ddd;
}
.table2 td a {
display: inline-block;
margin-right: 5px;
text-decoration: none;
}
.orange{
color: #ff8700;
.ml-2{
margin-left: 1rem;
}
\ No newline at end of file
<form method="post" action="{{ path('app_produits_delete', {'id': produit.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ produit.id) }}">
<button class="btn">Delete</button>
<button class="deco">Delete</button>
</form>
......@@ -4,10 +4,6 @@
{% block body %}
{% if is_granted('ROLE_ADMIN') %}
<a href="{{ path('app_produits_edit', {'id': produit.id}) }}">edit</a>
{{ include('produits/_delete_form.html.twig') }}
{% endif %}
......@@ -60,6 +56,13 @@
</div>
</div>
</article>
{% if is_granted('ROLE_ADMIN') %}
<div class="row gap-small ml-2">
<a href="{{ path('app_produits_edit', {'id': produit.id}) }}" class="blue">edit</a>
{{ include('produits/_delete_form.html.twig') }}
</div>
{% endif %}
</section>
<script src="{{ asset('show.js') }}" defer></script>
{% endblock %}
......
......@@ -3,9 +3,9 @@
{% block title %}User index{% endblock %}
{% block body %}
<h1>User index</h1>
<h1 class="text-c">Panel <span class="red">Admin</span></h1>
{{ dump(produits) }}
<h2 class="admin-title">Listes des utilisateurs 🙎‍♂️</h2>
<table class="table">
<thead>
......@@ -25,23 +25,54 @@
<td>{{ user.roles ? user.roles|json_encode : '' }}</td>
<td>{{ user.password }}</td>
<td>
<a href="{{ path('app_user_show', {'id': user.id}) }}">show</a>
<a href="{{ path('app_user_edit_admin', {'id': user.id}) }}">edit</a>
<a href="{{ path('app_user_show', {'id': user.id}) }}" class="green">show</a>
<a href="{{ path('app_user_edit_admin', {'id': user.id}) }}" class="blue">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<h2 class="admin-title">Listes des produits 👟️</h2>
<table class="table2">
<thead>
<tr>
<th>Id</th>
<th>Nom</th>
<th>Prix</th>
<th>Marque</th>
<th>Couleur</th>
<th>Stock</th>
<th>NBR. Achat</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for produit in produits %}
<tr>
<td>{{ produit.id }}</td>
<td>{{ produit.nom }}</td>
<td>${{ produit.prix}}</td>
<td>{{ produit.marque.nom }}</td>
<td>{{ produit.couleur.nom }}</td>
{% if produit.stock == 0 %}
<td class="red"><b>{{ produit.stock }}</b></td>
{% elseif produit.stock < 10 %}
<td class="orange"><b>{{ produit.stock }}</b></td>
{% else %}
<td class="green"><b>{{ produit.stock }}</b></td>
{% endif %}
<a href="{{ path('app_user_new') }}">Create new</a>
{% for produit in produits %}
<p>{{ produit.nom }}</p>
<p>{{ produit.stock }}</p>
{% endfor %}
<td class="blue"><b>{{ produit.buycount }}</b></td>
<td>
<a href="{{ path('app_produits_show', {'id': produit.id}) }}" class="green">show</a>
<a href="{{ path('app_produits_edit', {'id': produit.id}) }}" class="blue">edit</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
......@@ -21,8 +21,6 @@
</a>
<a href="{{ path('app_logout') }}" class="deco" >Deconnexion</a>
</div>
<h2>Votre panier</h2>
{% endblock %}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment