svg
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit

This commit is contained in:
2023-02-16 17:03:53 +01:00
parent 9554b9cdd3
commit eef04429ee
192 changed files with 9375 additions and 17414 deletions

View File

@ -1,334 +0,0 @@
{% extends '@CadolesCore/base.html.twig' %}
{% set color = app.session.get('color') %}
{% set colormain = color['main'] %}
{% block pagewrapper %}
<div id="pagecontainer" style="margin: 0px -30px;"></div>
<div id="gridtemplate" style="max-width:1500px; margin:auto; margin-bottom:30px">
<div class="col-md-3">qsdfqsdfqsd</div>
<div class="col-md-9">
{% if bookmarks is not empty %}
<div class="bookmark-container">
{% if items is not empty %}
<h3 class="grid-title" data-idcategory="bookmark" style="{{ colorbodyfont }}">Favoris</h3>
{% else %}
<p></p>
{% endif %}
<div class="grid clearfix">
<div class="grid-sizer grid-small"></div>
<div class="grid-gutter-sizer"></div>
{% for bookmark in bookmarks %}
<div class="grid-item grid-small">
<div class="grid-item-content" style="background-color: {{ bookmark.color ? "#"~bookmark.color : '#'~colormain }};">
<a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a>
{% if bookmark.target == 'frame' %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.id }}','{{ bookmark.url }}')">
{% elseif bookmark.target == "_self" %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}">
{% else %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url }}" target="{{ bookmark.target }}">
{% endif %}
<div class="item-link clearfix">
<div class="grid-item-logo">
{% if bookmark.icon %}
<img class="grid-item-img" height="110" src="/{{ alias }}/{{ bookmark.icon.label }}">
{% else %}
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/icon_pin.png">
{% endif %}
</div>
<div class="grid-item-title">
<h2>{{ bookmark.title }}</h2>
<span>{{ bookmark.subtitle|nl2br }}</<span>
</div>
</div>
</a>
</div>
</div>
{% endfor %}
</div>
</div>
{% else %}
<div class="bookmark-container" style="display:none">
<h3 class="grid-title" data-idcategory="bookmark"">Favoris</h3>
<div class="grid clearfix">
<div class="grid-sizer grid-small"></div>
<div class="grid-gutter-sizer"></div>
</div>
</div>
{% endif %}
{% set mycategs = [] %}
{% for itemcategory in itemcategorys %}
{% set haveitem=false %}
{% for item in items if item.itemcategory==itemcategory %}
{% if loop.index ==1 %}
{% set mycategs = mycategs|merge({ (loop.index) : itemcategory}) %}
{% endif %}
{% endfor %}
{% endfor %}
{% for itemcategory in mycategs %}
{% set haveitem=false %}
{% for item in items if item.itemcategory==itemcategory %}
{% if loop.index ==1 %}
{% set haveitem=true %}
{% if mycategs|length > 1 or bookmarks is not empty %}
<h3 class="grid-title" data-idcategory="{{ itemcategory.id }}">{{ itemcategory.label }}</h3>
{% else %}
<p></p>
{% endif %}
<div class="grid clearfix">
<div class="grid-sizer grid-small"></div>
<div class="grid-gutter-sizer"></div>
{% endif %}
<div class="grid-item grid-small" data-idcategory="{{ item.itemcategory.id }}" data-iditem="{{ item.id }}">
<div class="grid-item-content" style="background-color: {{ item.color ? "#"~item.color : '#'~colormain }};">
{% if item.content %}
<a style="cursor:pointer" class="item-preview"><i style="color: #FFF" class="fa fa-info" title="Informations sur ce service"></i></a>
{% endif %}
{% if item.protected and not app.user %}
{% if mode_auth == "SAML" %}
<a href="{{ path('lightsaml_sp.login') }}" {% if access=="user" %}target="_top"{% endif %}>
{% elseif mode_auth == "CAS" %}
<a href="{{ path('cas_sp.login') }}" {% if access=="user" %}target="_top"{% endif %}>
{% elseif mode_auth == "MYSQL" %}
<a href="{{ path('cnous_portal_user_login') }}" {% if access=="user" %}target="_top"{% endif %}>
{% endif %}
{% else %}
{% if item.target == 'frame' %}
<a class="linktosonde" data-sonde="{{ item.title }}" style="cursor:pointer" onClick="showFrameitem({{ item.id }},'{{ item.url }}')">
{% elseif item.target == "_self" %}
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url }}" target="{% if access=="user" %}_top{% else %}{{ item.target }}{% endif %}">
{% else %}
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url }}" target="{{ item.target }}">
{% endif %}
{% endif %}
<div class="item-link clearfix">
<div class="grid-item-logo">
{% if item.icon %}
<img class="grid-item-img" height="110" src="/{{ alias }}/{{ item.icon.label }}">
{% else %}
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/icon_pin.png">
{% endif %}
</div>
<div class="grid-item-title">
<h2>{{ item.title }}</h2>
<span>{{ item.subtitle|nl2br }}</<span>
</div>
</div>
</a>
<div class="grid-item-body" style="display:none">
{{ item.content|raw }}
</div>
</div>
</div>
{% endfor %}
{% if haveitem %}
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endblock %}
{% block localjavascript %}
$('document').ready(function(){
// Ajustement des frames
$(window).resize(function() {
AjustFrame();
});
// Création des grilles d'items
var optiongrid={columnWidth: '.grid-sizer', itemSelector: '.grid-item', gutter: '.grid-gutter-sizer'};
$('body').imagesLoaded(function() {
var grid = $('.grid').masonry(optiongrid);
});
// Preview item de bureau
$( ".grid .item-preview" ).click(function() {
if($(this).parent().children(".grid-item-body").css('display') == 'none') {
$(this).html('<i style="color: #FFF" class="fa fa-minus" title="Informations sur ce service"></i>');
heightbody=$(this).parent().children(".grid-item-body").height()+30;
heightitem=$(this).parent().parent().height();
$(this).parent().children(".grid-item-body").show();
$(this).parent().parent().css("width","100%");
$(this).parent().parent().css("height",heightitem+heightbody);
$(this).parent().children(".grid-item-content").css("height",heightitem+heightbody);
$(this).parent().children(".item-preview").css("height",heightitem+heightbody);
var grid = $('.grid').masonry(optiongrid);
}
else {
$(this).html('<i style="color: #FFF" class="fa fa-plus" title="Informations sur ce service"></i>');
$(this).parent().children(".grid-item-body").hide();
$(this).parent().parent().css("width","");
$(this).parent().parent().css("height","");
$(this).parent().children(".grid-item-content").css("height","");
$(this).parent().children(".item-preview").css("height","");
var grid = $('.grid').masonry(optiongrid);
}
});
// Sur click item à sonder
{% if activate_widsonde %}
$( ".linktosonde" ).click(function() {
title=$(this).attr("data-sonde");
//$.getScript( "{{ widsonde_url }}?appli="+title );
});
{% endif %}
});
// Ajout d'un bookmark
function addBookmark(idwidget,touser) {
var url="{{ path('cadoles_portal_user_bookmark_submit',{idpage:0,idwidget:'xx',touser:'yy'})}}";
url=url.replace('xx',idwidget);
url=url.replace('yy',touser);
$(location).attr('href', url);
}
// Modifciation d'un bookmark
function modBookmark(idbookmark) {
var url="{{ path('cadoles_portal_user_bookmark_update',{idpage:0,id:'xx'})}}";
url=url.replace('xx',idbookmark);
$(location).attr('href', url);
}
// Ajouter un item aux bookmark
function heartBookmark(iditem) {
var idbookmark;
$.ajax({
method: "POST",
url: "{{ path('cadoles_portal_user_bookmark_heart') }}",
data: {
iditem:iditem
},
success: function(idbookmark) {
location.reload();
}
});
}
// Supprimer un fichier
function delFile(directory,filename) {
var r = confirm("Confirmez-vous la suppression de ce fichier ?");
if (r == true) {
$.ajax({
method: "POST",
url: "{{ path('cadoles_core_user_file_delete') }}",
data: {
directory:directory,
filename:filename
},
success: function() {
location.reload();
}
});
}
}
// Ajustement des frames
function AjustFrame() {
$('.frameajust').iframeAutoHeight({
minHeight: 500, // Sets the iframe height to this value if the calculated value is less
heightOffset: 0, // Optionally add some buffer to the bottom
callback: function(callbackObject) { $(this).parent().css("height",callbackObject.newFrameHeight) ;}
});
if($(".frameitem").length>0) {
var heightbody = $('html').height();
var heightheader = $('.header').height();
if($('.pagemenu').css("display")=="none")
var heightmenu = 0;
else
var heightmenu = $('.pagemenu').height();
var heightframe = heightbody-heightheader-heightmenu;
$(".frameitem").height(heightframe);
}
}
// Affichage d'un Flux
function showFlux(idwidget, id) {
if(id=="all")
$(".widget[data-id="+idwidget+"]").find(".feed").show();
else {
$(".widget[data-id="+idwidget+"]").find(".feed").hide();
$(".widget[data-id="+idwidget+"]").find(".flux-"+id).show();
}
var optiongrid={columnWidth: '.grid-sizer',itemSelector: '.grid-item'};
var grid = $('.grid').masonry(optiongrid);
}
// Affichage des frames associés aux items de bureau
function resizeFrame() {
var iFrame = document.getElementById('frameContent');
var heightbody = $('html').height();
var heightheader = $('.header').height();
if($('#appmenu').css("display")=="none")
var heightmenu = 0;
else
var heightmenu = $('#appmenu').height();
var heightframe = heightbody-heightheader-heightmenu;
$(".pageframe").each(function( index ) {
$(this).height(heightframe);
});
}
function showFrameitem(id,url,forcereload) {
$(".pageframe").hide();
// Si force le rechargement et frame existante on la détruit
if(forcereload&&$("#frameitem-"+id).length)
$("#frameitem-"+id).remove();
// Si la frame en cours existe déjà on l'affiche
if($("#frameitem-"+id).length)
$("#frameitem-"+id).show();
// Sinon on la génère
else
$("#pagecontainer").append("<iframe id='frameitem-"+id+"' class='pageframe' src='"+url+"' style='border:none; width:100%'></iframe>");
resizeFrame();
}
{% endblock %}

