This commit is contained in:
2024-10-31 11:48:30 +01:00
parent 86c4296061
commit ad60b9372c
16 changed files with 323 additions and 129 deletions

View File

@ -20,10 +20,16 @@
{{ form_widget(form.submit) }}
{% if by=="console" %}
<a class="btn btn-secondary" href={{ path('app_webzine') }}>Annuler</a>
{% if by=="admin" %}
<a class="btn btn-secondary" href={{ path('app_admin_webzine',{'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_webzine_view',{'by':"user","idcat":webzine.id,"id":webzine.webzinepages[0].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" %}
@ -63,6 +69,7 @@
</div>
<div class="card-body">
{{ form_row(form.user) }}
{{ form_row(form.name) }}
{{ form_row(form.set) }}
{{ form_row(form.order) }}

View File

@ -5,7 +5,7 @@
WEBZINES
</h1>
<p><a class="btn btn-success" href={{ path('app_webzine_submit',{by:'console'}) }}>Ajouter</a></p>
<p><a class="btn btn-success" href={{ path('app_webzine_submit',{by:"admin",userid:-1}) }}>Ajouter</a></p>
<div class="card">
<div class="card-header">
@ -19,6 +19,7 @@ WEBZINES
<tr>
<th width="70px" class="no-sort">Action</th>
<th width="70px" class="no-sort">Miniature</th>
<th width="100px">Utilisateur</th>
<th width="100px">Serie</th>
<th>Nom</th>
</tr>
@ -27,9 +28,9 @@ WEBZINES
{% for webzine in webzines %}
<tr>
<td>
<a href="{{path("app_webzine_update",{id:webzine.id,by:'console'})}}"><i class="fa fa-file"></i></a>
<a href="{{path("app_webzine_update",{id:webzine.id,by:'admin'})}}"><i class="fa fa-file"></i></a>
{% if webzine.id >=0 %}
<a href="{{path("app_webzine_delete",{id:webzine.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_webzine_delete",{id:webzine.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>
@ -41,6 +42,7 @@ WEBZINES
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/{{source}}");">
{% endif %}
</td>
<td>{{ webzine.user.username }}</td>
<td>{{ webzine.set }} #{{ webzine.order| format_number({min_integer_digit:'2'})}}</td>
<td>{{ webzine.name }}</td>
</tr>

View File

@ -0,0 +1,51 @@
<p><a class="btn btn-success" href={{ path('app_webzine_submit',{by:by,userid:userid}) }}>Ajouter</a></p>
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="webzines" style="width:100%">
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>
<th width="70px" class="no-sort">Miniature</th>
<th width="100px">Serie</th>
<th>Nom</th>
</tr>
</thead>
<tbody>
{% for webzine in webzines %}
<tr>
<td>
<a href="{{path("app_webzine_update",{id:webzine.id,by:by})}}"><i class="fa fa-file"></i></a>
{% if webzine.id >=0 %}
<a href="{{path("app_webzine_delete",{id:webzine.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>
{% if not webzine.webzinepages is empty %}
{% set source="thumbori_"~webzine.webzinepages[0].illustration %}
{% set height=30*90/21 %}
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/{{source}}");">
{% endif %}
</td>
<td>{{ webzine.set }} #{{ webzine.order| format_number({min_integer_digit:'2'})}}</td>
<td>{{ webzine.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script>
$(document).ready(function() {
$('#webzines').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 10,
order: [[ 2, "desc" ]]
});
});
</script>

View File

@ -49,10 +49,10 @@
</style>
{% if not prev is empty %}
<a id="bigleft" href="{{ path("app_webzine_view",{"idcat":prev[0].webzine.id,"id":prev[0].id})}}"><i class="fas fa-chevron-left fa-3x"></i></a>
<a id="bigleft" href="{{ path("app_webzine_view",{"by":by,"idcat":prev[0].webzine.id,"id":prev[0].id})}}"><i class="fas fa-chevron-left fa-3x"></i></a>
{% endif %}
{% if not next is empty %}
<a id="bigright" href="{{ path("app_webzine_view",{"idcat":next[0].webzine.id,"id":next[0].id})}}"><i class="fas fa-chevron-right fa-3x"></i></a>
<a id="bigright" href="{{ path("app_webzine_view",{"by":by,"idcat":next[0].webzine.id,"id":next[0].id})}}"><i class="fas fa-chevron-right fa-3x"></i></a>
{% endif %}
<img style="display:none;" id="webzine_webzine_img" src="/{{ appAlias }}/uploads/webzine/{{page.illustration}}">
@ -60,12 +60,17 @@
<div class="container mb-5">
<div class="text-center menuview" style="font-size:25px">
<a id="up" href="{{ path("app_home")}}#webzine{{webzine.id}}"><i class="fa fa-home" aria-hidden="true"></i></a>
{% if by=="home" %}
<a id="up" href="{{ path("app_home")}}#webzine{{webzine.id}}"><i class="fa fa-home" aria-hidden="true"></i></a>
{% else %}
<a id="up" href="{{ path("app_home_user",{userpseudo:webzine.user.slug})}}#webzine{{webzine.id}}"><i class="fa fa-home" aria-hidden="true"></i></a>
{% endif %}
<a download="{{ webzine.name }}-{{page.order}}.{{ pathinfo.extension }}" href="/{{ appAlias }}/uploads/webzine/{{page.illustration}}"><i class="fa fa-download" aria-hidden="true"></i></a>
{% if is_granted("ROLE_ADMIN") %}
<a id="update" href="{{ path("app_webzine_update",{"id":webzine.id})}}"><i class="fa fa-file" aria-hidden="true"></i></a>
<a id="delete" href="{{ path("app_webzine_delete",{"id":webzine.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>
{% if is_granted("ROLE_ADMIN") or (is_granted("ROLE_USER") and webzine.user.id==app.user.id) %}
<a id="update" href="{{ path("app_webzine_update",{"by":"illustration","id":webzine.id})}}"><i class="fa fa-file" aria-hidden="true"></i></a>
<a id="delete" href="{{ path("app_webzine_delete",{"by":"illustration","id":webzine.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>
{% endif %}
</div>
@ -76,7 +81,7 @@
{% for page in webzine.webzinepages %}
{% set height=30*90/21 %}
<a href="{{ path("app_webzine_view",{"idcat":webzine.id,"id":page.id}) }}">
<a href="{{ path("app_webzine_view",{"by":by,"idcat":webzine.id,"id":page.id}) }}">
<div style="display: inline-block; width:90px; height:{{height}}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/thumbori_{{page.illustration}}"></div>
</a>
{% endfor %}
@ -86,7 +91,7 @@
<h3 class="mt-3">Dans la même série</h3>
{% for set in sets %}
{% if not set.webzinepages is empty %}
<a href="{{ path("app_webzine_view",{"idcat":set.id,"id":set.webzinepages[0].id}) }}">
<a href="{{ path("app_webzine_view",{"by":by,"idcat":set.id,"id":set.webzinepages[0].id}) }}">
<div style="display: inline-block; width:90px; height:{{height}}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/thumbori_{{set.webzinepages[0].illustration}}"></div>
</a>
{% endif %}