This commit is contained in:
2024-10-30 17:58:39 +01:00
parent d73127b09e
commit 8692adeae3
13 changed files with 192 additions and 88 deletions

View File

@ -11,11 +11,16 @@
</h1>
{{ form_widget(form.submit) }}
{% if by=="console" %}
<a class="btn btn-secondary" href={{ path('app_illustration') }}>Annuler</a>
{% if by=="admin" %}
<a class="btn btn-secondary" href={{ path('app_admin_illustration',{'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>
{% elseif by=="illustration" %}
<a class="btn btn-secondary" href={{ path('app_illustration_view',{'by':"user","idcat":illustration.category.id,"id":illustration.id}) }}>Annuler</a>
{% else %}
<a class="btn btn-secondary" href={{ path('app_home') }}>Annuler</a>
<a class="btn btn-secondary" href={{ path('app_home_user',{'userpseudo':app.user.pseudo}) }}>Annuler</a>
{% endif %}
{% if mode=="update" %}

View File

@ -5,7 +5,7 @@
ILLUSTRATIONS
</h1>
<p><a class="btn btn-success" href={{ path('app_illustration_submit',{by:'console'}) }}>Ajouter</a></p>
<p><a class="btn btn-success" href={{ path('app_illustration_submit',{by:'admin',userid:-1}) }}>Ajouter</a></p>
<div class="card">
<div class="card-header">
@ -19,6 +19,7 @@ ILLUSTRATIONS
<tr>
<th width="70px" class="no-sort">Action</th>
<th width="70px" class="no-sort">Miniature</th>
<th width="70px">Utilisateurs</th>
<th width="70px">Date</th>
<th width="100px">Catégorie</th>
<th>Nom</th>
@ -28,11 +29,11 @@ ILLUSTRATIONS
{% for illustration in illustrations %}
<tr>
<td>
<a href="{{path("app_illustration_update",{id:illustration.id,by:'console'})}}"><i class="fa fa-file"></i></a>
<a href="{{path("app_illustration_update",{id:illustration.id,by:'admin'})}}"><i class="fa fa-file"></i></a>
{% if illustration.id >=0 %}
<a href="{{path("app_illustration_delete",{id:illustration.id,by:'console'})}}" 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_illustration_delete",{id:illustration.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 %}
<a style="cursor:pointer" onClick="ModalLoad('extraLargeModal','Illustration','{{ path('app_illustration_crop',{"type":"illustration","reportinput":"refresh","by":"console"}) }}?file={{illustration.illustration}}');"><i class="fa fa-arrows-alt" aria-hidden="true"></i></a>
<a style="cursor:pointer" onClick="ModalLoad('extraLargeModal','Illustration','{{ path('app_illustration_crop',{"type":"illustration","reportinput":"refresh"}) }}?file={{illustration.illustration}}');"><i class="fa fa-arrows-alt" aria-hidden="true"></i></a>
</td>
<td>
@ -56,9 +57,11 @@ ILLUSTRATIONS
{% set height=30*90/21 %}
{% endif %}
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}");">
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}?v={{ random(0, 10000) }}");">
</td>
<td>{{ illustration.category.user.username }}</td>
<td>{{ illustration.submittime|date("Y-m-d H:i") }}</td>
<td>{{ illustration.category.name }}</td>
<td>{{ illustration.name }}</td>

View File

@ -0,0 +1,67 @@
<p><a class="btn btn-success" href={{ path('app_illustration_submit',{by:by,userid:userid}) }}>Ajouter</a></p>
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="illustrations" style="width:100%; zoom:80%;">
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>
<th width="70px" class="no-sort">Miniature</th>
<th width="70px">Date</th>
<th width="100px">Catégorie</th>
<th>Nom</th>
</tr>
</thead>
<tbody>
{% for illustration in illustrations %}
<tr>
<td>
<a href="{{path("app_illustration_update",{id:illustration.id,by:by,userid:userid})}}"><i class="fa fa-file"></i></a>
{% if illustration.id >=0 %}
<a href="{{path("app_illustration_delete",{id:illustration.id,by:by,userid:userid})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
{% endif %}
<a style="cursor:pointer" onClick="ModalLoad('extraLargeModal','Illustration','{{ path('app_illustration_crop',{"type":"illustration","reportinput":"refresh"}) }}?file={{illustration.illustration}}');"><i class="fa fa-arrows-alt" aria-hidden="true"></i></a>
</td>
<td>
{% set appthumbheight=app.session.get("appthumbheight") %}
{% if illustration.category.usecategoryconfig %}
{% set appthumbwidth=illustration.category.appthumbwidth %}
{% set appthumbheight=illustration.category.appthumbheight %}
{% endif %}
{% set source="thumb_"~illustration.illustration %}
{% if appthumbheight!=0 %}
{% set source="thumbori_"~illustration.illustration %}
{% endif %}
{% if appthumbheight==0 %}
{% set height=90 %}
{% elseif appthumbheight==1 %}
{% set height=illustration.height*90/illustration.width %}
{% else %}
{% set height=30*90/21 %}
{% endif %}
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}?v={{ random(0, 10000) }}");">
</td>
<td>{{ illustration.submittime|date("Y-m-d H:i") }}</td>
<td>{{ illustration.category.name }}</td>
<td>{{ illustration.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script>
$(document).ready(function() {
$('#illustrations').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 10,
order: [[ 2, "desc" ]]
});
});
</script>

View File

@ -50,10 +50,10 @@
</style>
{% if not next is empty %}
<a id="bigleft" href="{{ path("app_illustration_view",{"idcat":next[0].category.id,"id":next[0].id})}}"><i class="fas fa-chevron-left fa-3x"></i></a>
<a id="bigleft" href="{{ path("app_illustration_view",{"by":by,"idcat":next[0].category.id,"id":next[0].id})}}"><i class="fas fa-chevron-left fa-3x"></i></a>
{% endif %}
{% if not prev is empty %}
<a id="bigright" href="{{ path("app_illustration_view",{"idcat":prev[0].category.id,"id":prev[0].id})}}"><i class="fas fa-chevron-right fa-3x"></i></a>
<a id="bigright" href="{{ path("app_illustration_view",{"by":by,"idcat":prev[0].category.id,"id":prev[0].id})}}"><i class="fas fa-chevron-right fa-3x"></i></a>
{% endif %}
@ -66,8 +66,8 @@
<a download="{{ illustration.name }}.{{ pathinfo.extension }}" href="/{{ appAlias }}/uploads/illustration/{{illustration.illustration}}"><i class="fa fa-download" aria-hidden="true"></i></a>
{% if is_granted("ROLE_ADMIN") %}
<a id="update" href="{{ path("app_illustration_update",{"id":illustration.id})}}"><i class="fa fa-file" aria-hidden="true"></i></a>
<a id="delete" href="{{ path("app_illustration_delete",{"id":illustration.id})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet entregistrement ?"><i class="fa fa-trash" aria-hidden="true"></i></a>
<a id="update" href="{{ path("app_illustration_update",{"by":"illustration","id":illustration.id})}}"><i class="fa fa-file" aria-hidden="true"></i></a>
<a id="delete" href="{{ path("app_illustration_delete",{"by":"illustration","id":illustration.id})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet entregistrement ?"><i class="fa fa-trash" aria-hidden="true"></i></a>
<a id="recadre" style="cursor:pointer" onClick="ModalLoad('extraLargeModal','Illustration','{{ path('app_illustration_crop',{"type":"illustration","reportinput":"none"}) }}?file={{illustration.illustration}}');"><i class="fa fa-arrows-alt" aria-hidden="true"></i></a>
{% endif %}