View File

@ -1,141 +0,0 @@
{% extends 'base.html.twig' %}
{% block localstyle %}
.thumbnail {
text-align:center;
}
.thumbnail img {
width:200px;
border: 5px solid #fff;
border-radius: 10px;
}
.caption p {
text-align:justify;
font-size:14px;
word-wrap: break-word;
}
.caption ul {
margin-top:-10px;
padding-left: 20px;
}
.caption li {
text-align:left;
font-size:14px;
word-wrap: break-word;
font-style: italic;
}
h3 {
margin-top:10px;
}
{% endblock %}
{% block body %}
<div style="width: 400px;margin: auto;text-align: center;margin-top: 10px;">
<a href="{{ path("app_home") }}">
<img src="/{{ appAlias }}/uploads/logo/{{app.session.get("logolight")}}" style="max-width: 100%; max-height:200px;">
<h1 style="text-transform:uppercase; padding-top:0px">{{ app.session.get('appname') }}</h1>
</a>
<br>
{% if not app.user and moderegistration!="none" and appMasteridentity=="SQL"%}
<a href="{{ path("app_resetpwd01") }}">Mot de passe oublié ?</a>
{% endif %}
</div>
<div class="container row m-auto">
<div class="col-lg-3">
<div class="thumbnail" style="margin-top:10px; border:none; background-color:transparent">
<img class="imgreflect" src="/{{ appAlias }}/images/thumb-01.jpg"/>
<div class="caption">
<h3 style="text-align:center">Portail<br>Profilé</h3>
<p>Tous les éléments du portail peuvent être distribués en fonction du profil de l'utilisateur.</p>
<p>Il est possible de définir le profil de l'utilisateur en fonction :
<ul>
<li>De son groupe d'appartenance</li>
<li>D'attributs Annuaire</li>
<li>D'attributs SSO</li>
</ul>
</p>
<p>En fonction du profil de l'utilisateur, il est possible de distribuer :
<ul>
<li>Des pages en onglet</li>
<li>Des Flux RSS</li>
<li>Des Annonces</li>
<li>Des Applications Web</li>
<li>Des Calendriers</li>
</ul>
</p>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="thumbnail" style="margin-top:10px; border:none; background-color:transparent">
<img class="imgreflect" src="/{{ appAlias }}/images/thumb-02.jpg"/>
<div class="caption">
<h3 style="text-align:center">Portail<br>Personnalisable</h3>
<p>En fonction de la configuration et de leur profil, les utilisateurs du portail sont libres de créer leur propre page.</p>
<p>Les pages de l'utilisateur pouvant prendre plusieurs formes :
<ul>
<li>Une page pointant sur l'adresse d'un autre site</li>
<li>Une page construite par l'utilisateur via l'utilisation d'un éditeur riche</li>
<li>Une page constituée de widgets qu'il dispose selon son libre choix</li>
</ul>
</p>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="thumbnail" style="margin-top:10px; border:none; background-color:transparent">
<img class="imgreflect" src="/{{ appAlias }}/images/thumb-03.jpg"/>
<div class="caption">
<h3 style="text-align:center">Portail<br>Evolutif</h3>
<p>Ninegate est évolutif dans le sens où, vous disposerez d'une large bibliothèque de widgets qui composeront vos pages.</p>
<p>Voici quelques exemples :
<ul>
<li>Widget URL</li>
<li>Widget Flux RSS</li>
<li>Widget Editeur de texte</li>
<li>Widget Gestionnaire de tâches</li>
<li>Widget Calendriers</li>
<li>Widget Favoris</li>
<li>Widget Dépôt de Fichiers</li>
<li>Et bien d'autres encore</li>
</ul>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="thumbnail" style="margin-top:10px; border:none; background-color:transparent">
<img class="imgreflect" src="/{{ appAlias }}/images/thumb-04.jpg"/>
<div class="caption">
<h3 style="text-align:center">Portail</br>Open Source</h3>
<p>Ce projet est opensource
<ul>
<li>Vous pouvez à tout moment modifier le code de votre portail</li>
<li>Distribuer {{ app.session.get('appname') }}</li>
</ul>
</p>
<p>Ninegate est développé dans le cadre du projet <a href='https://envole.ac-dijon.fr/ninegate/' target='_blank'>Envole</a>. Vous pourrez trouver le code source de Ninegate sur la <a href='https://dev-eole.ac-dijon.fr/projects/eole-eportail' target='_blank'>forge du projet</a></p>
<p>Ninegate est propulsé par la société <a href='https://cadoles.com' target='_blank'>Cadoles</a></p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,83 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ form_start(form) }}
<h1 class="page-header">
{% if mode=="submit" %}
Création page
{% else %}
Modification page
{% endif %}
</h1>
{{ form_widget(form.submit) }}
{% if from=="child" %}
<a class="btn btn-secondary" href={{ path('app_child',{catparent:'page',idparent:page.id}) }}>Annuler</a>
{% else %}
<a class="btn btn-secondary" href={{ path('app_page') }}>Annuler</a>
{% endif %}
{% if mode=="update" and page.id>0%}
<a href={{ path('app_page_delete',{id:page.id}) }}
class="btn btn-danger float-right"
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">
<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.pagetype) }}
</div>
</div>
</div>
<div class="col-md-6">
</div>
</div>
{{ form_end(form) }}
{% endblock %}
{% block localscript %}
<script>
$(document).ready(function() {
$("#page_name").focus();
});
</script>
{% endblock %}

View File

@ -0,0 +1,204 @@
{% extends 'base.html.twig' %}
{% block localstyle %}
<style>
.childsize-1 {
zoom:80%;
}
.child-name {
border-color: var(--colorbgbodydark);
border-block-width: 3px;
//border-bottom-style:dotted;
}
.child-description h1, .child-description h2 {
margin-top:30px;
}
.child-sidebar {
color: var(--colorfttitlelight);
}
.child-sidebar h3 {
font-size:1.4rem;
}
.grid-sizer { width: 10% }
.grid-item {
background-color:var(--colorbgbodydark);
color: var(--colorfttitledark);
overflow:hidden;
}
.grid-image {
width:100%;
transition: transform 0.3s;
}
.grid-item-title {
background-color:var(--colorbgbodydark);
color: var(--colorfttitledark);
width:auto;
padding:15px;
text-align:center;
margin:auto;
}
.grid-item-size-1 { width: 10% }
.grid-item-size-2 { width: 20% }
.grid-item-size-3 { width: 33.333333% }
.grid-item-size-4 { width: 40% }
.grid-item-size-5 { width: 50% }
.grid-tag {font-style:italic}
</style>
{% endblock %}
{% block beforebody %}
{%if heros %}
<div class="heroheader" style="top:55px;margin-bottom:30px;display:none;" >
{% for hero in heros %}
<div class="btn btn-link p-0 m-0" style="background-image:url(/{{appAlias}}/uploads/childheader/{{hero.childid}}/{{hero.filename}})">
<img id="separateur" src="/{{appAlias}}/images/separateur-g.png">
<div style="padding-left:150px;">
<h1>
{{hero.name}}<br>
<small>
<div style="font-size:16px">{{ hero.parenttype }}</div>
<span style="font-size:20px; line-height:20px; display:block">{{ hero.subname|nl2br }}</span>
</small>
</h1>
<a class="btn btn-success" href="{{path("app_child_view",{catparent:hero.catparent,idparent:hero.parentid,idchild:hero.childid})}}">En savoir plus</a>
</div>
</div>
{%endfor%}
</div>
{% endif %}
{% endblock %}
{% block useractions %}
{% if is_granted('ROLE_ADMIN') %}
<li>
<a href="{{path("app_page_submit")}}"><i class="fa fa-plus fa-fw"></i></a>
</li>
{% endif %}
{% endblock %}
{% block body %}
<div class="container">
<h1 class="child-name pt-0 text-uppercase mb-4">Actualités</h1>
<div class="grid">
<div class="grid-sizer"></div>
<div class="gutter-sizer"></div>
{% for page in pages %}
{% if not page.childpages is empty %}
{% set background="" %}
{% if not page.childpages[0].child.childheaders is empty and page.childpages[0].child.childheaders[0] %}
{% set background="/"~appAlias~"/uploads/childheader/"~page.childpages[0].child.id~"/"~page.childpages[0].child.childheaders[0].filename %}
{% endif %}
{% set style="height:auto;background-position: center ; background-size: cover; background-image: url("~background~")" %}
<a href="{{path("app_child_view",{catparent:'page',idparent:page.id,idchild:page.childpages[0].child.id})}}" class="d-block text-center">
<div class="grid-item grid-item-size-5 d-flex align-items-stretch">
<div class="grid-image d-flex align-items-center pr-2 pl-2" style="{{style}}">
<div class="grid-item-title">
<span class="p-1" style="font-weight:bold; text-transform:uppercase;">{{ page.childpages[0].child.name }}</span>
<small><br><span class="p-1" style="background-color:var(--colorbgbodylight);color:var(--colorftbodylight)">{{ page.pagetype.name }}</span></small>
<small class="p-2" style="line-height:15px; display:block;">
{% if page.childpages[0].child.subname %}
{{ page.childpages[0].child.subname|nl2br }}<br>
{% endif %}
{% for tag in page.childpages[0].child.tags %}
{% if loop.first %}<br>{%endif%}
<span class="grid-tag" data-id="{{tag.id}}">#{{tag.id}}</span>
{% endfor %}
</small>
</small>
</div>
</div>
</div>
</a>
{% endif %}
{% endfor %}
</div>
</div>
{% endblock %}
{% block localscript %}
<script>
function resizegrid() {
height=$('.grid-item').width();
height=Math.min(height,300);
$('.grid-item').not('.grid-video').height(height)
$('.grid').masonry({
columnWidth: '.grid-sizer',
gutter: '.gutter-sizer',
itemSelector: '.grid-item',
percentPosition: true,
horizontalOrder: false,
});
}
$(window).resize(function() {
if($('.heroheader').length) {
heighthero=$('.heroheader').width()/4;
$('.heroheader').height(heighthero);
}
resizegrid();
});
$(document).ready(function() {
if($('.heroheader').length) {
heighthero=$('.heroheader').width()/4;
$('.heroheader').height(heighthero);
$('.heroheader').show();
{% if heros|length > 1 %}
$('.heroheader').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 6000,
dots: true,
touchMove: false,
pauseOnDotsHover: true,
fade: true,
cssEase: 'linear',
prevArrow: false,
nextArrow: false,
customPaging: function(slider, i) {
return '<span class="heroheader-dot fa fa-circle fa-fw"></span>';
}
});
{% endif %}
}
resizegrid();
});
$( ".grid-item" ).hover(function() {
$( this ).children(".grid-image").css("transform","scale(1.05)");
}, function() {
$( this ).children(".grid-image").css("transform","scale(1)");
});
$( ".grid-tag" ).hover(function() {
$( this ).css("text-decoration","underline");
}, function() {
$( this ).css("text-decoration","none");
});
$( ".grid-tag" ).click(function() {
url="{{path("app_child_searchbytag",{id:"xxx"}) }}"
url=url.replace("xxx",$(this).data("id"));
document.location = url;
return false;
});
</script>
{% endblock %}

