svg
This commit is contained in:
@ -12,10 +12,16 @@
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
|
||||
<a class="btn btn-secondary" href={{ path('app_category') }}>Annuler</a>
|
||||
{% if by=="admin" %}
|
||||
<a class="btn btn-secondary" href={{ path('app_admin_category',{'by':by,'userid':-1}) }}>Annuler</a>
|
||||
{% elseif by=="update" %}
|
||||
<a class="btn btn-secondary" href={{ path('app_user_update',{id:userid}) }}>Annuler</a>
|
||||
{% elseif by=="profil" %}
|
||||
<a class="btn btn-secondary" href={{ path('app_user_profil') }}>Annuler</a>
|
||||
{% endif %}
|
||||
|
||||
{% if mode=="update" and category.id >= 0 %}
|
||||
<a href="{{ path('app_category_delete',{'id':category.id}) }}"
|
||||
<a href="{{ path('app_category_delete',{'id':category.id,'by':by}) }}"
|
||||
class="btn btn-danger float-right"
|
||||
data-method="delete"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?">
|
||||
@ -49,6 +55,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.user) }}
|
||||
{{ form_row(form.order) }}
|
||||
{{ form_row(form.name) }}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
CATEGORIES
|
||||
</h1>
|
||||
|
||||
<p><a class="btn btn-success" href={{ path('app_category_submit') }}>Ajouter</a></p>
|
||||
<p><a class="btn btn-success" href={{ path('app_category_submit',{by:"admin",userid:-1}) }}>Ajouter</a></p>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
@ -18,6 +18,7 @@ CATEGORIES
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="70px" class="no-sort">Action</th>
|
||||
<th width="70px">Utilisateur</th>
|
||||
<th width="70px">Ordre</th>
|
||||
<th>Nom</th>
|
||||
</tr>
|
||||
@ -26,11 +27,12 @@ CATEGORIES
|
||||
{% for category in categorys %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{path("app_category_update",{id:category.id})}}"><i class="fa fa-file"></i></a>
|
||||
<a href="{{path("app_category_update",{id:category.id,by:'admin'})}}"><i class="fa fa-file"></i></a>
|
||||
{% if category.id >=0 %}
|
||||
<a href="{{path("app_category_delete",{id:category.id})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
|
||||
<a href="{{path("app_category_delete",{id:category.id,by:'admin'})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{category.user.username}}</td>
|
||||
<td>{{category.order}}</td>
|
||||
<td>{{category.name}}</td>
|
||||
</tr>
|
||||
|
38
templates/Category/listrender.html.twig
Normal file
38
templates/Category/listrender.html.twig
Normal file
@ -0,0 +1,38 @@
|
||||
<p><a class="btn btn-success" href={{ path('app_category_submit',{by:by,userid:userid}) }}>Ajouter</a></p>
|
||||
|
||||
<div class="dataTable_wrapper" style="zoom:80%" >
|
||||
<table class="table table-striped table-bordered table-hover" id="categorys" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="70px" class="no-sort">Action</th>
|
||||
<th width="70px">Ordre</th>
|
||||
<th>Nom</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for category in categorys %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{path("app_category_update",{id:category.id,by:by})}}"><i class="fa fa-file"></i></a>
|
||||
{% if category.id >=0 %}
|
||||
<a href="{{path("app_category_delete",{id:category.id,by:by})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{category.order}}</td>
|
||||
<td>{{category.name}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#categorys').DataTable({
|
||||
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 10,
|
||||
order: [[ 1, "asc" ]]
|
||||
});
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user