init
This commit is contained in:
91
templates/Illustration/edit.html.twig
Executable file
91
templates/Illustration/edit.html.twig
Executable file
@ -0,0 +1,91 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification ILLUSTRATION
|
||||
{% elseif mode=="submit" %}
|
||||
Création ILLUSTRATION
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
|
||||
{% if by=="console" %}
|
||||
<a class="btn btn-secondary" href={{ path('app_illustration') }}>Annuler</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href={{ path('app_home') }}>Annuler</a>
|
||||
{% endif %}
|
||||
|
||||
{% if mode=="update" %}
|
||||
<a href="{{ path('app_illustration_delete',{'id':illustration.id, 'by':by}) }}"
|
||||
class="btn btn-danger float-right"
|
||||
data-method="delete"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cet entregistrement ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.category) }}
|
||||
{{ form_row(form.description) }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil-alt fa-fw"></i> Illustration
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_widget(form.illustration) }}
|
||||
{{ form_widget(form.width) }}
|
||||
{{ form_widget(form.height) }}
|
||||
<a class="btn btn-info" style="width:100%; margin-bottom:10px" onClick="ModalLoad('extraLargeModal','Illustration','{{ path('app_illustration_upload') }}');" title='Ajouter une banière'>Télécharger une Illustration</a>
|
||||
<img id="illustration_illustration_img" src="/{{ appAlias }}/uploads/illustration/{{illustration.illustration}}" style="width:100%;margin:auto;display:block;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
$("#illustration_order").focus();
|
||||
});
|
||||
{% endblock %}
|
83
templates/Illustration/list.html.twig
Normal file
83
templates/Illustration/list.html.twig
Normal file
@ -0,0 +1,83 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">
|
||||
ILLUSTRATIONS
|
||||
</h1>
|
||||
|
||||
<p><a class="btn btn-success" href={{ path('app_illustration_submit',{by:'console'}) }}>Ajouter</a></p>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des Illustrations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="dataTable_wrapper">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
|
||||
<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:'console'})}}"><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>
|
||||
{% 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>
|
||||
</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}}");">
|
||||
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 2, "desc" ]]
|
||||
});
|
||||
});
|
||||
{% endblock %}
|
102
templates/Illustration/slide.html.twig
Executable file
102
templates/Illustration/slide.html.twig
Executable file
@ -0,0 +1,102 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block metablock %}
|
||||
<meta property="og:title" content="{{ appName }} - Slide" />
|
||||
<meta property="og:url" content="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params'))) }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
#main {
|
||||
padding: 0px;
|
||||
display:none;
|
||||
margin-bottom:200px;
|
||||
}
|
||||
|
||||
/* Image */
|
||||
#illustration_illustration_img, #kadavresky_kadavresky_img, #album_photo_img,#webzine_page_img{
|
||||
margin: 30px auto 0px auto;
|
||||
display:block;
|
||||
/*box-shadow: 0px 0px 5px 1px rgba(255, 255, 255, 0.45);*/
|
||||
}
|
||||
</style>
|
||||
|
||||
<img style="display:none;" id="illustration_illustration_img" src="/{{ appAlias }}/uploads/illustration/{{illustrations[0].illustration}}">
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
var posImg=0
|
||||
var tbimg=[]
|
||||
|
||||
function shuffle(array) {
|
||||
let currentIndex = array.length, randomIndex;
|
||||
|
||||
// While there remain elements to shuffle.
|
||||
while (currentIndex > 0) {
|
||||
|
||||
// Pick a remaining element.
|
||||
randomIndex = Math.floor(Math.random() * currentIndex);
|
||||
currentIndex--;
|
||||
|
||||
// And swap it with the current element.
|
||||
[array[currentIndex], array[randomIndex]] = [
|
||||
array[randomIndex], array[currentIndex]];
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
function resizeImage() {
|
||||
console.log("resize")
|
||||
height=$(window).height()-70;
|
||||
$("#illustration_illustration_img").css({height:height,width:'auto'});
|
||||
|
||||
width=$(window).width()-90;
|
||||
if($("#illustration_illustration_img").width()>width)
|
||||
$("#illustration_illustration_img").css({width:width,height:'auto'});
|
||||
|
||||
height=$("#illustration_illustration_img").height();
|
||||
$("#bigright").css({height:height,"line-height":height+"px"});
|
||||
$("#bigleft").css({height:height,"line-height":height+"px"});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
{% for illustration in illustrations %}
|
||||
tbimg.push("{{illustration.illustration}}");
|
||||
{% endfor %}
|
||||
|
||||
tbimg=shuffle(tbimg)
|
||||
$('body').imagesLoaded(function() {
|
||||
resizeImage();
|
||||
$("#illustration_illustration_img").fadeIn();
|
||||
});
|
||||
|
||||
var intervalId = window.setInterval(function(){
|
||||
posImg++;
|
||||
img=tbimg[posImg];
|
||||
console.log(img);
|
||||
url="/{{ appAlias }}/uploads/illustration/xxx";
|
||||
url=url.replace("xxx",img);
|
||||
|
||||
$("#illustration_illustration_img").fadeOut();
|
||||
$("#illustration_illustration_img").promise().done(function(){
|
||||
$("#illustration_illustration_img").hide();
|
||||
$("#illustration_illustration_img").attr("src",url);
|
||||
/*
|
||||
resizeImage();
|
||||
$("#illustration_illustration_img").fadeIn();
|
||||
*/
|
||||
});
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
$('#illustration_illustration_img').on("load",function() {
|
||||
resizeImage();
|
||||
$("#illustration_illustration_img").fadeIn();
|
||||
});
|
||||
|
||||
|
||||
$(window).resize(function() {
|
||||
resizeImage();
|
||||
});
|
||||
{% endblock %}
|
44
templates/Illustration/upload.html.twig
Normal file
44
templates/Illustration/upload.html.twig
Normal file
@ -0,0 +1,44 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block encorelinktags %}
|
||||
{{ encore_entry_link_tags('dropzone') }}
|
||||
{% endblock encorelinktags %}
|
||||
|
||||
{% block body %}
|
||||
<h3 class="page-header">Téléchargez votre Illustration</h3>
|
||||
<a class="btn btn-default" onClick="closeModal();">Annuler</a>
|
||||
|
||||
<form
|
||||
action="{{ oneup_uploader_endpoint('illustration') }}"
|
||||
class="dropzone"
|
||||
id="mydropzone"
|
||||
data-acceptedMimeTypes="image/*"
|
||||
data-maxFiles=1
|
||||
data-resizeWidth:2500,
|
||||
style="margin-top:10px">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block encorescripttags %}
|
||||
{{ encore_entry_script_tags('dropzone') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
function dropzoneinit( elt ) {
|
||||
}
|
||||
|
||||
function dropzonesuccess( file, response ) {
|
||||
parent.$("#illustration_illustration").val(response["file"]);
|
||||
parent.$("#illustration_width").val(response["width"]);
|
||||
parent.$("#illustration_height").val(response["height"]);
|
||||
parent.$("#illustration_name").val(response["originalname"]);
|
||||
parent.$("#illustration_illustration_img").attr("src","/{{ appAlias }}/uploads/illustration/"+response["file"]);
|
||||
}
|
||||
function dropzonequeuecomplete(file) {
|
||||
closeModal();
|
||||
}
|
||||
function closeModal() {
|
||||
window.parent.$("#extraLargeModal").modal('hide');
|
||||
}
|
||||
{% endblock %}
|
||||
|
122
templates/Illustration/view.html.twig
Executable file
122
templates/Illustration/view.html.twig
Executable file
@ -0,0 +1,122 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block metablock %}
|
||||
<meta property="og:title" content="{{ appName }} - {{ illustration.category.name }} - {{ illustration.name }}" />
|
||||
<meta property="og:description" content="le {{ illustration.submittime|date('d/m/Y H:i') }}" />
|
||||
<meta property="og:url" content="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params'))) }}" />
|
||||
<meta property="og:image" content="{{ absolute_url("/"~appAlias~"/uploads/illustration/"~illustration.illustration) }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
#main {
|
||||
padding: 0px;
|
||||
display:none;
|
||||
margin-bottom:200px;
|
||||
}
|
||||
|
||||
/* Image */
|
||||
#illustration_illustration_img, #kadavresky_kadavresky_img, #album_photo_img,#webzine_page_img{
|
||||
margin: 30px auto 0px auto;
|
||||
display:block;
|
||||
/*box-shadow: 0px 0px 5px 1px rgba(255, 255, 255, 0.45);*/
|
||||
}
|
||||
|
||||
#bigright{
|
||||
position:absolute;
|
||||
top:30px;
|
||||
right:0px;
|
||||
width:45%;
|
||||
height:100%;
|
||||
line-height:100%;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
padding:5px;
|
||||
}
|
||||
#bigleft{
|
||||
position:absolute;
|
||||
top:30px;
|
||||
left:0px;
|
||||
width:45%;
|
||||
height:100%;
|
||||
vertical-align: middle;
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
.menuview a {
|
||||
margin: 0px 5px;
|
||||
}
|
||||
|
||||
</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>
|
||||
{% 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>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<img style="display:none;" id="illustration_illustration_img" src="/{{ appAlias }}/uploads/illustration/{{illustration.illustration}}">
|
||||
|
||||
|
||||
<div class="container mb-5">
|
||||
<div class="text-center menuview" style="font-size:25px">
|
||||
<a id="up" href="{{ path("app_home")}}#illustration{{illustration.id}}"><i class="fa fa-home" aria-hidden="true"></i></a>
|
||||
<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="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 %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="text-center" style="clear:both;"><h3>{{ illustration.name }}</h3><small>le {{ illustration.submittime|date('d/m/Y H:i') }}</div>
|
||||
|
||||
<div class="illustration_description" style="clear:both;max-width: 350px;margin: auto; text-align: justify;">
|
||||
{% autoescape 'html' %}
|
||||
{{ illustration.description|raw }}
|
||||
{% endautoescape %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
function resizeImage() {
|
||||
height=$(window).height()-70;
|
||||
$("#illustration_illustration_img").css({height:height,width:'auto'});
|
||||
|
||||
width=$(window).width()-90;
|
||||
if($("#illustration_illustration_img").width()>width)
|
||||
$("#illustration_illustration_img").css({width:width,height:'auto'});
|
||||
|
||||
height=$("#illustration_illustration_img").height();
|
||||
$("#bigright").css({height:height,"line-height":height+"px"});
|
||||
$("#bigleft").css({height:height,"line-height":height+"px"});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('body').imagesLoaded(function() {
|
||||
resizeImage();
|
||||
$("#illustration_illustration_img").fadeIn();
|
||||
});
|
||||
});
|
||||
|
||||
$("body").keydown(function(e) {
|
||||
if(e.keyCode == 37) { // left
|
||||
var href = $('#bigleft').attr('href');
|
||||
if(href!=null) window.location.href = href;
|
||||
}
|
||||
else if(e.keyCode == 39) {
|
||||
var href = $('#bigright').attr('href');
|
||||
if(href!=null) window.location.href = href;
|
||||
}
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
resizeImage();
|
||||
});
|
||||
{% endblock %}
|
Reference in New Issue
Block a user