View File

@ -1,36 +1,42 @@
{% extends 'base.html.twig' %}
{% extends "base.html.twig" %}
{% block body %}
<h1 class="page-header">
Gestion des Pages
pages
</h1>
<a href="{{ path('app_'~access~'_page_'~usage~'_submit') }}" class="btn btn-success">Ajouter une Page</a>
<div class="custom-control custom-switch float-right">
<input id="alluser" type="checkbox" class="custom-control-input">
<label id="labelalluser" class="custom-control-label" for="alluser">Afficher les pages créées par des utilisateurs</label>
</div>
<br><br>
<p><a class="btn btn-success" href={{ path('app_page_submit') }}>Ajouter</a></p>
<div class="card">
<div class="card-header">
<i class="fa fa-table fa-fw"></i> Liste des Pages
<i class="fa fa-table fa-fw"></i> Liste des pages
</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="140px" class="no-sort">Action</th>
<th>Ordre</th>
<tr>
<th width="90px" class="no-sort">Action</th>
<th class="no-string" width="70px">ID</th>
<th width="70px">Date</th>
<th width="200px">Type</th>
<th>Nom</th>
<th class="no-sort">Catégorie</th>
<th>Propriétaire</th>
</tr>
</tr>
</thead>
<tbody>
{% for page in pages %}
<tr>
<td>
<a href="{{path("app_child",{catparent:"page",idparent:page.id})}}"><i class="fa fa-file fa-2x"></i></a>
</td>
<td>{{page.id}}</td>
<td>{{page.submitdate|date("Y-m-d")}}</td>
<td>{{page.pagetype.name}}</td>
<td>{{page.name}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
@ -40,51 +46,13 @@
{% block localscript %}
<script>
$(document).ready(function() {
{% if not app.session.get('alluserpage') is empty %}
var state={{ app.session.get('alluserpage') }};
if(state) {
$("#labelalluser").html("Afficher les pages non liées à un utilisateur");
$("#alluser").attr('checked', true);
}
{% endif %}
table = $('#dataTables').DataTable({
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
$('#dataTables').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 100,
order: [[ 1, "asc" ]],
processing: true,
serverSide: true,
ajax: {
"url": "{{ path('app_'~access~'_page_'~usage~'_tablelist') }}",
"data": function ( d ) {
return $.extend( {}, d, {
"alluser": $('#alluser').is(':checked')
});
}
},
drawCallback: function(settings) {
$("a[data-method='delete']").click(function(){
if( !confirm('Êtes-vous sûr de vouloir supprimer cette page ?')) {
return false;
}
});
}
order: [[ 2, "asc" ]]
});
});
$('#alluser').change(function() {
if (typeof table !== 'undefined') {
table.ajax.reload();
}
var check = $('#alluser').is(':checked');
if(check)
$("#labelalluser").html("Afficher les pages non liées à un utilisateur");
else
$("#labelalluser").html("Afficher les pages créées par des utilisateurs");
});
</script>
{% endblock %}

View File

@ -1,69 +0,0 @@
{% if not inmenu %}
{% else %}
{% for groupshared in groups %}
{% if groupshared.pagesshared|length == 1 %}
{% set page = groupshared.pagesshared[0] %}
{% set forcereload=true %}
{% if page.pagecategory.id==1 %}
{% set forcereload=page.toreload %}
{% endif %}
{% set isactive="" %}
{% if entity.id is defined and page.id==entity.id %}
{% set isactive="class='active'" %}
{% endif %}
<li id="menupage-{{page.id}}" {{ isactive }} style="cursor:pointer">
<a data-group="{{groupshared.id}}" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','group','{{forcereload}}','{{groupshared.id}}','{{page.name}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>
{% else %}
<i class="fa fa-users fa-fw"></i>
{% endif %}
&nbsp;{{ groupshared.label }}
{% if page.counterread > 0 %}
<span id="badge-{{groupshared.id}}" class="badge">{{page.counterread}}</span>
{% endif %}
</a>
</li>
{% else %}
<ul id="pagesshared" class="nav navbar-top-links navbar-left">
<li class="dropdown">
<a data-group="{{groupshared.id}}" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-users fa-fw"></i>
&nbsp;{{ groupshared.label }}
<span class="caret"></span>
{% if groupshared.pagesshared[0].counterread > 0 %}
<span id="badge-{{groupshared.id}}" class="badge">{{groupshared.pagesshared[0].counterread}}</span>
{% endif %}
</a>
<ul class="dropdown-menu">
{% for page in groupshared.pagesshared %}
{% set forcereload=true %}
{% if page.pagecategory.id==1 %}
{% set forcereload=page.toreload %}
{% endif %}
{% set isactive="" %}
{% if entity.id is defined and page.id==entity.id %}
{% set isactive="class='active'" %}
{% endif %}
<li id="menupage-{{page.id}}" {{isactive}} style="cursor:pointer">
<a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','group','{{forcereload}}','{{groupshared.id}}','{{page.name}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>
{% endif %}
{{ page.name }}
</a>
</li>
{% endfor %}
</ul>
</li>
</ul>
{% endif %}
{% endfor %}
{% endif %}

View File

@ -1,461 +0,0 @@
{% extends 'base.html.twig' %}
{% block localstyle %}
<style>
body{
overflow-y:hidden
}
#page{
padding:0px !important;
overflow-y:hidden;
}
</Style>
{% endblock %}
{% block menuapp %}
<ul id="menupagesportal" class="navbar-nav">
{% for page in pagesportal %}
<li id="menupage-{{page.id}}" class="menupage nav-item" style="cursor:pointer">
<a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','portal','{{page.pagecategory.id==1?page.toreload:true}}',null,'{{page.name}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-fw"></i>
{% elseif loop.first %}
<i class="fas fa-home fa-fw"></i>
{% else %}
<i class="fas fa-door-closed fa-fw"></i>
{% endif %}
{{ page.name }}
</a>
</li>
{% endfor %}
</ul>
<ul id="menupagesuser" class="navbar-nav">
{% for page in pagesuser %}
<li id="menupage-{{page.id}}" class="menupage nav-item" style="cursor:pointer">
<a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','user','{{page.pagecategory.id==1?page.toreload:true}}',null,'{{page.name}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-fw"></i>
{% else %}
<i class="fas fa-user fa-fw"></i>
{% endif %}
{{ page.name }}
</a>
</li>
{% endfor %}
</ul>
{% if groups|length > 0 and groups|length < 10 %}
<ul id="menupagesgroup" class="navbar-nav">
{% for groupshared in groups %}
{% if groupshared.pagesshared|length > 1 %}
<li id="menugroup-{{groupshared.id}}" class="nav-item menupage dropdown">
<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-users fa-fw"></i>
{{ groupshared.label }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{% endif %}
{% for page in groupshared.pagesshared %}
{% if groupshared.pagesshared|length == 1 %}
<li id="menupage-{{page.id}}" class="menupage nav-item">
{%endif%}
<a id="menupage-{{page.id}}" style="cursor:pointer" class="{{ groupshared.pagesshared|length > 1 ? "menupage dropdown-item" : "" }}" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','group','{{page.pagecategory.id==1?page.toreload:true}}',{{groupshared.id}},'{{page.name}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-fw"></i>
{% else %}
<i class="fa fa-users fa-fw"></i>
{% endif %}
{{ page.name }}
</a>
{% if groupshared.pagesshared|length == 1 %}
</li>
{%endif%}
{% endfor %}
{% if groupshared.pagesshared|length > 1 %}
</div>
</li>
{% endif %}
{% endfor %}
</ul>
{% elseif groups|length > 0 %}
<ul id="menupagesgroup" class="navbar-nav">
<li class="nav-item" style="cursor:pointer">
<a onclick="$('#selmenu').modal('show');">
<i class="fa fa-users fa-fw"></i> Mes Groupes
</a>
</li>
</ul>
{% endif %}
{% endblock %}
{% block menuuser %}
{% 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>
<a id="menushare" style="cursor:pointer;display:none" onclick="sharePage()" title='Partager une page'><i class='fa fa-share-alt fa-fw'></i></a>
<a id="menudelete" style="cursor:pointer;display:none" onclick="deletePage()" title='Supprimer une page'><i class='fa fa-trash fa-fw'></i></a>
<a id="menuwidgetuser" class="btn-modal" style='cursor:pointer' data-modalid='selwidgetuser' title='Ajouter un widget'><i class='fa fa-cubes fa-fw'></i></a></li>
<a id="menuwidgetgroup" class="btn-modal" style='cursor:pointer' data-modalid='selwidgetgroup' title='Ajouter un widget'><i class='fa fa-cubes fa-fw'></i></a></li>
{% endblock %}
{% block body %}
<div id="pagecontainer"></div>
<div id="selmenu" class="modal fade" role="dialog">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div id="mymodalheader" class="modal-header">
<h4 class="modal-title">SELECTIONNER UNE PAGE</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div id="pagesportal" style="display:none">
{% for page in pagesportal %}
{%if loop.first %}
<div class="card mb-3">
<div class="card-header">PAGES PORTAIL</div>
<ul class="list-group list-group-flush">
{%endif%}
<a class="list-group-item" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','portal','{{page.pagecategory.id==1?page.toreload:true}}',null,'{{page.name}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-fw"></i>
{% elseif loop.first %}
<i class="fas fa-home fa-fw"></i>
{% else %}
<i class="fas fa-door-closed fa-fw"></i>
{% endif %}
{{ page.name }}
</a>
{%if loop.last %}
</ul></div>
{%endif%}
{% endfor %}
</div>
<div id="pagesuser" style="display:none">
{% for page in pagesuser %}
{%if loop.first %}
<div class="card mb-3">
<div class="card-header">PAGES PERSONNEL</div>
<ul class="list-group list-group-flush">
{%endif%}
<a class="list-group-item" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','user','{{page.pagecategory.id==1?page.toreload:true}}',null,'{{page.name}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-fw"></i>
{% else %}
<i class="fas fa-user fa-fw"></i>
{% endif %}
{{ page.name }}
</a>
{%if loop.last %}
</ul></div>
{%endif%}
{% endfor %}
</div>
<div id="pagesgroup">
{% for groupshared in groups %}
{%if loop.first %}
<div class="card mb-3">
<div class="card-header">PAGES GROUPE DE TRAVAIL</div>
<ul class="list-group list-group-flush">
{%endif%}
{% for page in groupshared.pagesshared %}
<a class="list-group-item" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','group','{{page.pagecategory.id==1?page.toreload:true}}',{{groupshared.id}},'{{page.name}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-fw"></i>
{% else %}
<i class="fas fa-users fa-fw"></i>
{% endif %}
{{page.name == groupshared.label ? page.name : groupshared.label~" - "~page.name}}
</a>
{% endfor %}
{%if loop.last %}
</ul></div>
{%endif%}
{% endfor %}
</div>
</div>
</div>
</div>
</div>
<div id="selwidgetuser" class="modal fade" role="dialog">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div id="mymodalheader" class="modal-header">
<h4 class="modal-title">SELECTIONNER UN WIDGET</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<table id="dataTablesuser" class="table table-striped table-bordered table-hover" style="width:100%">
<thead>
<tr>
<th class="no-sort" width="80px"></th>
<th width="100px">Nom</th>
<th class="no-sort" width="500px">Description</th>
</tr>
</thead>
<tbody>
{% for widget in widgetsuser %}
<tr>
<td>
<a onClick="selWidget({{ widget.id }},'user')" style="cursor:pointer;">
<img id="widgettype-{{ widget.id }}" class="grid-item-img" height="40" src="{{path('app_minio_image',{file:widget.icon.label}) }}" style="padding:2px">
</a>
</td>
<td>{{ widget.name }}</td>
<td>{{ widget.description }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="selwidgetgroup" class="modal fade" role="dialog">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div id="mymodalheader" class="modal-header">
<h4 class="modal-title">SELECTIONNER UN WIDGET</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<table id="dataTablesgroup" class="table table-striped table-bordered table-hover" style="width:100%">
<thead>
<tr>
<th class="no-sort" width="80px"></th>
<th width="100px">Nom</th>
<th class="no-sort" width="500px">Description</th>
</tr>
</thead>
<tbody>
{% for widget in widgetsgroup %}
<tr>
<td>
<a onClick="selWidget({{ widget.id }},'group')" style="cursor:pointer;">
<img id="widgettype-{{ widget.id }}" class="grid-item-img" height="40" src="{{path('app_minio_image',{file:widget.icon.label}) }}" style="padding:2px">
</a>
</td>
<td>{{ widget.name }}</td>
<td>{{ widget.description }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}
{% block localscript %}
<script>
var idpage;
$('document').ready(function(){
// Afficher la page courrante
{% for page in pagesportal %}
{% if page.id==entity.id %}
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','portal',false,null,'{{page.name}}');
{% endif %}
{% endfor %}
{% for page in pagesuser %}
{% if page.id==entity.id %}
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','user',false,null,'{{page.name}}');
{% endif %}
{% endfor %}
{% for groupshared in groups %}
{% for page in groupshared.pagesshared %}
{% if page.id==entity.id %}
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','group',true,{{groupshared.id}},'{{page.name}}');
{% endif %}
{% endfor %}
{% endfor %}
// Rendre les pages user déplacable
$("#menupagesuser").sortable({
axis: "x",
forcePlaceholderSize: true,
placeholder: "placeholder",
update: function( event, ui ) {
$('#pagesuser li').each(function(order) {
var idpage=$(this).attr('id').replace("menupage-","");
$.ajax({
method: "POST",
url: "{{ path('app_'~access~'_page_user_order') }}",
data: {
id:idpage,
order:order
}
});
});
}
});
// Initialisation du tableau des widgets selectionnable à la création
$('.table').DataTable({
columnDefs: [ { "targets": 'no-sort', "orderable": false }, { "targets": 0, "className": "text-center" } ],
iDisplayLength: 10,
order: [[ 1, "asc" ]],
scrollX: false,
});
});
// Affichage des frames associés aux items de bureau
function showItemframe(id,url,forcereload) {
$(".pageframereload").remove();
$(".pageframe").hide();
// Si force le rechargement et frame existante on la détruit
if(forcereload&&$("#frameitem-"+id).length)
$("#frameitem-"+id).remove();
// Si la frame en cours existe déjà on l'affiche
if($("#frameitem-"+id).length)
$("#frameitem-"+id).show();
// Sinon on la génère
else {
var myclass="";
if(forcereload) myclass="pageframereload";
$("#pagecontainer").append("<iframe onload='this.contentWindow.focus()' id='frameitem-"+id+"' class='pageframe "+myclass+"' src='"+url+"' style='border:none; width:100%'></iframe>");
}
Resize();
}
// Affichages des pages
function showPage(id,catid,canupdate,usage,forcereload,groupid,pagename) {
// Sauvegarder la page en cours
idpage=id;
// Cacher toutes les pages
$(".pageframereload").remove();
$(".pageframe").hide();
$(".dropdown-menu").hide();
// Rendre actif le page en cours dans le menu
$(".menupage").removeClass("active");
$(".dropdown-toggle").removeClass("active");
$("#menupage-"+id).addClass("active");
$("#menugroup-"+groupid).addClass("active");
if(usage=="portal")
var url="{{ path('app_all_page_portal_view',{id:'xx'}) }}";
else if(usage=="user")
var url="{{ path('app_all_page_user_view',{id:'xx'}) }}";
else
var url="{{ path('app_all_page_group_view',{id:'xx'}) }}";
url=url.replace('xx',id);
passurl="{{ path('app_home',{id:'xx'}) }}";
passurl=passurl.replace('xx',id);
history.pushState('data to be passed', 'Title of the page', passurl);
// Si force le rechargement et frame existante on la détruit
if(forcereload&&$("#page-"+id).length)
$("#page-"+id).remove();
// Si la frame en cours existe déjà on l'affiche
if($("#page-"+id).length)
$("#page-"+id).show();
// Sinon on la génère
else {
var myclass="";
if(forcereload) myclass="pageframereload";
$("#pagecontainer").append("<iframe onload='this.contentWindow.focus()' id='page-"+id+"' data-category='"+catid+"' class='pageframe "+myclass+"' src='"+url+"' style='border:none; width:100%'></iframe>");
}
// Cacher les actions possibles sur la page
$("#menuupdate").hide();
$("#menushare").hide();
$("#menudelete").hide();
$("#menuwidgetuser").hide();
$("#menuwidgetgroup").hide();
if(canupdate) {
$("#menuupdate").show();
$("#menudelete").show();
}
// Si page de type widget on affiche la selection des widgets à insérer
if($("#page-"+id).data('category')==2&&canupdate) {
if(usage=="user") $("#menuwidgetuser").show();
if(usage=="group") $("#menuwidgetgroup").show();
}
Resize();
}
function submitPage() {
var url="{{ path('app_'~access~'_page_user_submit') }}";
$(location).attr('href',url);
}
function updatePage() {
if($("#page-"+idpage).length) {
var url="{{ path('app_'~access~'_page_user_update',{id:'xx'}) }}";
url=url.replace('xx',idpage);
$(location).attr('href',url);
}
}
function deletePage() {
if($("#page-"+idpage).length) {
if (confirm('Êtes-vous sûr de vouloir supprimer ?')) {
var url="{{ path('app_'~access~'_page_user_delete',{id:'xx'}) }}";
url=url.replace('xx',idpage);
$(location).attr('href',url);
}
}
}
// Création d'un widget selectionné
function selWidget(idwidgettype,usage) {
var url="{{ path('app_all_pagewidget_widget_sumbit',{idpage:'yy',idwidgettype:'xx',usage:'zz'})}}";
url=url.replace('xx',idwidgettype);
url=url.replace('yy',idpage);
url=url.replace('zz',usage);
$(".modal").modal("hide");
$("#page-"+idpage).attr("src",url);
};
</script>
{% endblock %}

View File

@ -1,88 +0,0 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ form_start(form) }}
<h1>
Nouvelle Page
</h1>
<p>
{{ form_widget(form.submit) }}
{% if access=="admin" %}
<a class="btn btn-secondary" href="{{ path('app_admin_page_portal') }}">Annuler</a>
{% else %}
<a class="btn btn-secondary" href="{{ path('app_home') }}">Annuler</a>
{% endif %}
</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="fa fa-pencil fa-fw"></i> Informations
</div>
<div class="card-body">
{{ form_row(form.name) }}
{{ form_row(form.pagecategory) }}
{{ form_row(form.usage) }}
{% if form.user is defined %}
{{ form_row(form.user) }}
{% endif %}
{{ form_row(form.page) }}
{{ form_row(form.groups) }}
{{ form_row(form.roworder) }}
{{ form_row(form.fonticon) }}
{{ form_row(form.maxwidth) }}
</div>
</div>
{{ form_end(form) }}
{% endblock %}
{% block localscript %}
<script>
$('document').ready(function(){
hideshow();
});
$(document.body).on("change","#page_submit_pagecategory",function(){
hideshow();
});
$(document.body).on("change","#page_submit_usage",function(){
hideshow();
});
function hideshow() {
if($("#page_submit_pagecategory").val()==2)
$("#groupfield_page_submit_page").show();
else {
$("#groupfield_page_submit_page").hide();
}
if($("#page_submit_usage").val()=="group")
$("#groupfield_page_submit_groups").show();
else {
$("#groupfield_page_submit_groups").hide();
}
}
</script>
{% endblock %}

View File

@ -1,72 +0,0 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
{{ form_start(form) }}
<h1 class="page-header">
{% if mode=="update" %}
Modification Page Editeur = {{entity.name}}
{% elseif mode=="submit" %}
Création Page Editeur
{% endif %}
</h1>
<p>
{{ form_widget(form.submit) }}
{% if access=="config" %}
<a class="btn btn-default" href="{{ path('cadoles_portal_config_page_view',{id:entity.id}) }}">Annuler</a>
{% else %}
<a class="btn btn-default" href="{{ path('cadoles_core_home',{id:entity.id}) }}">Annuler</a>
{% endif %}
{% if mode=="update" %}
<a href={{ path('cadoles_portal_'~access~'_page_delete',{'id':entity.id}) }}
class="btn btn-danger pull-right"
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
data-confirm="Êtes-vous sûr de vouloir supprimer cette page ?">
Supprimer
</a>
{% endif %}
</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="form-group row clearfix">
{% if form.roles is defined %}
<div class="col-md-8">
{% else %}
<div class="col-md-12">
{% endif %}
{{ form_row(form.name) }}
{{ form_row(form.roworder) }}
{{ form_row(form.fonticon) }}
{{ form_row(form.maxwidth) }}
{{ form_row(form.html) }}
</div>
{% if form.roles is defined %}
<div class="col-md-4">
{{ form_row(form.user) }}
{{ form_row(form.roles) }}
{{ form_row(form.groups) }}
</div>
{% endif %}
</div>
{{ form_end(form) }}
{% endblock %}

View File

@ -1,66 +0,0 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
{{ form_start(form) }}
<h1 class="page-header">
Modification Page {{ entity.pagecategory.name}} = {{entity.name}}
</h1>
<p>
{{ form_widget(form.submit) }}
{% if access=="config" %}
<a class="btn btn-default" href="{{ path('cadoles_portal_config_page_view',{id:entity.id}) }}">Annuler</a>
{% else %}
<a class="btn btn-default" href="{{ path('cadoles_core_home',{id:entity.id}) }}">Annuler</a>
{% endif %}
{% if mode=="update" %}
<a href={{ path('cadoles_portal_'~access~'_page_delete',{'id':entity.id}) }}
class="btn btn-danger pull-right"
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
data-confirm="Êtes-vous sûr de vouloir supprimer cette page ?">
Supprimer
</a>
{% endif %}
</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="form-group row clearfix">
{% if form.roles is defined %}
<div class="col-md-8">
{% else %}
<div class="col-md-12">
{% endif %}
{{ form_row(form.name) }}
{{ form_row(form.roworder) }}
{{ form_row(form.fonticon) }}
</div>
{% if form.roles is defined %}
<div class="col-md-4">
{{ form_row(form.user) }}
{{ form_row(form.roles) }}
{{ form_row(form.groups) }}
</div>
{% endif %}
</div>
{{ form_end(form) }}
{% endblock %}

View File

@ -1,76 +0,0 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
{{ form_start(form) }}
<h1 class="page-header">
{% if mode=="update" %}
Modification Page URL = {{entity.name}}
{% elseif mode=="submit" %}
Création Page URL
{% endif %}
</h1>
<p>
{{ form_widget(form.submit) }}
{% if access=="config" %}
<a class="btn btn-default" href="{{ path('cadoles_portal_config_page_view',{id:entity.id}) }}">Annuler</a>
{% else %}
<a class="btn btn-default" href="{{ path('cadoles_core_home',{id:entity.id}) }}">Annuler</a>
{% endif %}
{% if mode=="update" %}
<a href={{ path('cadoles_portal_'~access~'_page_delete',{'id':entity.id}) }}
class="btn btn-danger pull-right"
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
data-confirm="Êtes-vous sûr de vouloir supprimer cette page ?">
Supprimer
</a>
{% endif %}
</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="form-group row clearfix">
{% if form.roles is defined %}
<div class="col-md-8">
{% else %}
<div class="col-md-12">
{% endif %}
{{ form_row(form.name) }}
{{ form_row(form.url) }}
<em>le mot clé #login# sera remplacé par le login de l'utilisateur</em><br>
<em>Attention certains sites n'acceptent pas d'être encapsulés dans une frame.<br><br></em>
{{ form_row(form.toreload) }}
{{ form_row(form.roworder) }}
{{ form_row(form.fonticon) }}
{{ form_row(form.maxwidth) }}
</div>
{% if form.roles is defined %}
<div class="col-md-4">
{{ form_row(form.user) }}
{{ form_row(form.roles) }}
{{ form_row(form.groups) }}
</div>
{% endif %}
</div>
{{ form_end(form) }}
{% endblock %}

View File

@ -1,552 +0,0 @@
{% extends 'base.html.twig' %}
{% block localstyle %}
<style>
#gridtemplate {
border: 1px solid #cdcdcd;
padding:20px;
margin: 0px;
}
#gridtemplate .row {
height: 500px;
border: 1px solid #cdcdcd;
margin: 0px 0px 20px 0px;
background-color: #c8f7c5;
}
#gridtemplate .rowcontainer {
float:left;
width:90%;
height:80%;
}
#gridtemplate .rowcontainer .row {height:33.333333333333333%; margin:0px}
#gridtemplate .rowcontainer .maxright, #gridtemplate .rowcontainer .maxleft {height:90% !important; width:20% !important; }
#gridtemplate .rowcontainer .rowcontainer {width:60% !important;}
#gridtemplate .rowcontainer .addRow {display:none;}
#gridtemplate .rowcontainer .colcontainer {padding:5px;}
#gridtemplate .addRow {
width: 100%;
height: 10%;
padding: 2px;
max-height: 30px
}
#gridtemplate .delRow {
height:100%;
width: 5%;
background-color: #e74c3c;
color: #fff;
text-align:center;
float: left;
cursor: pointer;
}
#gridtemplate .delRow i {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
#gridtemplate .colcontainer {
width:90%;
height:100% !important;
float:left;
padding:15px;
}
#gridtemplate .colcontainer .col {
border: 1px solid #cdcdcd;
height:100%;
padding: 0px;
background-color:#fff;
}
#gridtemplate .addCol {
height:100%;
width: 5%;
background-color: #2c3e50;
color: #fff;
text-align:center;
float: right;
cursor: pointer;
}
#gridtemplate .addCol i {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
#gridtemplate .colcontainer .col .delCol {
height:10%;
width: 100%;
background-color: #e74c3c;
color: #fff;
text-align:center;
float: right;
cursor: pointer;
}
#gridtemplate .colcontainer .col .delCol i {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
#gridtemplate .colcontainer .col .maxleft {
height:80%;
width: 5%;
background-color: #2c3e50;
color: #fff;
text-align:center;
float: left;
cursor: pointer;
}
#gridtemplate .colcontainer .col .maxleft i {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
#gridtemplate .colcontainer .col .maxright {
height:80%;
width: 5%;
background-color: #2c3e50;
color: #fff;
text-align:center;
float: right;
cursor: pointer;
}
#gridtemplate .colcontainer .col .maxright i {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
</style>
{% endblock %}
{% block body %}
{{ form_start(form) }}
<h1 class="page-header">
{% if mode=="update" %}
{% if usage=="template" %}
Modification Modèle de Page = {{page.name}}
{% else %}
Modification Page Widget = {{page.name}}
{% endif %}
{% elseif mode=="submit" %}
Création Page Widget
{% endif %}
</h1>
<p>
{{ form_widget(form.submit) }}
{% if access=="admin" %}
<a class="btn btn-secondary" href="{{ path('app_'~access~'_page_'~usage~'_view',{id:page.id}) }}">Annuler</a>
{% else %}
<a class="btn btn-secondary" href="{{ path('app_home',{id:page.id}) }}">Annuler</a>
{% endif %}
{% if mode=="update" %}
<a href={{ path('app_'~access~'_page_'~usage~'_delete',{'id':page.id}) }}
class="btn btn-danger float-end"
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
data-confirm="Êtes-vous sûr de vouloir supprimer cette page ?">
Supprimer
</a>
{% endif %}
</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="form-group row clearfix">
{% if form.roles is defined %}
<div class="col-md-8">
{% else %}
<div class="col-md-12">
{% endif %}
<div class="card">
<div class="card-header">
<i class="fa fa-pencil fa-fw"></i> Informations
</div>
<div class="card-body">
{{ form_row(form.name) }}
{{ form_row(form.roworder) }}
{{ form_row(form.fonticon) }}
{{ form_row(form.maxwidth) }}
{{ form_row(form.template) }}
</div>
</div>
</div>
{% if form.roles is defined %}
<div class="col-md-4">
<div class="card">
<div class="card-header">
<i class="fa fa-link fa-fw"></i> Affectations
</div>
<div class="card-body">
{{ form_row(form.user) }}
{{ form_row(form.roles) }}
{{ form_row(form.groups) }}
</div>
</div>
</div>
{% endif %}
</div>
<div class="card mt-3">
<div class="card-header">
<i class="fas fa-table-columns fa-fw"></i> Template de Mise en Page
</div>
<div class="card-body">
<div id="gridtemplate">
</div>
</div>
{{ form_end(form) }}
{% endblock %}
{% block localscript %}
<script>
var defcol = [];
defcol[1] = ["col-12"];
defcol[2] = ["col-6","col-6"];
defcol[3] = ["col-4","col-4","col-4"];
defcol[4] = ["col-3","col-3","col-3","col-3"];
defcol[5] = ["col-4","col-2","col-2","col-2","col-2"];
defcol[6] = ["col-2","col-2","col-2","col-2","col-2","col-2"];
var defaultcol = ""
defaultcol+="<div class='delCol'>";
defaultcol+="<i class='fa fa-trash'></i>";
defaultcol+="</div>";
defaultcol+="<div class='maxleft'>";
defaultcol+="<i class='fa fa-chevron-left'></i>";
defaultcol+="</div>";
defaultcol+="<div class='rowcontainer'>";
defaultcol+="</div>";
defaultcol+="<div class='maxright'>";
defaultcol+="<i class='fa fa-chevron-right'></i>";
defaultcol+="</div>";
defaultcol+="<a class='addRow btn btn-info'>Ajouter une Ligne</a>";
$('document').ready(function(){
// Template de base
if($(page_update_widget_template).val()=="") {
myrow ="<div class='row'>";
myrow+="<div class='delRow'><i class='fa fa-trash'></i></div>";
myrow+="<div class='row colcontainer'>";
myrow+="<div class='col col-4'>"+defaultcol+"</div>"
myrow+="<div class='col col-4'>"+defaultcol+"</div>"
myrow+="<div class='col col-4'>"+defaultcol+"</div>"
myrow+="</div>"
myrow+="<div class='addCol'><i class='fa fa-plus'></i></div>";
myrow+="</div>"
$("#gridtemplate").append(myrow);
}
// Interprétation du template sauvegardé
else {
var json = jQuery.parseJSON($(page_update_widget_template).val());
var mygrid="";
$.each(json.rows, function( index, rownv01 ) {
mygrid+="<div class='row'>";
mygrid+="<div class='delRow'><i class='fa fa-trash'></i></div>";
mygrid+="<div class='row colcontainer'>";
$.each(rownv01.cols, function( index, colnv01 ) {
mygrid+="<div class='col col-"+colnv01.size+"'>";
mygrid+="<div class='delCol'>";
mygrid+="<i class='fa fa-trash'></i>";
mygrid+="</div>";
mygrid+="<div class='maxleft'>";
mygrid+="<i class='fa fa-chevron-left'></i>";
mygrid+="</div>";
mygrid+="<div class='rowcontainer'>";
$.each(colnv01.rows, function( index, rownv02 ) {
mygrid+="<div class='row'>";
mygrid+="<div class='delRow'><i class='fa fa-trash'></i></div>";
mygrid+="<div class='row colcontainer'>";
$.each(rownv02.cols, function( index, colnv02 ) {
mygrid+="<div class='col col-"+colnv02.size+"'>"+defaultcol+"</div>";
});
mygrid+="</div>";
mygrid+="<div class='addCol'><i class='fa fa-plus'></i></div>";
mygrid+="</div>";
});
mygrid+="</div>";
mygrid+="<div class='maxright'>";
mygrid+="<i class='fa fa-chevron-right'></i>";
mygrid+="</div>";
mygrid+="<a class='addRow btn btn-info'>Ajouter une Ligne</a>";
mygrid+="</div>";
});
mygrid+="</div>";
mygrid+="<div class='addCol'><i class='fa fa-plus'></i></div>";
mygrid+="</div>";
});
$("#gridtemplate").append(mygrid);
}
$("#gridtemplate").append("<a class='addRow btn btn-info'>Ajouter une Ligne</a>");
// Ajout d'une ligne
$(document).on('click','.addRow', function(event){
lastrow=$(this).parent().children('.row').last();
parentid=$(this).parent().attr("id");
if(parentid=="gridtemplate") {
nbrow=$(this).parent().children('.row').length;
nbmax=5;
}
else {
nbrow=$(this).parent().children(".rowcontainer").children('.row').length;
nbmax=4;
}
nbrow++;
if(nbrow==nbmax)
alert("Vous ne pouvez pas insérer plus de "+(nbmax-1)+" lignes");
else {
myrow ="<div class='row'>";
myrow+="<div class='delRow'><i class='fa fa-trash'></i></div>";
myrow+="<div class='row colcontainer'>";
myrow+="<div class='col col-4'>"+defaultcol+"</div>"
myrow+="<div class='col col-4'>"+defaultcol+"</div>"
myrow+="<div class='col col-4'>"+defaultcol+"</div>"
myrow+="</div>"
myrow+="<div class='addCol'><i class='fa fa-plus'></i></div>";
myrow+="</div>"
if(lastrow.length)
lastrow.after(myrow);
else
$(this).parent().children(".rowcontainer").append(myrow);
}
});
// Suppression d'une ligne
$(document).on('click','.delRow', function(event){
// On compte le nombre de row de ce niveau et on bloque s'il en reste plus qu'une et que l'on est sur le premier niveau de ligne
if($( this ).parent().parent().children(".row").length==1 && $( this ).parent().parent().attr("id")=="gridtemplate")
{
alert("Votre page doit avoir au minimum une ligne");
}
// Si ce n'est pas le cas on la supprime
else {
$( this ).parent().remove();
}
});
// Ajout d'une Colonne
$(document).on('click','.addCol', function(event){
// On récupère la ligne
row=$( this ).parent();
colcontainer=row.children(".colcontainer");
// On compte le nombre de colonne
nbcol=colcontainer.children(".col").length;
nbcol++;
if(nbcol>6) {
alert("Votre page ne peut avoir plus de 6 colonnes");
}
else {
// Pour chaque colonne on applique la répartition de taille en fonction du nombre de colonne total
colcontainer.children('.col').each(function( index ) {
$(this).removeClass();
$(this).attr("class","col "+defcol[nbcol][index]);
});
// On ajoute une colonne après la derniere colonne de la ligne
lastcol=colcontainer.children('.col').last();
lastcol.after("<div class='col "+defcol[nbcol][nbcol-1]+"'>"+defaultcol+"</div>");
}
});
// Suppression d'une Colonne
$(document).on('click','.delCol', function(event){
// On récupère la colonne
col=$( this ).parent();
colcontainer=col.parent();
// On compte le nombre de colonne
nbcol=colcontainer.children(".col").length;
nbcol--;
if(nbcol<1) {
alert("Au minimum 1 colonne");
}
else {
// On détruit la colonne
col.remove();
// Pour chaque colonne on applique la répartition de taille en fonction du nombre de colonne total
colcontainer.children('.col').each(function( index ) {
$(this).removeClass();
$(this).attr("class","col "+defcol[nbcol][index]);
});
}
});
// Agrandissement colonne sur la droite
$(document).on('click','.maxright', function(event){
// On récupère la colonne
col=$( this ).parent();
colcontainer=col.parent();
// On recherche la colonne suivante
colnext=col.next();
if(colnext.length) {
// uniquement si taille de la colonne suivant n'est pas col-1
if(colnext.attr("class")!="col col-1") {
// On récupére la taille de la colonne suivante et en cours
taillenext=parseInt(colnext.attr("class").replace("col-","").replace("col ",""));
taille=parseInt(col.attr("class").replace("col-","").replace("col ",""));
// On applique la nouvelle taille à la colonne en cours
col.removeClass();
col.attr("class","col col-"+(taille+1));
// On applique la nouvelle taille à la colonne suivante
colnext.removeClass();
colnext.attr("class","col col-"+(taillenext-1));
}
}
});
// Agrandissement colonne sur la gauche
$(document).on('click','.maxleft', function(event){
console.log("here");
// On récupère la colonne
col=$( this ).parent();
colcontainer=col.parent();
// On recherche la colonne suivante
colprev=col.prev();
if(colprev.length) {
// uniquement si taille de la colonne précédente n'est pas col-1
if(colprev.attr("class")!="col col-1") {
console.log(colprev.attr("class"));
// On récupére la taille de la colonne précédente et en cours
tailleprev=parseInt(colprev.attr("class").replace("col-","").replace("col ",""));
taille=parseInt(col.attr("class").replace("col-","").replace("col ",""));
console.log(taille);
// On applique la nouvelle taille à la colonne en cours
col.removeClass();
col.attr("class","col col-"+(taille+1));
// On applique la nouvelle taille à la colonne suivante
colprev.removeClass();
colprev.attr("class","col col-"+(tailleprev-1));
}
}
});
// Sur validation formulaire
$( "form" ).submit(function( event ) {
//event.preventDefault();
template='{"rows":[';
// Pour chaque ligne de niveau 01 de la grille
nbrownv01=$("#gridtemplate").children('.row').length;
$("#gridtemplate").children('.row').each(function( index ) {
template+='{';
template+='"id":'+index+',';
// Pour chaque colonne de la ligne de niveau 01
nbcolnv01=$(this).children('.colcontainer').children('.col').length;
template+='"cols":[';
$(this).children('.colcontainer').children('.col').each(function( index ) {
template+='{';
template+='"id":'+index+',';
template+='"size": '+parseInt($(this).attr("class").replace("col-","").replace("col ",""))+',';
// Pour chaque ligne de niveau 02
template+='"rows":[';
nbrownv02=$(this).children('.rowcontainer').children('.row').length;
$(this).children('.rowcontainer').children('.row').each(function( index ) {
template+='{';
template+='"id":'+index+',';
nbcolnv02=$(this).children('.colcontainer').children('.col').length;
template+='"cols":[';
$(this).children('.colcontainer').children('.col').each(function( index ) {
template+='{';
template+='"id":'+index+',';
template+='"size": '+parseInt($(this).attr("class").replace("col-","").replace("col ",""));
template+='}';
if(index+1<nbcolnv02) template+=',';
});
template+=']';
template+='}';
if(index+1<nbrownv02) template+=',';
});
template+=']';
template+='}';
if(index+1<nbcolnv01) template+=',';
});
template+=']';
template+='}';
if(index+1<nbrownv01) template+=',';
});
template+=']}';
$("#page_update_widget_template").val(template);
});
});
</script>
{% endblock %}

