ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
This commit is contained in:
50
templates/File/folder.html.twig
Normal file
50
templates/File/folder.html.twig
Normal file
@ -0,0 +1,50 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
body { height:auto;}
|
||||
#page { padding: 0px !important;}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<p>
|
||||
{{ form_widget(form.submit) }} <a class="btn btn-secondary" onClick="closeModal();">Annuler</a>
|
||||
</p>
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{{ form_row(form.folder) }}
|
||||
{{ form_end(form) }}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
function closeModal() {
|
||||
window.parent.$("#mymodalfull").modal('hide');
|
||||
}
|
||||
|
||||
|
||||
$('document').ready(function(){
|
||||
$("#form_folder").focus();
|
||||
{% if toclose %}
|
||||
href=parent.location.href;
|
||||
parent.location.href=href;
|
||||
{% endif %}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
346
templates/File/list.html.twig
Normal file
346
templates/File/list.html.twig
Normal file
@ -0,0 +1,346 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
body { height:auto;}
|
||||
#page { padding: 0px !important;}
|
||||
.btn-group>.btn, .btn-group>.btn:active{
|
||||
background-color: var(--colorbgbodydark);
|
||||
border: var(--colorbgbodydark);
|
||||
}
|
||||
.btn-group>.btn:active{
|
||||
background-color: var(--colorbgbodydark-darker);
|
||||
border: var(--colorbgbodydark);
|
||||
}
|
||||
.item-small .item-subtitle, .item-list .item-subtitle {
|
||||
display:block;
|
||||
}
|
||||
.item-small .item-subtitle {
|
||||
font-size:9px;
|
||||
}
|
||||
.item-small img {
|
||||
width:60px;
|
||||
|
||||
}
|
||||
.item-list {
|
||||
zoom:80%;
|
||||
}
|
||||
.item-list img {
|
||||
width:40px;
|
||||
|
||||
}
|
||||
.breadcrumb {
|
||||
padding: 5px 10px;
|
||||
margin: 5px 0px 5px 0px;
|
||||
list-style: none;
|
||||
border-radius: 4px;
|
||||
background-color: var(--colorbgbodydark);
|
||||
display: inline-flex;
|
||||
|
||||
}
|
||||
.breadcrumb a {
|
||||
color: var(--colorftbodydark);
|
||||
}
|
||||
.item-action .btn-modal {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
|
||||
<div id="explorer">
|
||||
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
|
||||
{% if canadd and not fgtrash %}
|
||||
<div class="btn-group me-1" role="group" aria-label="First group">
|
||||
<button type="button" class="btn btn-modal btn-primary"data-modalid="mymodalfull" data-modaltitle="Téléchargez vos Fichiers" data-modalurl="{{ path('app_'~access~'_file_upload',{'category': category, 'id': id,'type':'file','usage':usage,'folder':folder}) }}" title="Ajouter des fichiers">
|
||||
<i class="fa fa-upload"></i>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-modal btn-primary"data-modalid="mymodalfull" data-modaltitle="Création Répertoire" data-modalurl="{{ path('app_'~access~'_file_folder',{'category': category, 'id': id,'usage':usage,'folder':folder}) }}" title="Ajouter un Répertoire">
|
||||
<i class="fa fa-folder-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="btn-group me-1" role="group" aria-label="Second group">
|
||||
{% if view=="small" %}
|
||||
{%set action="list" %}
|
||||
{% else %}
|
||||
{%set action="small" %}
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'type':'file','usage':usage,'folder':folder, 'view':action }) }}" type="button" class="btn btn-primary">
|
||||
|
||||
{% if view=="small" %}
|
||||
<i class="fas fa-list"></i>
|
||||
{% else %}
|
||||
<i class="fas fa-th"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
{% set active="" %}
|
||||
{% if sort=="name" %}
|
||||
{% set active="active" %}
|
||||
{%endif%}
|
||||
|
||||
{% if order=="SORT_ASC" %}
|
||||
{%set action="SORT_DESC" %}
|
||||
{% else %}
|
||||
{%set action="SORT_ASC" %}
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'type':'file','usage':usage,'folder':folder, 'sort': 'name', 'order':action }) }}" type="button" class="btn btn-primary {{active}}">
|
||||
|
||||
{% if order=="SORT_ASC" %}
|
||||
<i class="fas fa-long-arrow-alt-down"></i> Nom
|
||||
{% else %}
|
||||
<i class="fas fa-long-arrow-alt-up"></i> Nom
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
|
||||
{% set active="" %}
|
||||
{% if sort=="date" %}
|
||||
{% set active="active" %}
|
||||
{%endif%}
|
||||
|
||||
{% if order=="SORT_ASC" %}
|
||||
{%set action="SORT_DESC" %}
|
||||
{% else %}
|
||||
{%set action="SORT_ASC" %}
|
||||
{% endif %}
|
||||
<a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'usage':usage,'folder':folder, 'sort': 'date', 'order':action }) }}" type="button" class="btn btn-primary {{active}}">
|
||||
{% if order=="SORT_ASC" %}
|
||||
<i class="fas fa-long-arrow-alt-down"></i> Date
|
||||
{% else %}
|
||||
<i class="fas fa-long-arrow-alt-up"></i> Date
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if canadd %}
|
||||
<div class="btn-group" role="group" aria-label="Third group">
|
||||
{% if fgtrash %}
|
||||
<a href="{{ path('app_'~access~'_file_purgetrash',{'category': category, 'id': id ,'usage':usage}) }}" type="button" class="btn btn-primary" data-method="delete" data-confirm="Souhaitez-vous purger votre poubelle ? Cette action sera irrévocable.">Purger la poubelle</a>
|
||||
{% else %}
|
||||
<a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'usage':usage,'folder':'file/'~category~'/'~id~'/.trash/' }) }}" type="button" class="btn btn-primary"><i class="fas fa-trash"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
{% for parent in parents %}
|
||||
<li class="breadcrumb-item folder" data-src="{{parent.folder}}"><a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'usage':usage,'folder': parent.folder }) }}">{{ parent.basename}}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="items-list">
|
||||
{% for dir in folders %}
|
||||
<div class="item item-{{view}} folder" data-src="{{dir.Prefix}}" style="background-color: var(--colorbgbodydark);">
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
<a class="item-link" href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'usage':usage,'folder':dir.Prefix }) }}">
|
||||
<img height="35" src="{{ dir.thumb }}">
|
||||
|
||||
<div class="item-title">
|
||||
<h3>{{ dir.basename }}</h3>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="item-action">
|
||||
{% if canadd %}
|
||||
{% if fgtrash %}
|
||||
<a style="display:none" onClick="restaureFile('{{dir.Prefix|e('js')|raw }}')">
|
||||
<i class="fa fa-undo" title="Restaurer le fichier"></i>
|
||||
</a>
|
||||
|
||||
<a style="display:none" onClick="delFile('{{dir.Prefix|e('js')|raw }}')">
|
||||
<i class="fa fa-trash" title="Supprimer le dossier"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a style="display:none" class="btn-modal" title="Modifier" data-modalid="mymodalfull" data-modaltitle="Modification" data-modalurl="{{ path('app_'~access~'_file_rename',{'category': category, 'id': id,'usage':usage,'file':dir.Prefix}) }}">
|
||||
<i class="fas fa-file"></i>
|
||||
</a>
|
||||
<a style="display:none" onClick="trashFile('{{dir.Prefix|e('js')|raw}}')">
|
||||
<i class="fas fa-trash" title="Supprimer le dossier"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% for file in files %}
|
||||
<div class="item item-{{view}} file" style="background-color: var(--colorbgbodydark);" data-src="{{file.Key}}">
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
<a class="item-link" href="{{ path('app_'~access~'_file_show',{'category': category, 'id': id,'file':file.Key }) }}" target="_blank">
|
||||
<img height="35" src="{{ file.thumb }}">
|
||||
|
||||
<div class="item-title">
|
||||
<h3>{{ file.basename }}</h3>
|
||||
<div class="item-subtitle">le {{ file.LastModified|date("d/m/Y H:i")}}</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="item-action">
|
||||
{% if canadd %}
|
||||
{% if fgtrash %}
|
||||
<a style="display:none" onClick="restaureFile('{{file.Key|e('js')|raw }}')">
|
||||
<i class="fa fa-undo" title="Restaurer le fichier"></i>
|
||||
</a>
|
||||
|
||||
<a style="display:none" onClick="delFile('{{file.Key|e('js')|raw }}')">
|
||||
<i class="fa fa-trash" title="Supprimer le dossier"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a style="display:none" class="btn-modal" title="Modifier" data-modalid="mymodalfull" data-modaltitle="Modification" data-modalurl="{{ path('app_'~access~'_file_rename',{'category': category, 'id': id,'usage':usage,'file':file.Key}) }}">
|
||||
<i class="fas fa-file"></i>
|
||||
</a>
|
||||
<a style="display:none" onClick="trashFile('{{file.Key|e('js')|raw}}')">
|
||||
<i class="fas fa-trash" title="Supprimer le dossier"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mymodalfull" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog modal-fullscreen">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"></h4>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe frameborder=0 width="100%" style="min-height:300px;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$('#mymodalfull').on('shown.bs.modal', function() {
|
||||
$("#framefile-{{id}}",window.parent.document).css("min-height",$("#mymodalfull").find("iframe").height()+130);
|
||||
$("#framefile-{{id}}",window.parent.document).parent().css("min-height",$("#mymodalfull").find("iframe").height()+130);
|
||||
});
|
||||
|
||||
$('#mymodalfull').on('hide.bs.modal', function() {
|
||||
$("#framefile-{{id}}",window.parent.document).css("min-height","unset");
|
||||
$("#framefile-{{id}}",window.parent.document).parent().css("min-height","unset");
|
||||
});
|
||||
|
||||
$(window).on('load', function(){
|
||||
$("#framefile-{{id}}",window.parent.document).css("min-height","unset");
|
||||
$("#framefile-{{id}}",window.parent.document).parent().css("min-height","unset");
|
||||
});
|
||||
|
||||
{% if canadd %}
|
||||
// Trasher un fichier
|
||||
function trashFile(file) {
|
||||
var r = confirm("Confirmez-vous la mise à la poubelle de ce fichier ? Vous pourrez le récupèrer si besoin.");
|
||||
if (r == true) {
|
||||
url="{{ path('app_'~access~'_file_trash',{'category': category, 'id': id,'file':'xxx' }) }}";
|
||||
url=url.replace("xxx",file);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
success: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Supprimer un fichier
|
||||
function delFile(file) {
|
||||
var r = confirm("Confirmez-vous la suppression définitive de ce fichier ?");
|
||||
if (r == true) {
|
||||
url="{{ path('app_'~access~'_file_delete',{'category': category, 'id': id,'file':'xxx' }) }}";
|
||||
url=url.replace("xxx",file);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
success: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Restaurer un fichier
|
||||
function restaureFile(file) {
|
||||
url="{{ path('app_'~access~'_file_restaure',{'category': category, 'id': id,'file':'xxx' }) }}";
|
||||
url=url.replace("xxx",file);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
success: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Déplacement
|
||||
{% if not fgtrash %}
|
||||
$('.file').on('dragstart', function (s) {
|
||||
filesource=$(this).data("src");
|
||||
});
|
||||
|
||||
$('.folder').on('dragstart', function (s) {
|
||||
filesource=$(this).data("src");
|
||||
});
|
||||
|
||||
$('.folder')
|
||||
// crucial for the 'drop' event to fire
|
||||
.on('dragover', false)
|
||||
|
||||
.on('drop', function (e) {
|
||||
// Récupérer la destination
|
||||
filedestination=$(this).data("src");
|
||||
|
||||
// Si la source est la meme que la destination on ne fait rien
|
||||
if(filesource==filedestination) return false;
|
||||
|
||||
url="{{ path('app_'~access~'_file_move',{'category': category, 'id': id,'source':'xxx', 'destination':'zzz' }) }}";
|
||||
url=url.replace("xxx",filesource);
|
||||
url=url.replace("zzz",filedestination);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
// On déplace l'element
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
success: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
22
templates/File/redirect.html.twig
Normal file
22
templates/File/redirect.html.twig
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
body {
|
||||
background-color: var(--colorbgbodydark);
|
||||
}
|
||||
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
|
||||
<script>
|
||||
parent.location.reload();
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
74
templates/File/upload.html.twig
Normal file
74
templates/File/upload.html.twig
Normal file
@ -0,0 +1,74 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block encoretags %}
|
||||
{{ encore_entry_link_tags('dropzone') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
body { height:auto;}
|
||||
#page { padding: 0px !important;}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<a class="btn btn-secondary" onClick="closeModal();">Annuler</a>
|
||||
|
||||
<form
|
||||
action="{{ oneup_uploader_endpoint('file') }}"
|
||||
class="dropzone"
|
||||
id="mydropzone"
|
||||
{% if type=="image" %}data-acceptedMimeTypes="image/*"{% endif %}
|
||||
data-maxFiles="0"
|
||||
|
||||
style="margin-top:10px">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block localscript %}
|
||||
{{ encore_entry_script_tags('dropzone') }}
|
||||
|
||||
<script>
|
||||
function dropzoneinit( elmt ) {
|
||||
var totalFiles = 0;
|
||||
var completeFiles = 0;
|
||||
|
||||
elmt.on("sending", function(file, xhr, formData) {
|
||||
formData.append("folder", "{{ folder }}");
|
||||
});
|
||||
|
||||
elmt.on("addedfile", function (file) {
|
||||
totalFiles += 1;
|
||||
});
|
||||
|
||||
elmt.on("removed file", function (file) {
|
||||
totalFiles -= 1;
|
||||
});
|
||||
|
||||
elmt.on("complete", function (file) {
|
||||
completeFiles += 1;
|
||||
if (completeFiles === totalFiles) {
|
||||
{% if forcereload %}
|
||||
parent.location.reload();
|
||||
{% else %}
|
||||
parent.refreshPJ();
|
||||
closeModal();
|
||||
{% endif %}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dropzonesuccess( file, response ) {
|
||||
//closeModal();
|
||||
}
|
||||
|
||||
|
||||
function closeModal() {
|
||||
window.parent.$("#mymodallarge").modal('hide');
|
||||
window.parent.$("#mymodalfull").modal('hide');
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
126
templates/File/view.html.twig
Normal file
126
templates/File/view.html.twig
Normal file
@ -0,0 +1,126 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
body {
|
||||
background-color: var(--colorbgbodydark);
|
||||
}
|
||||
img {
|
||||
margin:auto;
|
||||
display: block;
|
||||
}
|
||||
#page {
|
||||
padding: 0px !important;
|
||||
|
||||
}
|
||||
h3, #filetitle {
|
||||
margin:0px;
|
||||
text-align:center;
|
||||
}
|
||||
h3, a, a:hover {
|
||||
color: var(--colorfttitledark);
|
||||
}
|
||||
#fileaction {
|
||||
margin-top: -10px;
|
||||
}
|
||||
#bigright{
|
||||
position:absolute;
|
||||
top:0px;
|
||||
right:0px;
|
||||
width:45%;
|
||||
height:100%;
|
||||
line-height:100%;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
padding:5px;
|
||||
}
|
||||
#bigleft{
|
||||
position:absolute;
|
||||
top:0px;
|
||||
left:0px;
|
||||
width:45%;
|
||||
height:100%;
|
||||
vertical-align: middle;
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div id="filetitle">
|
||||
<h3>{{basename}}</h3>
|
||||
<div id="fileaction">
|
||||
<a href="{{ path("app_"~access~"_file_download",{category:category, id:id, file:file, usage:usage})}}"><i class="fa-solid fa-download"></i></a>
|
||||
{%if canadd %}
|
||||
<a href="{{ path("app_"~access~"_file_delete",{category:category, id:id, file:file, usage:usage, navigation: navigation})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa-solid fa-trash"></i></a>
|
||||
{%endif%}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if navigation %}
|
||||
{% if not next is empty %}
|
||||
<a id="bigleft" href="{{ path("app_"~access~"_file_view",{category:category, id:id, file:next.Key, usage:usage, navigation: navigation})}}"><i class="fas fa-chevron-left fa-3x"></i></a>
|
||||
{% endif %}
|
||||
{% if not prev is empty %}
|
||||
<a id="bigright" href="{{ path("app_"~access~"_file_view",{category:category, id:id, file:prev.Key, usage:usage, navigation: navigation})}}"><i class="fas fa-chevron-right fa-3x"></i></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if isimage %}
|
||||
<img id="fileimage" style="display:none" src="{{path("app_"~access~"_file_show",{category:category, id:id, file:file, usage:usage})}}">
|
||||
{%else%}
|
||||
<iframe src="{{path("app_"~access~"_file_show",{category:category, id:id, file:file, usage:usage})}}" style="width:100%;height:600px"></iframe>
|
||||
{%endif%}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block localscript %}
|
||||
|
||||
<script>
|
||||
|
||||
function resize() {
|
||||
height=$(window).height()-($("#filetitle").height() * 2);
|
||||
|
||||
$("#fileimage").css({height:height,width:'auto'});
|
||||
width=$(window).width()-90;
|
||||
console.log(width);
|
||||
if($("#fileimage").width()>width) {
|
||||
$("#fileimage").css({width:width,height:'auto'});
|
||||
$("#fileimage").css("margin-top",(height/2)-($("#fileimage").height()/2)+"px");
|
||||
height=$(window).height();
|
||||
}
|
||||
|
||||
height=$(window).height()-($("#filetitle").height() * 2);
|
||||
$("#bigright").css({height:height,"line-height":height+"px",top:$("#filetitle").height()})
|
||||
$("#bigleft").css({height:height,"line-height":height+"px",top:$("#filetitle").height()})
|
||||
|
||||
$("#fileimage").show();
|
||||
}
|
||||
|
||||
$('#fileimage').imagesLoaded(function() {
|
||||
resize();
|
||||
});
|
||||
|
||||
$("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() {
|
||||
resize();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
@ -99,7 +99,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block menuuser %}
|
||||
{% if canadd %}
|
||||
{% if canadd and app.user %}
|
||||
<a id="menusubmit" style="cursor:pointer" onclick="submitPage()" title='Ajouter une page'><i class='fa fa-plus fa-fw'></i></a>
|
||||
{% endif %}
|
||||
<a id="menuupdate" style="cursor:pointer;display:none" onclick="updatePage()" title='Modifier une page'><i class='fa fa-file fa-fw'></i></a>
|
||||
|
@ -68,7 +68,12 @@
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
var optiongrid={columnWidth: '.grid-sizer',itemSelector: '.grid-item', gutter: '.grid-gutter-sizer'};
|
||||
// Ajustement des frames
|
||||
$(window).resize(function() {
|
||||
AjustFrame();
|
||||
Masonry();
|
||||
});
|
||||
|
||||
|
||||
$('document').ready(function(){
|
||||
|
||||
@ -81,10 +86,6 @@
|
||||
scrollX: false,
|
||||
});
|
||||
|
||||
// Ajustement des frames
|
||||
$(window).resize(function() {
|
||||
AjustFrame();
|
||||
});
|
||||
|
||||
|
||||
// Création de la grille des widgets
|
||||
@ -162,14 +163,11 @@
|
||||
// Mettre une taille mini de colonne sinon on ne pourra pas déplacer le widget dans la colonne
|
||||
$(".colcontainer .col").css("min-height","80px");
|
||||
|
||||
// Cursor move sur les widgets header
|
||||
//$(".widgetheader").css("cursor","move");
|
||||
|
||||
// Rendre les widgets déplacable
|
||||
$("#widget-container .mycol").sortable({
|
||||
connectWith: "#widget-container .mycol",
|
||||
handle: '.widget-sortable',
|
||||
placeholder: "widget widgetplacehorder",
|
||||
placeholder: "widgetplaceholder",
|
||||
tolerance: "pointer",
|
||||
cursor: "move",
|
||||
opacity: 0.6,
|
||||
@ -177,21 +175,23 @@
|
||||
ui.placeholder.css("height",ui.item.height());
|
||||
$(".widgetbody").hide();
|
||||
$(".colcontainer .mycol").css("border","1px solid #cdcdcd");
|
||||
$(".colcontainer .mycol").css("padding-bottom","15px");
|
||||
//$(".colcontainer .mycol").css("padding","15px");
|
||||
$(".colcontainer .mycol").css("min-height","200px");
|
||||
ui.placeholder.css("margin-right","-15px");
|
||||
ui.placeholder.css("margin-left","-15px");
|
||||
ui.placeholder.css("margin-bottom","30px");
|
||||
},
|
||||
stop: function( event, ui ) {
|
||||
$(".widgetbody").show();
|
||||
$(".colcontainer .mycol").css("border","none");
|
||||
$(".colcontainer .mycol").css("padding-bottom","");
|
||||
$(".colcontainer .mycol").css("padding-bottom","");
|
||||
$(".colcontainer .mycol").css("min-height","");
|
||||
},
|
||||
update: updateLocalisation
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
|
||||
// Création des slick
|
||||
//slick();
|
||||
|
||||
// Sur le click des titres de widgets ouvrir / fermer le widget
|
||||
$( ".widget-header .widget-title" ).click(function() {
|
||||
showhideWidget(this);
|
||||
@ -202,25 +202,70 @@
|
||||
|
||||
// balise h des widget editor
|
||||
$(".widget-editor .widgetbody :header").css("color",$(".widgetbody").css("color"));
|
||||
|
||||
// Création des slick
|
||||
Slick();
|
||||
|
||||
// Masonry
|
||||
Masonry();
|
||||
});
|
||||
|
||||
// function slick
|
||||
function slick() {
|
||||
$('.slick').slick({
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
autoplay: true,
|
||||
//autoplaySpeed: ($(this).data("interval")*1000),
|
||||
dots: false,
|
||||
touchMove: false,
|
||||
pauseOnHover: false,
|
||||
fade: true,
|
||||
cssEase: 'linear',
|
||||
prevArrow: '<button type="button" class="slick-prev"></button>',
|
||||
nextArrow: '<button type="button" class="slick-next"></button>',
|
||||
function Slick() {
|
||||
$('.widget-body .slick').each(function() {
|
||||
if(!$(this).parent().hasClass("widget-adjust"))
|
||||
$(this).height($(this).parent().height());
|
||||
height=$(this).height();
|
||||
|
||||
$(this).slick({
|
||||
dots: true,
|
||||
infinite: true,
|
||||
fade: true,
|
||||
cssEase: 'linear',
|
||||
autoplay: true,
|
||||
autoplaySpeed: $(this).data("slicktime"),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.widget-body .slick-slide ').each(function() {
|
||||
if(!$(this).parent().parent().parent().hasClass("widget-adjust"))
|
||||
$(this).height($(this).parent().parent().parent().height());
|
||||
});
|
||||
}
|
||||
|
||||
function Masonry() {
|
||||
$('.masonry').imagesLoaded(function() {
|
||||
$('.widget-body .masonry').each(function() {
|
||||
$(this).show();
|
||||
|
||||
var perc;
|
||||
if($(this).width() >= 1500) perc="14,285714286%";
|
||||
else if($(this).width() >= 1200) perc="16,666666667%";
|
||||
else if($(this).width() >= 1000) perc="20%";
|
||||
else if($(this).width() >= 800) perc="25%";
|
||||
else if($(this).width() >= 500) perc="33.333333333%";
|
||||
else if($(this).width() >= 350) perc="50%";
|
||||
else perc="100%";
|
||||
|
||||
$(".masonry-item",$(this)).each(function() {
|
||||
$(this).css("width",perc.toString().replace(",","."));
|
||||
});
|
||||
|
||||
$(".masonry-sizer",$(this)).each(function() {
|
||||
$(this).css("width",perc.toString().replace(",","."));
|
||||
});
|
||||
|
||||
$(this).masonry({
|
||||
itemSelector: '.masonry-item',
|
||||
columnWidth: '.masonry-sizer',
|
||||
percentPosition: true,
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Cacher afficher le menu des widgets
|
||||
$(".widget").hover(function() {
|
||||
@ -264,10 +309,8 @@
|
||||
function updateLocalisation() {
|
||||
$('.colcontainer .mycol').each(function(index) {
|
||||
var idloc=$(this).attr('id');
|
||||
console.log(idloc);
|
||||
$(this).children(".widget").each(function(order){
|
||||
var idwidget=$(this).data('id');
|
||||
console.log(idwidget);
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_'~access~'_pagewidget_order') }}",
|
||||
@ -279,6 +322,9 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// On remasone
|
||||
Masonry();
|
||||
}
|
||||
|
||||
// Création d'un widget selectionné
|
||||
@ -396,13 +442,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Ajouter image
|
||||
function addImage(idwidget) {
|
||||
var url="{{ path('app_'~access~'_file_upload',{category:'pagewidget', id:'yy', type:'image', usage:usage})}}";
|
||||
url=url.replace('yy',idwidget);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$("#mymodallarge .modal-title").text("Téléchargement");
|
||||
$("#mymodallarge iframe").attr("src",url);
|
||||
$("#mymodallarge").modal("show");
|
||||
}
|
||||
|
||||
// Supprimer un fichier
|
||||
function delFile(directory,filename) {
|
||||
function delFile(idwidget,file,navigation=false) {
|
||||
var url="{{ path('app_'~access~'_file_delete',{category:'pagewidget', id:'yy', file:'zz', navigation: 'xx', usage:usage})}}";
|
||||
url=url.replace('yy',idwidget);
|
||||
url=url.replace('zz',file);
|
||||
url=url.replace('xx',navigation);
|
||||
|
||||
var r = confirm("Confirmez-vous la suppression de ce fichier ?");
|
||||
if (r == true) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_'~access~'_file_delete') }}",
|
||||
url:url,
|
||||
data: {
|
||||
directory:directory,
|
||||
filename:filename
|
||||
@ -414,9 +476,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
function viewFile(idwidget,file,navigation=false) {
|
||||
file=file.replace(".thumb/","");
|
||||
|
||||
var url="{{ path('app_'~access~'_file_view',{category:'pagewidget', id:'yy', file:'zz', navigation: 'xx', usage:usage})}}";
|
||||
url=url.replace('yy',idwidget);
|
||||
url=url.replace('zz',file);
|
||||
url=url.replace('xx',navigation);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$(location).attr('href', url);
|
||||
}
|
||||
|
||||
// Liste des slides
|
||||
function listSlide(idwidget) {
|
||||
var url="{{ path('app_'~access~'_slide_list',{idpage:page.id,idwidget:'xx',usage:usage})}}";
|
||||
var url="{{ path('app_'~access~'_pagewidgetslide_list',{idwidget:'xx',usage:usage})}}";
|
||||
|
||||
url=url.replace('xx',idwidget);
|
||||
url=url.replace(/&/g,"&");
|
||||
@ -424,6 +498,16 @@
|
||||
$(location).attr('href', url);
|
||||
}
|
||||
|
||||
// Forum ckeditor
|
||||
function ckeditor(idwidget) {
|
||||
var url="{{ path('app_'~access~'_pagewidget_ckeditor',{idwidget:'xx',usage:usage})}}";
|
||||
|
||||
url=url.replace('xx',idwidget);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$(location).attr('href', url);
|
||||
}
|
||||
|
||||
// Ajustement des frames
|
||||
function AjustFrame() {
|
||||
if($(".itemframe").length>0) {
|
||||
@ -497,25 +581,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Place un message en lu
|
||||
function hideMessage(id) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_all_message_see') }}",
|
||||
data: {
|
||||
id:id
|
||||
},
|
||||
success: function() {
|
||||
$(".msg-"+id).remove();
|
||||
var ele = $(".msg-hidden").first();
|
||||
ele.show();
|
||||
ele.removeClass("msg-hidden");
|
||||
|
||||
var grid = $('.grid').masonry(optiongrid);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Place un message en lu
|
||||
function hideAlert(id) {
|
||||
$.ajax({
|
||||
|
115
templates/Pagewidget/ckeditor.html.twig
Normal file
115
templates/Pagewidget/ckeditor.html.twig
Normal file
@ -0,0 +1,115 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
Modification Widget
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href="{{ path('app_'~access~'_page_'~usage~'_view',{id:idpage}) }}">Annuler</a>
|
||||
</p>
|
||||
|
||||
{% 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="card">
|
||||
<div class="card-header"><i class="fas fa-pencil-alt fa-fw"></i> Informations</div>
|
||||
<div id="col1" class="card-body">
|
||||
{{ form_row(form.ckeditor) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".control-label").each(function( element ) {
|
||||
var loc = $(this).attr('loc');
|
||||
if (typeof loc !== typeof undefined && loc !== false) {
|
||||
$(this).parent().appendTo("#"+loc);
|
||||
}
|
||||
});
|
||||
|
||||
$("#col2").children(".form-group").each(function( element ) {
|
||||
$(this).css("zoom","80%");
|
||||
});
|
||||
|
||||
$("#col3").children(".form-group").each(function( element ) {
|
||||
$(this).css("zoom","80%");
|
||||
});
|
||||
|
||||
$("#col4").children(".form-group").each(function( element ) {
|
||||
$(this).css("zoom","80%");
|
||||
});
|
||||
|
||||
showhide();
|
||||
});
|
||||
|
||||
$("#pagewidget_colorheaderback").bind("change paste keyup", function() {
|
||||
$("#diviconsel").css("background-color",$(this).val());
|
||||
});
|
||||
$("#pagewidget_autoajust").change(function() {
|
||||
showhide();
|
||||
});
|
||||
$("#pagewidget_viewheader").change(function() {
|
||||
showhide();
|
||||
});
|
||||
|
||||
function selIcon(idicon,url) {
|
||||
$("#pagewidget_idicon").val(idicon);
|
||||
$("#diviconsel img").remove();
|
||||
|
||||
$("#diviconsel").append("<img src='"+url+"'>");
|
||||
$("#diviconsel img").attr("height","100px");
|
||||
$("#mymodallarge").modal("hide");
|
||||
}
|
||||
|
||||
function delIcon() {
|
||||
$("#diviconsel img").remove();
|
||||
$("#diviconsel").append("<img src='{{ path("app_minio_image",{file:entity.widget.icon.label}) }}'>");
|
||||
$("#diviconsel img").attr("height","100px");
|
||||
$("#pagewidget_idicon").val(null);
|
||||
}
|
||||
|
||||
function showhide() {
|
||||
if($("#pagewidget_autoajust").val()==1) {
|
||||
$("#groupfield_pagewidget_height").hide();
|
||||
}
|
||||
else {
|
||||
$("#groupfield_pagewidget_height").show();
|
||||
}
|
||||
|
||||
if($("#pagewidget_viewheader").val()==1) {
|
||||
$("#groupfield_pagewidget_colorheaderback").show();
|
||||
$("#groupfield_pagewidget_colorheaderfont").show();
|
||||
$("#groupfield_pagewidget_opened").show();
|
||||
}
|
||||
else {
|
||||
$("#groupfield_pagewidget_colorheaderback").hide();
|
||||
$("#groupfield_pagewidget_colorheaderfont").hide();
|
||||
$("#groupfield_pagewidget_opened").hide();
|
||||
$("#pagewidget_opened").val(1);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
@ -1,4 +1,4 @@
|
||||
{% set widgetname="item" %}
|
||||
{% set widgetname="alert" %}
|
||||
{% extends 'Pagewidget/widget.twig' %}
|
||||
{% block widgetbody %}
|
||||
{% for alert in alerts %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% set widgetname="item" %}
|
||||
{% set widgetname="bookmark" %}
|
||||
{% extends 'Pagewidget/widget.twig' %}
|
||||
|
||||
{% block widgetaction %}
|
||||
|
@ -1,76 +0,0 @@
|
||||
{% import "Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %}
|
||||
{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %}
|
||||
|
||||
{% set colorbodyback = entity.colorbodyback %}
|
||||
{% if colorbodyback is null %}
|
||||
{% set colorbodyback = app.session.get('colorbgbodydark') %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = app.session.get('colorfttitledark') %}
|
||||
{% endif %}
|
||||
{% set colorbody = app.session.get('colorbgbodylight') %}
|
||||
{% set colormain = app.session.get('colorbgbodydark') %}
|
||||
|
||||
{% if app.user %}
|
||||
<style>.msgtopic a { color: #{{colorbodyfont}}; font-weight: bold; }</style>
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-chat" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
|
||||
<div class="widgetheader">
|
||||
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ appAlias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
|
||||
{% else %}
|
||||
<img src="/{{ appAlias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-chat" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
{% if look=="list" %}
|
||||
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% else %}
|
||||
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% if onheader %}
|
||||
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
|
||||
<iframe src="{{ path(tool,{'id':group,'framed':true,'border':entity.border,'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont,'colorbody':colorbody,'colormain':colormain}) }}" style="margin-top:30px" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ appAlias }}/{{ entity.icon.label }}" class="logo"/>
|
||||
{% else %}
|
||||
<img src="/{{ appAlias }}/uploads/icon/icon_pin.png" class="logo"/>
|
||||
{% endif %}
|
||||
<span class="title">{{ entity.name }}</span>
|
||||
</div>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}; overflow-y:auto; {%if entity.border %} padding-left: 10px; {%endif%}">
|
||||
{% if group is not null %}
|
||||
{{ render(url('app_message_chat',{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont,'colorbody':colorbody,'colormain':colormain})) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%endif%}
|
@ -1,56 +1,28 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
{% set widgetname="editor" %}
|
||||
{% extends 'Pagewidget/widget.twig' %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
{% block widgetaction %}
|
||||
{% if canadd %}
|
||||
<i class="fa fa-pencil fa-fw" title="Modifier votre texte" onClick="ckeditor({{ entity.id }})"></i>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-editor" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
|
||||
<div class="widgetheader">
|
||||
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
|
||||
{% else %}
|
||||
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% block widgetbody %}
|
||||
{% if html is empty and canadd %}
|
||||
<div class="p-5 text-center">
|
||||
<i title="Modifier votre texte" class="fa fa-pencil fa-5x" onClick="ckeditor({{ entity.id }})" style="cursor:pointer"></i><br>
|
||||
Modifier votre texte
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-editor" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if look=="list" %}
|
||||
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% else %}
|
||||
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="ckeditor-content">
|
||||
{{ html | raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
|
||||
{% else %}
|
||||
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
|
||||
{% endif %}
|
||||
<span class="title">{{ entity.name }}</span>
|
||||
</div>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}; overflow-x:hidden; ">
|
||||
{{ html | raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
@ -1,67 +1,15 @@
|
||||
{% import "Pagewidget/constants.twig" as constants %}
|
||||
{% set widgetname="file" %}
|
||||
{% extends 'Pagewidget/widget.twig' %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
|
||||
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %}
|
||||
{% block widgetaction %}
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-plus fa-fw" title="Ajouter Images" title="Ajouter Fichiers" onClick="addFile({{ entity.id }})"></i>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% set colorbodyback = entity.colorbodyback %}
|
||||
{% if colorbodyback is null %}
|
||||
{% set colorbodyback = app.session.get('colorbgbodydark') %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if entity.border and colorbodyfont is null %}
|
||||
{% set colorbodyfont = app.session.get('colorfttitledark') %}
|
||||
{% endif %}
|
||||
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = app.session.get('colorbgbodydark') %}
|
||||
{% endif %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-file" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
|
||||
<div class="widgetheader">
|
||||
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ appAlias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
|
||||
{% else %}
|
||||
<img src="/{{ appAlias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-file" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if look=="list" %}
|
||||
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% else %}
|
||||
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ appAlias }}/{{ entity.icon.label }}" class="logo"/>
|
||||
{% else %}
|
||||
<img src="/{{ appAlias }}/uploads/icon/icon_pin.png" class="logo"/>
|
||||
{% endif %}
|
||||
<span class="title">{{ entity.name }}</span>
|
||||
</div>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
<iframe id="frame-{{directory}}" src="{{ path("app_"~access~"_file_list",{'directory':directory,'defaultview':view}) }}" data-color="#{{colorbodyfont}}" style="{{ stylewidgetbodyframe }}" class="{% if not entity.autoajust %}notframeajust {% endif %}"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block widgetbody %}
|
||||
<iframe id="framefile-{{id}}" src="{{ path("app_"~access~"_file_list",{'category':category,'id':id, 'usage':usage, 'view':view}) }}" class="{% if entity.autoajust %}localframe {% endif %}" style="width:100%"></iframe>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
@ -1,123 +1,23 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
{% set widgetname="galery" %}
|
||||
{% extends 'Pagewidget/widget.twig' %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
{% block widgetaction %}
|
||||
{% if canadd %}
|
||||
<i class="fa fa-plus fa-fw" title="Ajouter Images" title="Ajouter Images" onClick="addImage({{ entity.id }})"></i>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
|
||||
|
||||
{% set color = app.session.get('color') %}
|
||||
|
||||
{% set colorbodyback = entity.colorbodyback %}
|
||||
{% if colorbodyback is null %}
|
||||
{% set colorbodyback = color['main'] %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-galery" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
|
||||
<div class="widgetheader">
|
||||
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
|
||||
{% else %}
|
||||
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% block widgetbody %}
|
||||
{% if canadd %}
|
||||
<a class="btn btn-sm btn-success mb-1" onClick="addImage({{ entity.id }})"><i class="fa fa-plus fa-fw" title="Ajouter Images" ></i> Ajouter des Images</a>
|
||||
{% endif %}
|
||||
|
||||
<div class="masonry" style="display:none">
|
||||
<div class="masonry-sizer" style="display:none"></div>
|
||||
{% for file in files %}
|
||||
<div class="masonry-item">
|
||||
<a onClick="viewFile({{ entity.id }},'{{file.Key}}',true)"><img src="{{path("app_minio_image",{file:file.Key}) }}" style="width:100%;"></a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-galery" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if canadd %}
|
||||
<a style="{{ stylewidgetmenu }}" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Fichiers','{{ path('cadoles_core_'~access~'_file_upload',{'id': 'widget-'~entity.id,'type':'image'}) }}');" title='Ajouter des Images'><i class="fa fa-plus fa-fw"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% if look=="list" %}
|
||||
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% else %}
|
||||
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
|
||||
{% else %}
|
||||
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
|
||||
{% endif %}
|
||||
<span class="title">{{ entity.name }}</span>
|
||||
</div>
|
||||
|
||||
{% if files|length>0 or canadd %}
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
<div class="grid clearfix">
|
||||
{% if canadd %}
|
||||
<div class="grid-sizer grid-image"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
{% for file in files|sort %}
|
||||
{% if loop.index==1 and not canadd %}
|
||||
<div class="grid-sizer grid-image"></div>
|
||||
<div class="grid-gutter-sizer grid-gutter-sizer-image"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item grid-image">
|
||||
<div class="grid-item-content">
|
||||
{% if canadd %}
|
||||
<a style="cursor:pointer" onClick="delFile('widget-{{ entity.id}}','{{file.name|e('js')|raw}}')" class="item-delete"><i style="color: #FFF" class="fa fa-trash" title="Supprimer le fichier"></i></a>
|
||||
{% endif %}
|
||||
|
||||
<a style="cursor:pointer" onClick="showFrameitem('file-{{entity.id}}-{{loop.index}}','{{ path('cadoles_core_'~access~'_file_view',{'directory':'widget-'~entity.id,'filename':file.name,'navigation':true }) }}',true)">
|
||||
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-img" height="110" src="{{ file.thumb }}">
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if canadd %}
|
||||
<div class="grid-item grid-list" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="grid-item-content">
|
||||
<a style="{{ stylewidgetmenu }}" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Fichiers','{{ path('cadoles_core_'~access~'_file_upload',{'id': 'widget-'~entity.id,'type':'image'}) }}');" title='Ajouter des Images'>
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-img imageshadow" height="110" src="/{{ alias }}/uploads/icon/icon_add.png" />
|
||||
</div>
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2 style="{{ stylewidgetbodyreverse }}">Ajouter des Images</h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
@ -1,121 +0,0 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set colormain = constants.mycolormain() %}
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
|
||||
{% set color = app.session.get('color') %}
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyback = entity.colorbodyback %}
|
||||
{% if colorbodyback is null %}
|
||||
{% set colorbodyback = color['main'] %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% if colorbodyback==color['fontcolorhover'] %}
|
||||
{% set colorbodyfont = color['main'] %}
|
||||
{% else %}
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if modelist==0 %}
|
||||
{% set stylegrid="grid-preview" %}
|
||||
{% elseif modelist==1 %}
|
||||
{% set stylegrid="grid-list" %}
|
||||
{% endif %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-groupmessage" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
|
||||
<div class="widgetheader">
|
||||
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
|
||||
{% else %}
|
||||
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-groupmessage" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if look=="list" %}
|
||||
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% else %}
|
||||
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
|
||||
{% else %}
|
||||
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
|
||||
{% endif %}
|
||||
<span class="title">{{ entity.name }}</span>
|
||||
</div>
|
||||
|
||||
|
||||
{% if messages is not empty %}
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }} ">
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{stylegrid}}"></div>
|
||||
<div class="grid-gutter-sizer {{stylegrid}}-gutter-sizer"></div>
|
||||
{% set nbaff=0 %}
|
||||
{% for message in messages %}
|
||||
{% set nbaff=nbaff+1 %}
|
||||
{% set class="" %}
|
||||
{% set style="" %}
|
||||
{% if nbaff > nbarticle %}
|
||||
{% set class="msg-hidden" %}
|
||||
{% set style="display:none" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item {{ stylegrid }} msg-{{ message.id }} {{class}}" style="{{ stylewidgetbodyreverse }}; {{style}};">
|
||||
<div class="grid-item-content" style="background-color:{{ message.color ? "#"~message.color : '#'~colormain }}">
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img style='cursor:pointer' onClick="seeUser({{message.user.id}})" class="grid-item-img avatar" src="/{{alias}}/uploads/avatar/{{message.user.avatar}}" width="100%">
|
||||
<a onClick="hideMessage({{message.id}})" style="cursor:pointer;" title="Ne plus afficher"><i class="fa fa-eye-slash"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="caption">
|
||||
<div class="grid-item-title" style="position:inherit; width:85%">
|
||||
{{message.user.lastname}} {{message.user.firstname}}<br>
|
||||
<small>{{message.date|date('d/m/Y H:i')}} dans le groupe <u><a href="{{path('cadoles_core_home',{id:message.pageid})}}" target="_top">{{ message.pagetitle }}</a></u></small><br><br>
|
||||
{{ message.topic | raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{%if canadd %}
|
||||
{%if canupdate %}
|
||||
<div class="item item-verysmall" style="background-color: var(--colorbgbodydark);">
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% set widgetname="item" %}
|
||||
{% set widgetname="itemessential" %}
|
||||
{% extends 'Pagewidget/widget.twig' %}
|
||||
|
||||
{% block widgetaction %}
|
||||
|
@ -1,63 +0,0 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %}
|
||||
{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %}
|
||||
|
||||
{% set color = app.session.get('color') %}
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = color['main'] %}
|
||||
{% endif %}
|
||||
|
||||
{%if not mini %}
|
||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-separator" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate %}
|
||||
<div class="widgetmenu">
|
||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
|
||||
{% if seeicon %}
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
|
||||
{% else %}
|
||||
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if seetitle %}
|
||||
<span class="title">{{ entity.name }}</span>
|
||||
{% else %}
|
||||
<style>
|
||||
div.separator {
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
background-color:#{{colorbodyfont}};
|
||||
float:left;
|
||||
position: relative;
|
||||
top: 20px;
|
||||
}
|
||||
</style>
|
||||
<div class="separator"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
@ -1,94 +1,51 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
{% set widgetname="slide" %}
|
||||
{% extends 'Pagewidget/widget.twig' %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
{% block widgetaction %}
|
||||
{% if canadd %}
|
||||
<i title="Gérer le Carrousel" class="fa fa-th" onClick="listSlide({{ entity.id }})"></i>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %}
|
||||
{% block widgetbody %}
|
||||
{% set intervalmilli = interval * 1000 %}
|
||||
|
||||
{% set color = app.session.get('color') %}
|
||||
{% set stylelink = "color:#" ~ entity.colorheaderfont ~ ";" %}
|
||||
{% if entity.colorheaderfont is null %}
|
||||
{% set stylelink = "color:#" ~ color['fontcolorhover'] ~ ";" %}
|
||||
{% endif %}
|
||||
|
||||
{% if app.user %}
|
||||
{% set username = app.user.username %}
|
||||
{% else %}
|
||||
{% set username = "" %}
|
||||
{% endif %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-slide" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
|
||||
<div class="widgetheader">
|
||||
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
|
||||
{% else %}
|
||||
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
<div class="{{ (slides|length > 1 ? "slick" : "") }}" data-slicktime='{{ intervalmilli }}'>
|
||||
{% if slides is empty and canadd %}
|
||||
<div class="pt-5 text-center">
|
||||
<i title="Gérer le Carrousel" class="fa fa-th fa-5x" onClick="listSlide({{ entity.id }})" style="cursor:pointer"></i><br>
|
||||
Gérer le Carrousel
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-slide" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if canadd %}
|
||||
<i title="Gérer le Carrousel" class="fa fa-th fa-fw" onClick="listSlide({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if look=="list" %}
|
||||
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% for slide in slides %}
|
||||
{% if slide.url is not empty %}
|
||||
{% set url=slide.url|replace({'#login#': username}) %}
|
||||
{% if slide.target == 'frame' %}
|
||||
<a class="item-link" onClick="showItemframe(slide{{ slide.id }}','{{ url }}')">
|
||||
{% else %}
|
||||
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a class="item-link" href="{{ url }}" target="{{ slide.target }}">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div style="background-image:url({{ path("app_minio_image",{file:slide.image}) }}); background-size:cover; background-position: center; min-height:200px;{{(entity.autoajust ? "" : "height:"~entity.height~"px;")}}">
|
||||
<div class="p-3">
|
||||
{% if slide.title is not empty %}
|
||||
<h1 class="slicktitle" style="{{colorbodyfont}};">{{slide.title}}</h1>
|
||||
{% endif %}
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
|
||||
{% set intervalmilli = interval * 1000 %}
|
||||
<div class="slick" data-slick='{"autoplaySpeed": {{ intervalmilli }} }'>
|
||||
{% for slide in slides %}
|
||||
<div style="background-image:url(/{{ alias }}/{{ slide.image }}); ">
|
||||
|
||||
{% if slide.title is not empty %}
|
||||
<h1 class="slicktitle" style="{{ stylelink }}">{{slide.title}}</h1>
|
||||
{% endif %}
|
||||
|
||||
{% if slide.url is not empty %}
|
||||
{% if slide.target == 'frame' %}
|
||||
<a class="slicklink" style="{{ stylelink }} cursor:pointer" onClick="showFrameitem('slide{{ slide.id }}','{{ slide.url|replace({'#login#': username}) }}')">
|
||||
{% elseif slide.target == "_self" %}
|
||||
<a class="slicklink" style="{{ stylelink }}" href="{{ slide.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ slide.target }}{% endif %}">
|
||||
{% else %}
|
||||
<a class="slicklink" style="{{ stylelink }}" href="{{ slide.url|replace({'#login#': username}) }}" target="{{ slide.target }}">
|
||||
{% endif %}
|
||||
|
||||
<i class="fa fa-link"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% if slide.subtitle is not empty %}
|
||||
<span class="slicksubtitle" style="{{ stylelink }}">{{slide.subtitle}}</span>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
{% if slide.subtitle is not empty %}
|
||||
<span class="slicksubtitle" style="{{colorbodyfont}};">{{slide.subtitle}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if slide.url is not empty %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
@ -1,14 +1,46 @@
|
||||
{% set widgethaveheader=entity.viewheader %}
|
||||
|
||||
{% if widgetname=="alert" and canupdate and alerts|length ==0 %}
|
||||
{% set widgethaveheader=true %}
|
||||
{% endif %}
|
||||
{% if widgetname=="item" and canupdate and items|length==0 and withbookmark==1 %}
|
||||
{% set widgethaveheader=true %}
|
||||
{% endif %}
|
||||
{% if widgetname=="bookmark" and canadd and bookmarks|length==0 %}
|
||||
{% set widgethaveheader=true %}
|
||||
{% endif %}
|
||||
{% if widgetname=="editor" and canadd and html is empty %}
|
||||
{% set widgethaveheader=true %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% set viewwidget=true %}
|
||||
{% if not widgethaveheader and widgetname=="alert" and not canupdate and alerts|length ==0 %}
|
||||
{% set viewwidget=false %}
|
||||
{% endif %}
|
||||
{% if not widgethaveheader and widgetname=="item" and not canupdate and items|length ==0 and withbookmark==1 %}
|
||||
{% set viewwidget=false %}
|
||||
{% endif %}
|
||||
{% if not widgethaveheader and widgetname=="bookmark" and not canadd and bookmarks|length ==0 %}
|
||||
{% set viewwidget=false %}
|
||||
{% endif %}
|
||||
{% if not widgethaveheader and widgetname=="editor" and not canadd and html is empty %}
|
||||
{% set viewwidget=false %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
|
||||
{%if widgethaveheader %}
|
||||
{% set widgetstyle=(entity.colorheaderback ? "border-color:"~entity.colorheaderback~";" : "border-color:var(--colorbgbodydark);") %}
|
||||
{% set widgetstylemenu=(entity.colorheaderback ? "background-color:"~entity.colorheaderback~";" : "background-color:var(--colorbgbodydark);")~(entity.colorheaderfont ? "color:"~entity.colorheaderfont~";" : "color:var(--colorfttitledark);") %}
|
||||
{%else%}
|
||||
{% set widgetstyle=(entity.colorbodyback ? "border-color:"~entity.colorbodyback~";" : "border-color:var(--colorbgbodydark);") %}
|
||||
{% set widgetstyle=(viewwidget ? "display:block;" : "display:none;")~(entity.colorbodyback ? "border-color:"~entity.colorbodyback~";" : "border-color:var(--colorbgbodydark);") %}
|
||||
{% set widgetstylemenu="margin:-26px 0px 0px 0px; padding: 1px 10px; background-color:var(--colorbgbodydark); color: var(--colorfttitledark); border-radius: 5px;" %}
|
||||
{%endif%}
|
||||
|
||||
{% set widgetstyleheader=(entity.colorheaderback ? "background-color:"~entity.colorheaderback~";" : "background-color:var(--colorbgbodydark);")~(entity.colorheaderfont ? "color:"~entity.colorheaderfont~";" : "color:var(--colorfttitledark);") %}
|
||||
{% set widgetstylebody=(entity.colorbodyback ? "background-color:"~entity.colorbodyback~";" : "background-color:var(--colorbgbodylight);")~(entity.colorbodyfont ? "color:"~entity.colorbodyfont~";" : "color:var(--colorfttitlelight);")~(entity.isopened ? "display:block;" : "display:none;")~(widgetname=="url" ? "padding:0px;" : "")~(not widgethaveheader and not entity.border ? "padding-top: 0px" : "")~(entity.autoajust ? "" : "height:"~entity.height~"px;") %}
|
||||
{% set widgetstylebody=(entity.colorbodyback ? "background-color:"~entity.colorbodyback~";" : "background-color:var(--colorbgbodylight);")~(entity.colorbodyfont ? "color:"~entity.colorbodyfont~";" : "color:var(--colorfttitlelight);")~(entity.isopened ? "display:block;" : "display:none;")~(widgetname=="url" ? "padding:0px;" : "")~(not widgethaveheader and not entity.border ? "padding-top: 0px;" : "")~(entity.autoajust ? "" : "height:"~entity.height~"px;") %}
|
||||
{% set widgeicon= entity.icon ? path('app_minio_image',{file:entity.icon.label}) : path('app_minio_image',{file:"icon/icon_pin.png"}) %}
|
||||
|
||||
{% if modedesktop is defined %}
|
||||
@ -59,7 +91,7 @@
|
||||
</div>
|
||||
{%endif%}
|
||||
|
||||
<div class="widget-body" style="{{ widgetstylebody }};">
|
||||
<div class="widget-body {{ (entity.autoajust ? "widget-adjust" : "") }}" style="{{ widgetstylebody }};">
|
||||
{% block widgetbody %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
67
templates/Pagewidgetslide/edit.html.twig
Executable file
67
templates/Pagewidgetslide/edit.html.twig
Executable file
@ -0,0 +1,67 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Carrousel
|
||||
{% elseif mode=="submit" %}
|
||||
Création Carrousel
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href="{{ path('app_'~access~'_pagewidgetslide_list',{'idwidget':pagewidget.id,'usage':usage}) }}">Annuler</a>
|
||||
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('app_'~access~'_pagewidgetslide_delete',{'idwidget':pagewidget.id,'id':entity.id,'usage':usage}) }}
|
||||
class="btn btn-danger float-end"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?">
|
||||
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 clearfix">
|
||||
<div class="col-md-8">
|
||||
{{ form_row(form.title) }}
|
||||
{{ form_row(form.subtitle) }}
|
||||
|
||||
<div style="width:100%; margin:10px auto; text-align:center;">
|
||||
<img id="pagewidgetslide_image_img" src="{{ path("app_minio_image",{file:entity.image}) }}" style="padding:10px; width:100%;height:auto;margin:auto;display:block;margin-bottom:5px;background-color: var(--colorbgbodydark)">
|
||||
<a class="btn btn-info btn-modal" style="width:110px" data-modalid="mymodallarge" data-modaltitle="Carrousel" data-modalurl="{{ path('app_'~access~'_pagewidgetslide_upload', {"type": "slide", 'idwidget':pagewidget.id, 'usage':usage, "reportinput": "#pagewidgetslide_image" }) }}" title='Ajouter un Icône'>Modifier</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ form_row(form.roworder) }}
|
||||
{{ form_row(form.url) }}
|
||||
<em>le mot clé #login# sera remplacé par le login de l'utilisateur</em><br><br>
|
||||
{{ form_row(form.target) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
18
templates/Pagewidgetslide/list.html.twig
Normal file
18
templates/Pagewidgetslide/list.html.twig
Normal file
@ -0,0 +1,18 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">Gestion des Carrousels</h1>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-success" href={{ path('app_'~access~'_pagewidgetslide_submit',{idwidget:pagewidget.id,usage:usage}) }}>Ajouter</a>
|
||||
<a class="btn btn-secondary" href="{{ path('app_'~access~'_page_'~usage~'_view',{id:pagewidget.page.id}) }}">Retour</a>
|
||||
</p>
|
||||
|
||||
|
||||
{% for pagewidgetslide in pagewidgetslides %}
|
||||
<a href="{{ path('app_'~access~'_pagewidgetslide_update', {idwidget:pagewidget.id,id:pagewidgetslide.id,usage:usage}) }}">
|
||||
<img id="icon_label_img" src="{{ path("app_minio_image",{file:pagewidgetslide.image}) }}" style="padding:5px; width:300px;height:auto;margin:auto;display:block;margin-bottom:5px;background-color: var(--colorbgbodydark)">
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
43
templates/Pagewidgetslide/upload.html.twig
Executable file
43
templates/Pagewidgetslide/upload.html.twig
Executable file
@ -0,0 +1,43 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block encoretags %}
|
||||
{{ encore_entry_link_tags('dropzone') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<a class="btn btn-secondary" onClick="closeModal();">Annuler</a>
|
||||
|
||||
<form
|
||||
action="{{ oneup_uploader_endpoint('slide') }}"
|
||||
class="dropzone"
|
||||
id="mydropzone"
|
||||
data-acceptedMimeTypes="image/*"
|
||||
data-maxFiles=1
|
||||
data-folder={{ pagewidget.id }}
|
||||
style="margin-top:10px">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block localscript %}
|
||||
{{ encore_entry_script_tags('dropzone') }}
|
||||
|
||||
<script>
|
||||
function dropzoneinit( elmt ) {
|
||||
elmt.on("sending", function(file, xhr, formData) {
|
||||
formData.append("folder", "{{ pagewidget.id }}");
|
||||
});
|
||||
}
|
||||
|
||||
function dropzonesuccess( file, response ) {
|
||||
parent.$("#pagewidgetslide_image").val("slide/{{pagewidget.id}}/"+response["file"]);
|
||||
parent.$("#pagewidgetslide_image_img").attr("src","{{ path("app_minio_image",{file:"slide/"~pagewidget.id~"/"}) }}"+response["file"]);
|
||||
closeModal();
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
window.parent.$("#mymodallarge").modal('hide');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
@ -183,6 +183,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function switchHeader() {
|
||||
{% if app.user %}
|
||||
@ -225,9 +228,10 @@
|
||||
else {
|
||||
$("#menuapp").css("height","auto");
|
||||
}
|
||||
|
||||
|
||||
$(".widget-body").find("iframe").each(function(){
|
||||
if($(this).hasClass("frameajust")) {
|
||||
console.log("here");
|
||||
try {
|
||||
height=this.contentWindow.document.body.scrollHeight;
|
||||
|
||||
@ -241,6 +245,7 @@
|
||||
$(this).height($(this).parent().height());
|
||||
});
|
||||
}
|
||||
iFrameResize({ log: false,heightCalculationMethod: 'documentElementScroll' }, '.localframe');
|
||||
</script>
|
||||
|
||||
{% block localscript %}{% endblock %}
|
||||
|
Reference in New Issue
Block a user