View File

@ -1,23 +0,0 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
{% if access=="config" %}
<div class="pagemenu">
<a href="{{ path('cadoles_portal_config_page_view', {id:entity.id})}}">{{ entity.name }}</a>
<a href='{{ path('cadoles_portal_config_page_update', {id:entity.id}) }}' title='Modifier la page'><i class='fa fa-cog fa-fw'></i></a>
<a href='{{ path('cadoles_portal_config_page_delete', { id: entity.id }) }}' data-method='delete' data-confirm='Êtes-vous sûr de vouloir supprimer ?' title='Supprimer la page'><i class='fa fa-trash fa-fw'></i></a>
</div>
{% endif %}
<div style="{% if entity.maxwidth>0%} max-width:{{ entity.maxwidth }}px; margin:auto; {% else %} margin: 30px 0px; {% endif %}">
{{ entity.html | raw }}
</div>
{% endblock %}
{% block localjavascript %}
$('document').ready(function(){
});
{% endblock %}

View File

@ -1,59 +0,0 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block localstyle %}
#pageiframe { margin: 0px -30px;}
{% endblock %}
{% if app.user %}
{% set username = app.user.username %}
{% else %}
{% set username = "" %}
{% endif %}
{% block pagewrapper %}
{% if access=="config" %}
<div class="pagemenu">
<a href="{{ path('cadoles_portal_config_page_view', {id:entity.id})}}">{{ entity.name }}</a>
<a href='{{ path('cadoles_portal_config_page_update', {id:entity.id}) }}' title='Modifier la page'><i class='fa fa-cog fa-fw'></i></a>
<a href='{{ path('cadoles_portal_config_page_delete', { id: entity.id }) }}' data-method='delete' data-confirm='Êtes-vous sûr de vouloir supprimer ?' title='Supprimer la page'><i class='fa fa-trash fa-fw'></i></a>
</div>
{% endif %}
<div id="pageiframe" style="{% if entity.maxwidth>0%} max-width:{{ entity.maxwidth }}px; margin:auto; {% endif %}">
<iframe onload='this.contentWindow.focus()' src="{{entity.url|replace({'#login#': username})}}" id="frameContent" style="border:none;" width="100%" height="100%"></iframe>
</div>
{% endblock %}
{% block localjavascript %}
$(window).resize(function() {
resizeFrame();
});
$('document').ready(function(){
resizeFrame();
});
function resizeFrame() {
$("body").css("overflow-y","hidden");
$(".col-md-10").css("padding","0");
var iFrame = document.getElementById('frameContent');
var heightbody = $('html').height();
var heightheader = $('.header').height();
if($('.pagemenu').css("display")=="none")
var heightmenu = 0;
else
var heightmenu = $('.pagemenu').height();
var heightframe = heightbody-heightheader-heightmenu;
if($("#frameContent").length>0) {
$("#frameContent").height(heightframe);
}
}
{% endblock %}

View File

@ -1,598 +0,0 @@
{% extends 'base.html.twig' %}
{% block menuuser %}
{% if access=="admin" %}
<li><a href='{{ path('app_'~access~'_page_'~usage~'_update', {id:page.id}) }}' title='Modifier la page'><i class='fa fa-cog fa-fw'></i></a></li>
<li><a href='{{ path('app_'~access~'_page_'~usage~'_delete', { id: page.id }) }}' data-method='delete' data-confirm='Êtes-vous sûr de vouloir supprimer ?' title='Supprimer la page'><i class='fa fa-trash fa-fw'></i></a></li>
<li><a class="btn-modal" style='cursor:pointer' data-modalid='selwidget' title='Ajouter un widget'><i class='fa fa-cubes fa-fw'></i></a></li>
{% endif %}
{% endblock %}
{% block body %}
<div id="widget-container" style="{% if page.maxwidth>0%} max-width:{{ page.maxwidth }}px; margin:auto; {% endif %}">
</div>
<div id="tolocalize" style="display:none">
{% for pagewidget in page.pagewidgets %}
<a href="{{ url(pagewidget.widget.routeview|replace({'_admin_':'_'~access~'_'}),{id:pagewidget.id,usage:usage}) }}"></a>
{{ render(url(pagewidget.widget.routeview|replace({'_admin_':'_'~access~'_'}),{id:pagewidget.id,usage:usage})) }}
{% endfor %}
</div>
{% if access!="all" %}
<div id="selwidget" class="modal fade" role="dialog">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div id="mymodalheader" class="modal-header">
<h4 class="modal-title">SELECTIONNER UN WIDGET</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<a onclick="$('#selwidget').modal('hide');" class="btn btn-secondary mb-3">
Annuler
</a>
<table id="dataTables" class="table table-striped table-bordered table-hover" style="width:100%">
<thead>
<tr>
<th class="no-sort" width="80px"></th>
<th width="100px">Nom</th>
<th class="no-sort" width="500px">Description</th>
</tr>
</thead>
<tbody>
{% for widget in widgets %}
<tr>
<td>
<a onClick="selWidget({{ widget.id }})" style="cursor:pointer;">
<img id="widgettype-{{ widget.id }}" class="grid-item-img" height="40" src="{{path('app_minio_image',{file:widget.icon.label}) }}" style="padding:2px">
</a>
</td>
<td>{{ widget.name }}</td>
<td>{{ widget.description }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block localscript %}
<script>
// Ajustement des frames
$(window).resize(function() {
AjustFrame();
Masonry();
});
$('document').ready(function(){
// Initialisation du tableau des widgets selectionnable à la création
$('#dataTables').DataTable({
columnDefs: [ { "targets": 'no-sort', "orderable": false }, { "targets": 0, "className": "text-center" } ],
iDisplayLength: 10,
order: [[ 1, "asc" ]],
//responsive: false,
scrollX: false,
});
// Création de la grille des widgets
var template = '{{ page.template | raw }}';
// Template de base
if(template=="") {
myrow ="<div>";
myrow+="<div class='row colcontainer no-gutters'>";
myrow+="<div id='R1C1' class='col col-lg-4'></div>"
myrow+="<div id='R1C2' class='col col-lg-4'></div>"
myrow+="<div id='R1C3' class='col col-lg-4'></div>"
myrow+="</div>"
$("#widget-container").append(myrow);
}
// Interprétation du template sauvegardé
else {
var json = jQuery.parseJSON(template);
var mygrid="";
var row01=0;
$.each(json.rows, function( index, rownv01 ) {
row01++;
col01=0;
mygrid+="<div>";
mygrid+="<div class='row colcontainer no-gutters'>";
$.each(rownv01.cols, function( index, colnv01 ) {
col01++;
var row02=0;
mygrid+="<div id='R"+row01+"C"+col01+"' class='mycol col-lg-"+colnv01.size+"'>";
mygrid+="<div class='rowcontainer'>";
$.each(colnv01.rows, function( index, rownv02 ) {
row02++;
col02=0;
mygrid+="<div>";
mygrid+="<div class='row colcontainer no-gutters'>";
$.each(rownv02.cols, function( index, colnv02 ) {
col02++;
mygrid+="<div id='R"+row01+"C"+col01+"R"+row02+"C"+col02+"' class='mycol col-lg-"+colnv02.size+"'></div>";
});
mygrid+="</div>";
mygrid+="</div>";
});
mygrid+="</div>";
mygrid+="</div>";
});
mygrid+="</div>";
mygrid+="</div>";
});
$("#widget-container").append(mygrid);
}
// On déplace les widgets à leur emplacement
$("#tolocalize").children(".widget").each(function( element ) {
if($('#'+$(this).attr("loc")).length)
$(this).appendTo('#'+$(this).attr("loc"));
else
$(this).appendTo('#R1C1');
});
// On ajoute un widget vide à chaque colonne
$("#widget-container .col").each(function(element) {
$("<div class='widgetempty'>&nbsp;</div>").appendTo($(this));
});
{% if canupdate %}
// Mettre une taille mini de colonne sinon on ne pourra pas déplacer le widget dans la colonne
$(".colcontainer .col").css("min-height","80px");
// Rendre les widgets déplacable
$("#widget-container .mycol").sortable({
connectWith: "#widget-container .mycol",
handle: '.widget-sortable',
placeholder: "widgetplaceholder",
tolerance: "pointer",
cursor: "move",
opacity: 0.6,
start: function( event, ui ) {
ui.placeholder.css("height",ui.item.height());
$(".widgetbody").hide();
$(".colcontainer .mycol").css("border","1px solid #cdcdcd");
//$(".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("min-height","");
},
update: updateLocalisation
});
{% endif %}
// Sur le click des titres de widgets ouvrir / fermer le widget
$( ".widget-header .widget-title" ).click(function() {
showhideWidget(this);
});
$( ".widget-header .widget-logo" ).click(function() {
showhideWidget(this);
});
// 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() {
$('.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() {
if($(this).find(".widget-menu").length) {
$(this).find(".widget-menu").show();
}
});
$( ".widget" ).mouseleave(function() {
$(this).find(".widget-menu").hide();
});
function showhideWidget(elem) {
widget=$(elem).parent().parent();
idwidget= widget.data("id");
if(widget.children(".widget-body").css("display")=='block')
value=false;
else
value=true;
{% if app.user %}
$.ajax({
method: "POST",
url: "{{ path('app_all_preference') }}",
data: {
id:idwidget,
key:'widgetshowhide',
value:value
},
success: function(idbookmark) {
// on récupère le parent widget conteneur
widget=$(elem).parent().parent();
widget.find(".widget-body" ).toggle();
}
});
{% endif %}
}
// Modification de la localisation d'un widget
function updateLocalisation() {
$('.colcontainer .mycol').each(function(index) {
var idloc=$(this).attr('id');
$(this).children(".widget").each(function(order){
var idwidget=$(this).data('id');
$.ajax({
method: "POST",
url: "{{ path('app_'~access~'_pagewidget_order') }}",
data: {
idwidget:idwidget,
order:order,
idloc:idloc
}
});
});
});
// On remasone
Masonry();
}
// Création d'un widget selectionné
function selWidget(idwidgettype) {
var url="{{ path('app_'~access~'_pagewidget_widget_sumbit',{idpage:page.id,idwidgettype:'xx',usage:usage})}}";
url=url.replace('xx',idwidgettype);
$(location).attr('href', url);
};
// Modifciation d'un widget
function modWidget(idwidget) {
var url="{{ path('app_'~access~'_pagewidget_widget_update',{idpage:page.id,idwidget:'xx',usage:usage})}}";
url=url.replace('xx',idwidget);
url=url.replace(/&amp;/g,"&");
$(location).attr('href', url);
}
// Suppression d'un widget
function delWidget(idwidget) {
var txt;
var r = confirm("ATTENTION\nConfirmez-vous la suppression de ce widget ?\n\nL'ensemble du contenu sera définitivement perdu !!");
if (r == true) {
url="{{ path('app_'~access~'_pagewidget_delete',{idwidget:'xx'}) }}";
url=url.replace('xx',idwidget);
$.ajax({
method: "POST",
url: url,
});
$(".widget[data-id="+idwidget+"]").remove();
}
}
// Changer widget
function changeWidget(idwidget,key,value) {
{% if app.user %}
if(key=="modedesktop") {
value=value+1;
if(value==5) value=0;
}
$.ajax({
method: "POST",
url: "{{ path('app_all_preference') }}",
data: {
id:idwidget,
key:key,
value:value
},
success: function() {
location.reload();
}
});
{% endif %}
}
// Ajout d'un bookmark
function addBookmark(idwidget,touser) {
var url="{{ path('app_'~access~'_bookmark_submit',{idpage:page.id,idwidget:'yy',touser:'zz',usage:usage})}}";
url=url.replace('yy',idwidget);
url=url.replace('zz',touser);
url=url.replace(/&amp;/g,"&");
$(location).attr('href', url);
}
// Modifciation d'un bookmark
function modBookmark(idbookmark,idwidget,touser) {
var url="{{ path('app_'~access~'_bookmark_update',{id:'xx',idpage:page.id,idwidget:'yy',touser:'zz',usage:usage})}}";
url=url.replace('xx',idbookmark);
url=url.replace('yy',idwidget);
url=url.replace('zz',touser);
url=url.replace(/&amp;/g,"&");
$(location).attr('href', url);
}
// Ajouter un item aux bookmark
function heartBookmark(iditem) {
var idbookmark;
$.ajax({
method: "POST",
url: "{{ path('app_'~access~'_bookmark_heart') }}",
data: {
iditem:iditem
},
success: function(idbookmark) {
location.reload();
}
});
}
// Supprimer un bookmark
function delBookmark(idbookmark,idwidget,touser) {
if (confirm('Êtes-vous sûr de vouloir supprimer ce favoris ?')) {
var url="{{ path('app_'~access~'_bookmark_delete',{id:'xx',idpage:page.id,idwidget:'yy',touser:'zz',usage:usage})}}";
url=url.replace('xx',idbookmark);
url=url.replace('yy',idwidget);
url=url.replace('zz',touser);
url=url.replace(/&amp;/g,"&");
$.ajax({
method: "POST",
url: url,
success: function(idbookmark) {
location.reload();
}
});
}
}
// 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(/&amp;/g,"&");
$("#mymodallarge .modal-title").text("Téléchargement");
$("#mymodallarge iframe").attr("src",url);
$("#mymodallarge").modal("show");
}
// Supprimer un fichier
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:url,
data: {
directory:directory,
filename:filename
},
success: function() {
location.reload();
}
});
}
}
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(/&amp;/g,"&");
$(location).attr('href', url);
}
// Liste des slides
function listSlide(idwidget) {
var url="{{ path('app_'~access~'_pagewidgetslide_list',{idwidget:'xx',usage:usage})}}";
url=url.replace('xx',idwidget);
url=url.replace(/&amp;/g,"&");
$(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(/&amp;/g,"&");
$(location).attr('href', url);
}
// Ajustement des frames
function AjustFrame() {
if($(".itemframe").length>0) {
$(".itemframe").css("height",$(window).height()-$(".header").height());
}
}
// Affichage des frames associés aux items de bureau
function showItemframe(id,url,forcereload) {
{% if access=="all" %}
parent.showItemframe(id,url,forcereload);
{% else %}
$("#page").hide();
$("body").css("overflow-y","hidden");
if($("#itemframe-"+id).length) {
if(forcereload) {
$("#itemframe-"+id).attr("src",url);
}
$("#itemframe-"+id).show();
}
else {
$("#page").before("<iframe id='itemframe-"+id+"' class='itemframe' src='"+url+"'></iframe>");
}
AjustFrame();
{% endif %}
}
// Affichage des items d'une catégorie
function showItemCat(idwidget, id) {
$(".widget[data-id="+idwidget+"]").find("#itemsearch").val("");
$(".widget[data-id="+idwidget+"]").find(".item").hide();
$(".widget[data-id="+idwidget+"]").find(".itemcategory-title").hide();
if(id=="all") {
$(".widget[data-id="+idwidget+"]").find(".item").show();
$(".widget[data-id="+idwidget+"]").find(".itemcategory-title").show();
}
else if(id=="fav") {
$(".widget[data-id="+idwidget+"]").find(".item[data-idcategory="+id+"]").show();
$(".widget[data-id="+idwidget+"]").find(".itemcategory-title[data-idcategory="+id+"]").show();
}
else {
$(".widget[data-id="+idwidget+"]").find(".item[data-idcategory="+id+"]").show();
$(".widget[data-id="+idwidget+"]").find(".itemcategory-title[data-idcategory="+id+"]").show();
}
}
// Affichage des items d'une catégorie
function searchItem(idwidget, label) {
$(".widget[data-id="+idwidget+"]").find(".bookmark-container").show();
$(".widget[data-id="+idwidget+"]").find(".itemcategory-container").show();
if(label=="") {
$(".widget[data-id="+idwidget+"]").find(".itemcategory-title").show();
$(".widget[data-id="+idwidget+"]").find(".item").show();
}
else {
$(".widget[data-id="+idwidget+"]").find(".itemcategory-title").hide();
$(".widget[data-id="+idwidget+"]").find(".item").hide();
items=$(".widget[data-id="+idwidget+"]").find(".item[data-title*='"+label.toLowerCase()+"']");
if(items.length) {
items.show();
items.each(function() {
category=$(this).data("idcategory");
$(".widget[data-id="+idwidget+"]").find(".itemcategory-title[data-idcategory="+category+"]").show();
});
}
}
}
// Place un message en lu
function hideAlert(id) {
$.ajax({
method: "POST",
url: "{{ path('app_all_alert_read') }}",
data: {
id:id
},
success: function() {
$("#alert-"+id).remove();
}
});
}
</script>
{% endblock %}