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:
@ -5,7 +5,7 @@
|
||||
{# On commence par simplement ajouter le form-group au row de nos formulaires #}
|
||||
{% block form_row -%}
|
||||
{% set attr = attr|merge({'help': (attr.help|default(true)) }) %}
|
||||
<div class="form-group {{ errors|length > 0 ? 'has-error' : '' }} mt-3">
|
||||
<div id="groupfield_{{id}}" class="form-group {{ errors|length > 0 ? 'has-error' : '' }} mt-3">
|
||||
{{- form_label(form) }}
|
||||
{{- form_widget(form) }}
|
||||
{{ form_errors(form) }}
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% block body %}
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="margin-bottom:15px">
|
||||
<a onclick="window.parent.$('#mymodal').modal('hide');" class="btn btn-secondary">Fermer</a>
|
||||
<a onclick="window.parent.$('#mymodallarge').modal('hide');" class="btn btn-secondary">Fermer</a>
|
||||
<a href="{{ path('app_'~access~'_icon',{'inframe':true}) }}" class="btn btn-secondary">Gérer les Icônes</a>
|
||||
</div>
|
||||
|
||||
|
@ -70,14 +70,20 @@
|
||||
'name' : 'PORTAIL',
|
||||
'items' : [
|
||||
{
|
||||
icon: 'fa fa-bell',
|
||||
route: 'app_admin_alert',
|
||||
name: 'Annonces',
|
||||
},
|
||||
icon: 'fa fa-copy fa-fw',
|
||||
route: 'app_admin_pagetemplate',
|
||||
name: 'Modèles de Page',
|
||||
},
|
||||
|
||||
{
|
||||
icon: 'fa fa-desktop',
|
||||
route: 'app_admin_item',
|
||||
name: 'Items',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-bell',
|
||||
route: 'app_admin_alert',
|
||||
name: 'Annonces',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-bug',
|
||||
|
334
templates/Page/application.html.twig
Normal file
334
templates/Page/application.html.twig
Normal file
@ -0,0 +1,334 @@
|
||||
|
||||
{% 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 %}
|
141
templates/Page/default.html.twig
Normal file
141
templates/Page/default.html.twig
Normal file
@ -0,0 +1,141 @@
|
||||
{% 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 %}
|
89
templates/Page/list.html.twig
Normal file
89
templates/Page/list.html.twig
Normal file
@ -0,0 +1,89 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">
|
||||
Gestion des Pages
|
||||
</h1>
|
||||
|
||||
<a href="{{ path('app_config_page_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>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<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>
|
||||
<th>Nom</th>
|
||||
<th class="no-sort">Catégorie</th>
|
||||
<th>Propriétaire</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$(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 } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]],
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
"url": "{{ path('app_config_page_ajax_list') }}",
|
||||
"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;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#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");
|
||||
|
||||
});
|
||||
|
||||
{% endblock %}
|
109
templates/Page/menugroupe.html.twig
Normal file
109
templates/Page/menugroupe.html.twig
Normal file
@ -0,0 +1,109 @@
|
||||
{% if not inmenu %}
|
||||
<ul class="list-group" id="listgrouppage">
|
||||
{% for groupshared in groupsshared %}
|
||||
{% 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="active" %}
|
||||
{% endif %}
|
||||
|
||||
<li id="menupage-{{page.id}}" {{ isactive }} class="list-group-item {{isactive}}" onClick="$('#listgrouppage li').removeClass('active'); $(this).addClass('active') " style="cursor:pointer">
|
||||
<a data-group="{{groupshared.id}}" onClick="$('#selgrouppages').modal('hide'); 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 %}
|
||||
{{ page.name }}
|
||||
|
||||
{% if loop.first and page.counterread > 0 %}
|
||||
<span id="badge-{{groupshared.id}}" class="badge">{{page.counterread}}</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
{% if loop.first and groupshared.pagesshared|length > 1 %}
|
||||
<ul class="list-group" style="margin-top:15px">
|
||||
{% endif %}
|
||||
|
||||
{% if groupshared.pagesshared|length > 1 and loop.last %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if loop.last %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{% for groupshared in groupsshared %}
|
||||
{% 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 %}
|
||||
{{ 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>
|
||||
{{ 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 %}
|
334
templates/Page/noportal.html.twig
Normal file
334
templates/Page/noportal.html.twig
Normal file
@ -0,0 +1,334 @@
|
||||
|
||||
{% 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 %}
|
571
templates/Page/pages.html.twig
Normal file
571
templates/Page/pages.html.twig
Normal file
@ -0,0 +1,571 @@
|
||||
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
body{overflow-y:hidden}
|
||||
{% endblock %}
|
||||
|
||||
{% block appmenu %}
|
||||
<ul class="nav navbar-top-links navbar-left">
|
||||
{% for page in pagesadmin %}
|
||||
{% set forcereload=true %}
|
||||
{% if page.pagecategory.id==1 %}
|
||||
{% set forcereload=page.toreload %}
|
||||
{% endif %}
|
||||
|
||||
{% set usage="portal" %}
|
||||
{% if loop.first %} {% set usage="accueil" %} {%endif %}
|
||||
|
||||
{% if entity.id is defined and page.id==entity.id %}
|
||||
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer">
|
||||
<a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','{{usage}}','{{forcereload}}',null,'{{page.name}}')">
|
||||
{% if page.fonticon %}
|
||||
<i class="{{ page.fonticon }} fa-faw"></i>
|
||||
{% endif %}
|
||||
{{ page.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li id="menupage-{{page.id}}">
|
||||
<a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','portal','{{forcereload}}',null,'{{page.name}}')">
|
||||
{% if page.fonticon %}
|
||||
<i class="{{ page.fonticon }} fa-faw"></i>
|
||||
{% endif %}
|
||||
{{ page.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<ul id="pagesuser" class="nav navbar-top-links navbar-left">
|
||||
{% for page in pagesuser %}
|
||||
{% set forcereload=true %}
|
||||
{% if page.pagecategory.id==1 %}
|
||||
{% set forcereload=page.toreload %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if entity.id is defined and page.id==entity.id %}
|
||||
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer">
|
||||
<a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','user','{{forcereload}}',null,'{{page.name}}')">
|
||||
{% if page.fonticon %}
|
||||
<i class="{{ page.fonticon }} fa-faw"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-user fa-fw"></i>
|
||||
{% endif %}
|
||||
{{ page.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li id="menupage-{{page.id}}">
|
||||
<a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','user','{{forcereload}}',null,'{{page.name}}')">
|
||||
{% if page.fonticon %}
|
||||
<i class="{{ page.fonticon }} fa-faw"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-user fa-fw"></i>
|
||||
{% endif %}
|
||||
{{ page.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<ul id="pagesgroup" class="nav navbar-top-links navbar-left">
|
||||
|
||||
<!-- On regroupe l'ensemble des pages si plus de x groupes -->
|
||||
{% set nbgroupregrouped=5 %}
|
||||
{% if groupsshared|length > nbgroupregrouped %}
|
||||
<ul id="pagesshared" class="nav navbar-top-links navbar-left">
|
||||
<li>
|
||||
<a id="menugrouppages" style='cursor:pointer' data-toggle='modal' data-target='#selgrouppages'>
|
||||
<i class="fa fa-users fa-fw"></i> Mes Groupes
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{%else%}
|
||||
{% set inmenu=true %}
|
||||
{{ include('@CadolesPortal/Page/menugroupe.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="menupageaction">
|
||||
<a id="menuname" style="cursor:pointer;font-size:80%" href=""></a>
|
||||
|
||||
{% if canadd %}
|
||||
<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="menubookmark" style="cursor:pointer;display:none" onclick="bookmarkPage()" title="Faire de cette page votre page d'accueil"><i class='fa fa-heart fa-fw'></i></a>
|
||||
<a id="menuwidgetuser" style='cursor:pointer;display:none' data-toggle='modal' data-target='#selwidgetuser' title='Ajouter un widget'><i class='fa fa-cubes fa-fw'></i></a>
|
||||
<a id="menuwidgetgroup" style='cursor:pointer;display:none' data-toggle='modal' data-target='#selwidgetgroup' title='Ajouter un widget'><i class='fa fa-cubes fa-fw'></i></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
<div id="pagecontainer" style="margin: 0px -30px;"></div>
|
||||
|
||||
|
||||
{% if activate_widonlyoffice %}
|
||||
<iframe src="{{ widonlyoffice_url }}/sso/login" style="display:none"></iframe>
|
||||
{% endif %}
|
||||
|
||||
{% set nbgroupregrouped=5 %}
|
||||
{% if groupsshared|length > nbgroupregrouped %}
|
||||
<div id="selgrouppages" class="modal fade bs-item-modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">MES GROUPES</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<a onclick="$('#selgrouppages').modal('hide');" class="btn btn-default" style="margin-bottom:15px">
|
||||
Annuler
|
||||
</a>
|
||||
|
||||
{% set inmenu=false %}
|
||||
{{ include('@CadolesPortal/Page/menugroupe.html.twig') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%endif%}
|
||||
|
||||
<div id="selwidgetuser" class="modal fade bs-item-modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">SELECTIONNER UN WIDGET</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-group row clearfix">
|
||||
<div class="col-md-12" style="margin-bottom:15px">
|
||||
<a onclick="$('#selwidgetuser').modal('hide');" class="btn btn-default">
|
||||
Annuler
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="dataTable_wrapper col-md-12">
|
||||
<table id="dataTables" class="table table-bordered table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="100px">#</th>
|
||||
<th>Nom</th>
|
||||
<th class="no-sort">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for widget in widgetsuser %}
|
||||
<tr>
|
||||
<td>
|
||||
<a onClick="selWidget({{ widget.id }})" style="cursor:pointer;">
|
||||
<img id="widgettype-{{ widget.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ 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>
|
||||
</div>
|
||||
|
||||
<div id="selwidgetgroup" class="modal fade bs-item-modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">SELECTIONNER UN WIDGET</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-group row clearfix">
|
||||
<div class="col-md-12" style="margin-bottom:15px">
|
||||
<a onclick="$('#selwidgetgroup').modal('hide');" class="btn btn-default">
|
||||
Annuler
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="dataTable_wrapper col-md-12">
|
||||
<table id="dataTables" class="table table-bordered table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="100px">#</th>
|
||||
<th>Nom</th>
|
||||
<th class="no-sort">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for widget in widgetsgroup %}
|
||||
<tr>
|
||||
<td>
|
||||
<a onClick="selWidget({{ widget.id }})" style="cursor:pointer;">
|
||||
<img id="widgettype-{{ widget.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ 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>
|
||||
</div>
|
||||
|
||||
{%if app.user %}
|
||||
<a id="refreshcounter" data-event=""></a>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localexternalscript %}
|
||||
{% if app.user %}
|
||||
<script src="/{{alias}}/bundles/goswebsocket/js/vendor/autobahn.min.js"></script>
|
||||
<script src="/{{alias}}/bundles/goswebsocket/js/gos_web_socket_client.js"></script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
var idpage;
|
||||
pagebookmark="{{app.session.get("pagebookmark")}}";
|
||||
|
||||
$('document').ready(function(){
|
||||
{% if gotoroute is empty %}
|
||||
{% for page in pagesadmin %}
|
||||
{% if page.id==entity.id %}
|
||||
{% set usage="portal" %}
|
||||
{% if loop.first %} {% set usage="accueil" %} {%endif %}
|
||||
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','{{usage}}',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 groupsshared %}
|
||||
{% 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 %}
|
||||
{% else %}
|
||||
var url="{{ path(gotoroute,{id:gotoid}) }}";
|
||||
showGoto(url);
|
||||
{% endif %}
|
||||
|
||||
// Rendre les pages user déplacable
|
||||
$("#pagesuser").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('cadoles_portal_'~access~'_page_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" } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 10,
|
||||
order: [[ 1, "asc" ]],
|
||||
});
|
||||
|
||||
{% if app.user and app.session.get("timerefreshnotif") > 0%}
|
||||
setInterval(function(){
|
||||
loadmsgCounter()
|
||||
}, {{(app.session.get("timerefreshnotif")*1000)}});
|
||||
{% endif %}
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
resizeFrame();
|
||||
});
|
||||
|
||||
function resizeFrame() {
|
||||
var iFrame = document.getElementById('frameContent');
|
||||
|
||||
var heightbody = $('html').height();
|
||||
|
||||
if($('.header').length)
|
||||
var heightheader = $('.header').height();
|
||||
else
|
||||
var heightheader = $('.navbarsmall').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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Affichage des frames associés aux items de bureau
|
||||
function showFrameitem(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>");
|
||||
}
|
||||
|
||||
resizeFrame();
|
||||
}
|
||||
|
||||
// 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();
|
||||
|
||||
// Rendre actif le page en cours dans le menu
|
||||
$(".navbar-top-links li").removeClass("active");
|
||||
$(".dropdown-toggle").removeClass("dropdownactive");
|
||||
|
||||
$("#menupage-"+id).addClass("active");
|
||||
$('a[data-group="'+groupid+'"][data-toggle="dropdown"]').addClass("dropdownactive");;
|
||||
|
||||
var url="{{ path('cadoles_portal_user_page_view',{id:'xx',usage:'yy','group':'zz'}) }}";
|
||||
url=url.replace('xx',id);
|
||||
url=url.replace('yy',usage);
|
||||
url=url.replace('zz',groupid);
|
||||
|
||||
passurl="{{ path('cadoles_core_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>");
|
||||
}
|
||||
|
||||
// Détruire le badge associé car normalement de fait on a lu les notif
|
||||
if(usage=="group") {
|
||||
$("#badge-"+groupid).remove()
|
||||
}
|
||||
|
||||
// Nom de la page
|
||||
console.log(pagename);
|
||||
$("#menuname").html(pagename);
|
||||
|
||||
// Cacher les actions possibles sur la page
|
||||
$("#menuupdate").hide();
|
||||
$("#menushare").hide();
|
||||
$("#menudelete").hide();
|
||||
$("#menubookmark").hide();
|
||||
$("#menuwidgetuser").hide();
|
||||
$("#menuwidgetgroup").hide();
|
||||
|
||||
if(canupdate) {
|
||||
$("#menuupdate").show();
|
||||
$("#menushare").show();
|
||||
$("#menudelete").show();
|
||||
}
|
||||
|
||||
{% if app.user %}
|
||||
|
||||
if(id==pagebookmark) {
|
||||
$("#menubookmark").css("color","red");
|
||||
$("#menubookmark").attr("title","Ne plus faire de cette page votre page d'accueil")
|
||||
}
|
||||
else {
|
||||
$("#menubookmark").css("color","");
|
||||
$("#menubookmark").attr("title","Faire de cette page votre page d'accueil")
|
||||
}
|
||||
|
||||
$("#menubookmark").show();
|
||||
{% endif %}
|
||||
|
||||
// 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();
|
||||
|
||||
}
|
||||
|
||||
// On resize les frame
|
||||
resizeFrame();
|
||||
|
||||
// Mettre le focus dans la frame
|
||||
//$("#page-"+id).contentWindow.focus();
|
||||
}
|
||||
|
||||
// Affichages des pages
|
||||
function showGoto(url) {
|
||||
$("#pagecontainer").append("<iframe onload='this.contentWindow.focus()' id='goto' class='pageframe pageframereload' src='"+url+"' style='border:none; width:100%'></iframe>");
|
||||
|
||||
// On resize les frame
|
||||
resizeFrame();
|
||||
}
|
||||
|
||||
|
||||
function submitPage() {
|
||||
var url="{{ path('cadoles_portal_'~access~'_page_submit') }}";
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
function updatePage() {
|
||||
if($("#page-"+idpage).length) {
|
||||
var url="{{ path('cadoles_portal_'~access~'_page_update',{id:'xx'}) }}";
|
||||
url=url.replace('xx',idpage);
|
||||
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
}
|
||||
|
||||
function sharePage() {
|
||||
if($("#page-"+idpage).length) {
|
||||
var url="{{ path('cadoles_portal_'~access~'_page_share',{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('cadoles_portal_'~access~'_page_delete',{id:'xx'}) }}";
|
||||
url=url.replace('xx',idpage);
|
||||
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bookmarkPage() {
|
||||
{% if app.user %}
|
||||
if($("#page-"+idpage).length) {
|
||||
if(pagebookmark==idpage)
|
||||
confirmtext="Votre page d'accueil redevient l'accueil général de {{ app.session.get("appname") }}.";
|
||||
else
|
||||
confirmtext="Cette page sera votre page d'acueil à l'ouverture de {{ app.session.get("appname") }}, vous pourrez à tout moment changer de page d'accueil.";
|
||||
|
||||
if (confirm(confirmtext)) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('cadoles_core_user_preference') }}",
|
||||
data: {
|
||||
id:0,
|
||||
key:'pagebookmark',
|
||||
value: idpage
|
||||
},
|
||||
success: function() {
|
||||
if(pagebookmark==idpage) {
|
||||
pagebookmark="";
|
||||
$("#menubookmark").css("color","");
|
||||
$("#menubookmark").attr("title","Faire de cette page votre page d'accueil")
|
||||
}
|
||||
else {
|
||||
pagebookmark=idpage;
|
||||
$("#menubookmark").css("color","red");
|
||||
$("#menubookmark").attr("title","Ne plus faire de cette page votre page d'accueil")
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
// Création d'un widget selectionné
|
||||
function selWidget(idwidgettype) {
|
||||
var url="{{ path('cadoles_portal_user_pagewidget_widget_sumbit',{idpage:'yy',idwidgettype:'xx'})}}";
|
||||
url=url.replace('xx',idwidgettype);
|
||||
url=url.replace('yy',idpage);
|
||||
|
||||
$(location).attr('href', url);
|
||||
};
|
||||
|
||||
function loadmsgCounter() {
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('cadoles_portal_user_page_ajax_msgcounter') }}",
|
||||
success: function(data) {
|
||||
$.each(data, function(group, counter) {
|
||||
menu=$("a[data-group='"+group+"']");
|
||||
if(menu.length) {
|
||||
if(menu.children(".badge").length) {
|
||||
if(counter==0)
|
||||
menu.remove();
|
||||
else
|
||||
menu.children(".badge").html(counter);
|
||||
}
|
||||
else if(counter>0)
|
||||
menu.append("<span id='badge-"+group+"' class='badge'>"+counter+"</span");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
{% endblock %}
|
46
templates/Page/share.html.twig
Normal file
46
templates/Page/share.html.twig
Normal file
@ -0,0 +1,46 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1>
|
||||
Partage Page
|
||||
</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 %}
|
||||
</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="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-pencil fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
86
templates/Page/submit.html.twig
Normal file
86
templates/Page/submit.html.twig
Normal file
@ -0,0 +1,86 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1>
|
||||
Nouvelle Page
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
{% if access=="config" %}
|
||||
<a class="btn btn-default" href="{{ path('cadoles_portal_config_page') }}">Annuler</a>
|
||||
{% else %}
|
||||
<a class="btn btn-default" href="{{ path('cadoles_core_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="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-pencil fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.pagecategory) }}
|
||||
{{ form_row(form.usage) }}
|
||||
{% if form.user is defined %}
|
||||
{{ form_row(form.user) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="pagegroup">{{ form_row(form.page) }}</div>
|
||||
<div id="groupworkgroup">{{ form_row(form.groups) }}</div>
|
||||
{{ form_row(form.roworder) }}
|
||||
{{ form_row(form.fonticon) }}
|
||||
{{ form_row(form.maxwidth) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$('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)
|
||||
$("#pagegroup").show();
|
||||
else {
|
||||
$("#pagegroup").hide();
|
||||
}
|
||||
|
||||
if($("#page_submit_usage").val()=="group")
|
||||
$("#groupworkgroup").show();
|
||||
else {
|
||||
$("#groupworkgroup").hide();
|
||||
}
|
||||
}
|
||||
|
||||
{% endblock %}
|
72
templates/Page/updateeditor.html.twig
Normal file
72
templates/Page/updateeditor.html.twig
Normal file
@ -0,0 +1,72 @@
|
||||
{% 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 %}
|
66
templates/Page/updatetool.html.twig
Normal file
66
templates/Page/updatetool.html.twig
Normal file
@ -0,0 +1,66 @@
|
||||
{% 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 %}
|
76
templates/Page/updateurl.html.twig
Normal file
76
templates/Page/updateurl.html.twig
Normal file
@ -0,0 +1,76 @@
|
||||
{% 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 %}
|
543
templates/Page/updatewidget.html.twig
Normal file
543
templates/Page/updatewidget.html.twig
Normal file
@ -0,0 +1,543 @@
|
||||
{% 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" %}
|
||||
Modification Page Widget = {{page.name}}
|
||||
{% elseif mode=="updatetemplate" %}
|
||||
Modification Modèle de Page = {{page.name}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Page Widget
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
{% if access=="config" %}
|
||||
{% if mode=="updatetemplate" %}
|
||||
<a class="btn btn-secondary" href="{{ path('app_config_pagetemplate_view',{id:page.id}) }}">Annuler</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href="{{ path('app_config_page_view',{id:page.id}) }}">Annuler</a>
|
||||
{% endif %}
|
||||
{% 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_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 cette page ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if mode=="updatetemplate" %}
|
||||
<a href={{ path('app_'~access~'_pagetemplate_delete',{'id':page.id}) }}
|
||||
class="btn btn-danger pull-right"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer ce modèle ?">
|
||||
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.template) }}
|
||||
</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>
|
||||
|
||||
<h3>Template de Mise en Page</h3>
|
||||
<div id="gridtemplate">
|
||||
</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 %}
|
23
templates/Page/vieweditor.html.twig
Normal file
23
templates/Page/vieweditor.html.twig
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
{% 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 %}
|
59
templates/Page/viewurl.html.twig
Normal file
59
templates/Page/viewurl.html.twig
Normal file
@ -0,0 +1,59 @@
|
||||
|
||||
{% 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 %}
|
563
templates/Page/viewwidget.html.twig
Normal file
563
templates/Page/viewwidget.html.twig
Normal file
@ -0,0 +1,563 @@
|
||||
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
{% if look=="list" %}
|
||||
#R1C1:first-child {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.widget-mini .logo {
|
||||
background-color: {{app.session.get('colorbgbodydark')}};
|
||||
padding: 3px;
|
||||
border-radius: 100%;
|
||||
}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block menuuser %}
|
||||
{% if access=="admin" %}
|
||||
{% set template="" %}
|
||||
{% if mode=="viewtemplate" %}
|
||||
{% set template="template" %}
|
||||
{% endif %}
|
||||
|
||||
<li><a href="{{ path('app_'~access~'_page'~template~'_view', {id:page.id})}}">{{ page.name }}</a></li>
|
||||
<li><a href='{{ path('app_'~access~'_page'~template~'_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'~template~'_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,by:mode,usage:usage,group:group,look:look,selwidget:selwidget}) }}"></a>
|
||||
{{ render(url(pagewidget.widget.routeview|replace({'_admin_':'_'~access~'_'}),{id:pagewidget.id,by:mode,usage:usage,group:group,look:look,selwidget:selwidget})) }}
|
||||
{% 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>
|
||||
var optiongrid={columnWidth: '.grid-sizer',itemSelector: '.grid-item', gutter: '.grid-gutter-sizer'};
|
||||
|
||||
$('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,
|
||||
});
|
||||
|
||||
// Ajustement des frames
|
||||
$(window).resize(function() {
|
||||
AjustFrame();
|
||||
});
|
||||
|
||||
|
||||
// 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'> </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");
|
||||
|
||||
// Cursor move sur les widgets header
|
||||
//$(".widgetheader").css("cursor","move");
|
||||
|
||||
// Rendre les widgets déplacable
|
||||
$("#widget-container .mycol").sortable({
|
||||
connectWith: "#widget-container .mycol",
|
||||
handle: '.widgetheader',
|
||||
placeholder: "widget widgetplacehorder",
|
||||
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-bottom","15px");
|
||||
},
|
||||
stop: function( event, ui ) {
|
||||
$(".widgetbody").show();
|
||||
$(".colcontainer .mycol").css("border","none");
|
||||
$(".colcontainer .mycol").css("padding-bottom","");
|
||||
|
||||
// Création des grilles d'items
|
||||
var grid = $('.grid').masonry(optiongrid);
|
||||
},
|
||||
update: updateLocalisation
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
|
||||
// Création des slick
|
||||
//slick();
|
||||
|
||||
// Sur le click des titres de widgets ouvrir / fermer le widget
|
||||
$( ".widgetheader .title" ).click(function() {
|
||||
showhideWidget(this);
|
||||
});
|
||||
$( ".widgetheader .logo" ).click(function() {
|
||||
showhideWidget(this);
|
||||
});
|
||||
|
||||
// balise h des widget editor
|
||||
$(".widget-editor .widgetbody :header").css("color",$(".widgetbody").css("color"));
|
||||
|
||||
// cacher le loader
|
||||
$("#loader").hide();
|
||||
|
||||
});
|
||||
|
||||
// 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>',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 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(".widgetbody").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();
|
||||
//console.log(widget.children(".widgetbody").css("display"));
|
||||
widget.children(".widgetbody" ).toggle();
|
||||
|
||||
// On recalcule les grilles
|
||||
var grid = $('.grid').masonry(optiongrid);
|
||||
}
|
||||
});
|
||||
{% 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
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Création d'un widget selectionné
|
||||
function selWidget(idwidgettype) {
|
||||
var url="{{ path('app_'~access~'_pagewidget_widget_sumbit',{idpage:page.id,idwidgettype:'xx','by':mode})}}";
|
||||
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',group:group,usage:usage,by:mode})}}";
|
||||
url=url.replace('xx',idwidget);
|
||||
url=url.replace(/&/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:'xx',touser:'yy',group:group,usage:usage,by:mode})}}";
|
||||
url=url.replace('xx',idwidget);
|
||||
url=url.replace('yy',touser);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$(location).attr('href', url);
|
||||
}
|
||||
|
||||
// Modifciation d'un bookmark
|
||||
function modBookmark(idbookmark) {
|
||||
var url="{{ path('app_'~access~'_bookmark_update',{idpage:page.id,id:'xx',group:group,usage:usage,by:mode})}}";
|
||||
|
||||
url=url.replace('xx',idbookmark);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$(location).attr('href', url);
|
||||
}
|
||||
|
||||
// Ajouter un item aux bookmark
|
||||
function heartBookmark(iditem) {
|
||||
var idbookmark;
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_all_bookmark_heart') }}",
|
||||
data: {
|
||||
iditem:iditem
|
||||
},
|
||||
success: function(idbookmark) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Supprimer un bookmark
|
||||
function delBookmark(idbookmark) {
|
||||
if (confirm('Êtes-vous sûr de vouloir supprimer cet item ?')) {
|
||||
var url="{{ path('app_'~access~'_bookmark_delete',{idpage:page.id,id:'xx',group:group,usage:usage,by:mode})}}";
|
||||
|
||||
url=url.replace('xx',idbookmark);
|
||||
url=url.replace(/&/g,"&");
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
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('app_'~access~'_file_delete') }}",
|
||||
data: {
|
||||
directory:directory,
|
||||
filename:filename
|
||||
},
|
||||
success: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Liste des slides
|
||||
function listSlide(idwidget) {
|
||||
var url="{{ path('app_'~access~'_slide_list',{idpage:page.id,idwidget:'xx',group:group,usage:usage,by:mode})}}";
|
||||
|
||||
url=url.replace('xx',idwidget);
|
||||
url=url.replace(/&/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" %}
|
||||
window.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 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({
|
||||
method: "POST",
|
||||
url: "{{ path('app_all_alert_read') }}",
|
||||
data: {
|
||||
id:id
|
||||
},
|
||||
success: function() {
|
||||
$("#alert-"+id).remove();
|
||||
var grid = $('.grid').masonry(optiongrid);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
58
templates/Pagetemplate/list.html.twig
Normal file
58
templates/Pagetemplate/list.html.twig
Normal file
@ -0,0 +1,58 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">
|
||||
Gestion des Modèles de Page
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<a href="{{ path('app_'~access~'_pagetemplate_submit') }}" class="btn btn-success">Ajouter un Modèle</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 %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des Modèles
|
||||
</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>
|
||||
<th>Nom</th>
|
||||
<th>Pour</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]],
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: "{{ path('app_'~access~'_pagetemplate_tablelist') }}",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
45
templates/Pagetemplate/submit.html.twig
Normal file
45
templates/Pagetemplate/submit.html.twig
Normal file
@ -0,0 +1,45 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
Nouveau Modèle de Page
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-default" href="{{ path('app_'~access~'_pagetemplate') }}">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="fa fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.parentfor) }}
|
||||
{{ form_row(form.roworder) }}
|
||||
{{ form_row(form.maxwidth) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
238
templates/Pagewidget/constants.twig
Normal file
238
templates/Pagewidget/constants.twig
Normal file
@ -0,0 +1,238 @@
|
||||
{% macro libmonth(month) %}
|
||||
{% if month==1 %} Janvier
|
||||
{% elseif month==2 %} Février
|
||||
{% elseif month==3 %} Mars
|
||||
{% elseif month==4 %} Avril
|
||||
{% elseif month==5 %} Mai
|
||||
{% elseif month==6 %} Juin
|
||||
{% elseif month==7 %} Juillet
|
||||
{% elseif month==8 %} Août
|
||||
{% elseif month==9 %} Septembre
|
||||
{% elseif month==10 %} Octobre
|
||||
{% elseif month==11 %} Novembre
|
||||
{% elseif month==12 %} Décembre
|
||||
{%endif%}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro libday(day) %}
|
||||
{% if day==1 %} Lundi
|
||||
{% elseif day==2 %} Mardi
|
||||
{% elseif day==3 %} Mercredi
|
||||
{% elseif day==4 %} Jeudi
|
||||
{% elseif day==5 %} Vendredi
|
||||
{% elseif day==6 %} Samedi
|
||||
{% elseif day==7 %} Dimanche
|
||||
{%endif%}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro mycolormain() %}
|
||||
{% set color = app.session.get('color') %}{% set colormain = app.session.get('colorbgbodydark') %}{{ colormain }}
|
||||
{% endmacro %}`
|
||||
|
||||
{% macro mystylewidget(entity) %}
|
||||
{% set colorheaderback = entity.colorheaderback %}
|
||||
{% if colorheaderback is null %}
|
||||
{% set colorheaderback = "var(--colorfttitledark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set stylewidget = "" %}
|
||||
{% if not entity.autoajust %}
|
||||
{% set stylewidget = stylewidget ~ "height: " ~ entity.height ~ "px; " %}
|
||||
{% endif %}
|
||||
|
||||
{% if entity.border %}
|
||||
{% set stylewidget = stylewidget ~ "border:1px solid " ~ colorheaderback ~ "; " %}
|
||||
{% endif %}
|
||||
|
||||
{{ stylewidget }}
|
||||
{% endmacro %}`
|
||||
|
||||
|
||||
{% macro mystylewidgetmenu(entity) %}
|
||||
{% set color = app.session.get('color') %}
|
||||
|
||||
{% set colorheaderfont = entity.colorheaderfont %}
|
||||
{% if colorheaderfont is null %}
|
||||
{% set colorheaderfont = "var(--colorfttitledark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set stylewidgetmenu = "" %}
|
||||
{% set stylewidgetmenu = stylewidgetmenu ~ "color: " ~ colorheaderfont ~ "; " %}
|
||||
{% set stylewidgetmenu = stylewidgetmenu ~ "cursor: pointer; " %}
|
||||
|
||||
{{ stylewidgetmenu }}
|
||||
{% endmacro %}`
|
||||
|
||||
|
||||
|
||||
{% macro mystylewidgetheader(entity) %}
|
||||
|
||||
{% set colorheaderback = entity.colorheaderback %}
|
||||
{% if colorheaderback is null %}
|
||||
{% set colorheaderback = "var(--colorbgbodydark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorheaderfont = entity.colorheaderfont %}
|
||||
{% if colorheaderfont is null %}
|
||||
{% set colorheaderfont = "var(--colorfttitledark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set stylewidgetheader = "" %}
|
||||
{% set stylewidgetheader = stylewidgetheader ~ "background-color: " ~ colorheaderback ~ "; " %}
|
||||
{% set stylewidgetheader = stylewidgetheader ~ "color: " ~ colorheaderfont ~ "; " %}
|
||||
|
||||
{{ stylewidgetheader }}
|
||||
{% endmacro %}`
|
||||
|
||||
|
||||
|
||||
|
||||
{% macro mystylewidgetbody(entity) %}
|
||||
{% set colorbodyback = entity.colorbodyback %}
|
||||
{% if colorbodyback is null %}
|
||||
{% set colorbodyback = "var(--colorbgbodydark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = "var(--colorfttitledark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% if not entity.border %}
|
||||
{% set colorbodyback = "var(--colorbgbodylight)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set stylewidgetbody = "" %}
|
||||
{% set stylewidgetbody = stylewidgetbody ~ "background-color: " ~ colorbodyback ~ "; " %}
|
||||
{% set stylewidgetbody = stylewidgetbody ~ "color: " ~ colorbodyfont ~ "; " %}
|
||||
{% if not entity.autoajust %}
|
||||
{% set stylewidgetbody = stylewidgetbody ~ "height: " ~ (entity.height-50-2) ~ "px; overflow-y: auto;" %}
|
||||
{% endif %}
|
||||
|
||||
{% if entity.border %}
|
||||
{% set stylewidgetbody = stylewidgetbody ~ "padding:10px;" %}
|
||||
{% endif %}
|
||||
|
||||
{% if not entity.opened %}
|
||||
{% set stylewidgetbody = stylewidgetbody ~ "display:none;" %}
|
||||
{% endif %}
|
||||
|
||||
{{ stylewidgetbody }}
|
||||
|
||||
{% endmacro %}`
|
||||
|
||||
{% macro mystylewidgetbodyreverse(entity) %}
|
||||
{% set color = app.session.get('color') %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if colorbodyfont == colorbodyback %}
|
||||
{% if colorbodyfont == app.session.get('colorbgbodydark') %}
|
||||
{% set colorbodyfont=app.session.get('colorfttitledark') %}
|
||||
{% else %}
|
||||
{% set colorbodyfont=app.session.get('colorbgbodydark') %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% set stylewidgetbody = "" %}
|
||||
{% set stylewidgetbody = stylewidgetbody ~ "background-color: " ~ colorbodyback ~ "; " %}
|
||||
{% set stylewidgetbody = stylewidgetbody ~ "color: " ~ colorbodyfont ~ "; " %}
|
||||
|
||||
|
||||
{{ stylewidgetbody }}
|
||||
|
||||
{% endmacro %}`
|
||||
|
||||
|
||||
|
||||
{% macro mystylewidgetbodyframe(entity) %}
|
||||
{% set color = app.session.get('color') %}
|
||||
|
||||
{% set colorheaderback = entity.colorheaderback %}
|
||||
{% if colorheaderback is null %}
|
||||
{% set colorheaderback = app.session.get('colorbgbodydark') %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorheaderfont = entity.colorheaderfont %}
|
||||
{% if colorheaderfont is null %}
|
||||
{% set colorheaderfont = app.session.get('colorfttitledark') %}
|
||||
{% endif %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if not entity.border %}
|
||||
{% set colorbodyback = app.session.get('colorbgbodylight') %}
|
||||
{% endif %}
|
||||
|
||||
{% if colorbodyfont == colorbodyback %}
|
||||
{% if colorbodyfont == app.session.get('colorbgbodydark') %}
|
||||
{% set colorbodyfont=app.session.get('colorfttitledark') %}
|
||||
{% else %}
|
||||
{% set colorbodyfont=app.session.get('colorbgbodydark') %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% set stylewidgetbodyframe = "" %}
|
||||
{% set stylewidgetbodyframe = stylewidgetbodyframe ~ "background-color: " ~ colorbodyback ~ "; " %}
|
||||
{% set stylewidgetbodyframe = stylewidgetbodyframe ~ "color: " ~ colorbodyfont ~ "; " %}
|
||||
{% if not entity.autoajust %}
|
||||
{% set stylewidgetbodyframe = stylewidgetbodyframe ~ "height: " ~ (entity.height-50-2) ~ "px;" %}
|
||||
{% endif %}
|
||||
|
||||
{{ stylewidgetbodyframe }}
|
||||
|
||||
{% endmacro %}`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% macro mystylewidgetbodyimage(entity) %}
|
||||
{% set color = app.session.get('color') %}
|
||||
|
||||
{% set colorheaderback = entity.colorheaderback %}
|
||||
{% if colorheaderback is null %}
|
||||
{% set colorheaderback = app.session.get('colorbgbodydark') %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorheaderfont = entity.colorheaderfont %}
|
||||
{% if colorheaderfont is null %}
|
||||
{% set colorheaderfont = app.session.get('colorfttitledark') %}
|
||||
{% endif %}
|
||||
|
||||
{% 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 stylewidgetbodyimage = "" %}
|
||||
{% set stylewidgetbodyimage = stylewidgetbodyimage ~ "background-color: " ~ colorbodyback ~ "; " %}
|
||||
{% set stylewidgetbodyimage = stylewidgetbodyimage ~ "color: " ~ colorbodyfont ~ "; " %}
|
||||
{% if not entity.autoajust %}
|
||||
{% set stylewidgetbodyimage = stylewidgetbodyimage ~ "height: " ~ (entity.height-2) ~ "px; " %}
|
||||
{% endif %}
|
||||
|
||||
{{ stylewidgetbodyimage }}
|
||||
{% endmacro %}`
|
183
templates/Pagewidget/edit.html.twig
Normal file
183
templates/Pagewidget/edit.html.twig
Normal file
@ -0,0 +1,183 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" or mode=="updatetemplate" %}
|
||||
Modification Widget
|
||||
{% elseif mode=="submit" or mode=="submittemplate" %}
|
||||
Création Widget
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
|
||||
{% if access=="admin" %}
|
||||
{% if mode=="update" %}
|
||||
<a class="btn btn-secondary" href="{{ path('app_admin_page_view',{id:idpage}) }}">Annuler</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href="{{ path('app_admin_pagetemplate_view',{id:idpage}) }}">Annuler</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if mode=="update" %}
|
||||
<a class="btn btn-secondary" href="{{ path('app_user_page_view',{id:idpage,usage:usage,group:group}) }}">Annuler</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href="{{ path('app_home',{id:idpage}) }}">Annuler</a>
|
||||
{% endif %}
|
||||
{% 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="row">
|
||||
<div class="col col-8">
|
||||
<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.name) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col col-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fas fa-pencil-alt fa-fw"></i> Informations</div>
|
||||
<div class="card-body">
|
||||
<div id="diviconsel" class="col-md-12 text-center mb-1 mt-1" style="height:140px; padding:20px; background-color: {{ entity.colorheaderback ? entity.colorheaderback : 'var(--colorbgbodydark)' }};">
|
||||
{% if entity.icon.label %}
|
||||
<img src="{{ path('app_minio_image',{file:entity.icon.label}) }}" height="100" />
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="text-align:center;padding:0px">
|
||||
{{ form_row(form.idicon) }}
|
||||
<a class="btn btn-success btn-modal" data-modalid="mymodallarge" data-modaltitle="Icône" data-modalurl="{{ path('app_all_icon_select') }}" title='Selectionner un Icône'>Selectionner un Icône</a>
|
||||
<a class="btn btn-danger" onClick="delIcon()" title='Détacher'>Détacher l'Icône</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-12 mt-3">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fas fa-pencil-alt fa-fw"></i> Informations</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div id="col2" class="col col-4">
|
||||
{{ form_row(form.autoajust) }}
|
||||
{{ form_row(form.height) }}
|
||||
{{ form_row(form.border) }}
|
||||
{{ form_row(form.opened) }}
|
||||
</div>
|
||||
|
||||
<div id="col3" class="col col-4">
|
||||
{{ form_row(form.viewheader) }}
|
||||
{{ form_row(form.colorheaderback) }}
|
||||
{{ form_row(form.colorheaderfont) }}
|
||||
{{ form_row(form.colorbodyback) }}
|
||||
{{ form_row(form.colorbodyfont) }}
|
||||
</div>
|
||||
|
||||
<div id="col4" class="col col-4">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="col5" class="col col-md-12" style="clear:both">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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}) }}'>");
|
||||
$("#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();
|
||||
}
|
||||
else {
|
||||
$("#groupfield_pagewidget_colorheaderback").hide();
|
||||
$("#groupfield_pagewidget_colorheaderfont").hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
140
templates/Pagewidget/viewalert.html.twig
Normal file
140
templates/Pagewidget/viewalert.html.twig
Normal file
@ -0,0 +1,140 @@
|
||||
{% 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) %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-projalertect" 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 %}
|
||||
{% if canupdate or alerts|length>0 %}
|
||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-alert" 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>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
{% for alert in alerts %}
|
||||
<div id="alert-{{ alert.id }}" class="panel list-item" style="background: {{ alert.alertcategory.color ? '#'~alert.alertcategory.color : '#'~colormain }};">
|
||||
<div class="panel-heading" role="tab">
|
||||
{% if alert.alertcategory.icon %}
|
||||
<img height="25" src="/{{ alias }}/{{ alert.alertcategory.icon.label }}">
|
||||
{% else %}
|
||||
<img height="25" src="/{{ alias }}/uploads/icon/icon_megaphone.png">
|
||||
{% endif %}
|
||||
|
||||
{{ alert.title }}
|
||||
{% if alert.fghideable and app.user %}
|
||||
<a onClick="hideAlert({{alert.id}})" style="cursor:pointer;" title="Ne plus afficher"><i class="fa fa-eye-slash"></i></a>
|
||||
{%endif%}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="widget-ckeditor">{{ alert.content|raw }}</div>
|
||||
|
||||
{% if not alert.items is empty %}
|
||||
{% if app.user %}
|
||||
{% set username = app.user.username %}
|
||||
{% else %}
|
||||
{% set username = "" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="grid clearfix fitWidth" style="width:auto; margin: 0 auto;">
|
||||
<div class="grid-sizer grid-small"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
|
||||
{% for item in alert.items %}
|
||||
<div class="grid-item grid-list">
|
||||
<div class="grid-item-content" style="background-color: {{ item.color ? "#"~item.color : '#'~colormain }};">
|
||||
{% 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|replace({'#login#': username}) }}')">
|
||||
{% elseif item.target == "_self" %}
|
||||
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ item.target }}{% endif %}">
|
||||
{% else %}
|
||||
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url|replace({'#login#': username}) }}" target="{{ item.target }}">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo" title="{{ item.subtitle|nl2br }}">
|
||||
{% 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 %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
112
templates/Pagewidget/viewappexternal.html.twig
Normal file
112
templates/Pagewidget/viewappexternal.html.twig
Normal file
@ -0,0 +1,112 @@
|
||||
{% 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) %}
|
||||
|
||||
{% if modedesktop==0 %}
|
||||
{% set stylegrid="" %}
|
||||
{% elseif modedesktop==1 %}
|
||||
{% set stylegrid="grid-medium" %}
|
||||
{% elseif modedesktop==2 %}
|
||||
{% set stylegrid="grid-small" %}
|
||||
{% elseif modedesktop==3 %}
|
||||
{% set stylegrid="grid-list" %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = "" %}
|
||||
{% if entity.colorbodyfont is not null %}
|
||||
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-appexternal" 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-appexternal" 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>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
{% for itemcategory in itemcategorys %}
|
||||
{% set haveitem=false %}
|
||||
|
||||
{% for item in items if item.itemcategory==itemcategory %}
|
||||
|
||||
{% if loop.index ==1 %}
|
||||
{% set haveitem=true %}
|
||||
|
||||
{% if itemcategorys|length > 1 %}
|
||||
<h3 class="grid-title" style="{{ colorbodyfont }}" data-idcategory="{{ itemcategory.id }}">{{ itemcategory.label }}</h3>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{ stylegrid }}"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item {{ stylegrid }}" data-idcategory="{{ item.itemcategory.id }}" data-iditem="{{ item.id }}">
|
||||
<div class="grid-item-content" style="background-color: {{ item.color ? "#"~item.color : '#'~colormain }};">
|
||||
<a class="linktosonde" data-sonde="{{ item.itemcategory.label }}" href="{{ item.url }}" target="_blank">
|
||||
|
||||
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/{{ item.icon }}">
|
||||
</div>
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2>{{ item.title }}</h2>
|
||||
<span>{{ item.subtitle|nl2br }}</<span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if haveitem %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
101
templates/Pagewidget/viewblog.html.twig
Normal file
101
templates/Pagewidget/viewblog.html.twig
Normal file
@ -0,0 +1,101 @@
|
||||
|
||||
{% 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 stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-blog" 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-blog" 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 access=="config" %}
|
||||
<a title="Gérer mes Blogs" href='{{ path('app_config_blog') }}' style="{{ stylewidgetmenu }}"><i class="fa fa-th fa-fw"></i></a>
|
||||
{% else %}
|
||||
{% if canadd %}
|
||||
{% set idblog = "" %}
|
||||
{% set url= path('app_user_blogarticle_submit') %}
|
||||
{% if usage=="group" and firstblog is defined %}
|
||||
{% set url= path('app_user_blogarticle_submit',{idblog:firstblog,page:entity.page.id}) %}
|
||||
{% endif %}
|
||||
|
||||
<a title="Créer un Article" onClick="showFrameitem('blog','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% set url= path('app_user_blog_view') %}
|
||||
{% if usage=="group" and firstblog is defined %}
|
||||
{% set url= path('app_user_blog_view',{id:firstblog}) %}
|
||||
{% endif %}
|
||||
|
||||
<a title="Voir mes Blogs" onClick="showFrameitem('blog','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-th 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="/{{ 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>
|
||||
|
||||
{% if blogarticles|length >= 1 %}
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
<div class="grid clearfix">
|
||||
{% for blogarticle in blogarticles %}
|
||||
{% if loop.index==1 %}
|
||||
<div class="grid-sizer grid-preview"></div>
|
||||
<div class="grid-gutter-sizer grid-preview-gutter-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item grid-preview" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="grid-item-content">
|
||||
<a href onClick="showFrameitem('blog','{{ path('app_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}',true)">
|
||||
{% if blogarticle.image is not empty %}
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-vignette" src="/{{appAlias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
<div class="caption" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="grid-item-title" style="{{ stylewidgetbodyreverse }};">
|
||||
<h2>{{blogarticle.name }}</h2>
|
||||
<small>publié par {{ blogarticle.user.username }} le {{ blogarticle.submit|date("d/m/Y à H:i") }}<br>dans le blog {{blogarticle.blog.name }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
132
templates/Pagewidget/viewbookmark.html.twig
Normal file
132
templates/Pagewidget/viewbookmark.html.twig
Normal file
@ -0,0 +1,132 @@
|
||||
{% 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) %}
|
||||
|
||||
{% if modedesktop==0 %}
|
||||
{% set stylegrid="" %}
|
||||
{% elseif modedesktop==1 %}
|
||||
{% set stylegrid="grid-medium" %}
|
||||
{% elseif modedesktop==2 %}
|
||||
{% set stylegrid="grid-small" %}
|
||||
{% elseif modedesktop==3 %}
|
||||
{% set stylegrid="grid-list" %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = "" %}
|
||||
{% if entity.colorbodyfont is not null %}
|
||||
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
|
||||
{% endif %}
|
||||
|
||||
{% if app.user %}
|
||||
{% set username = app.user.username %}
|
||||
{% else %}
|
||||
{% set username = "" %}
|
||||
{% endif %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-bookmark" 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-bookmark" 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 %}
|
||||
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" 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>
|
||||
|
||||
{% if bookmarks is not empty or canadd %}
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
<div class="bookmark-container">
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{ stylegrid }}"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% for bookmark in bookmarks %}
|
||||
<div class="grid-item {{ stylegrid }}">
|
||||
<div class="grid-item-content" style="background-color: {{ bookmark.color ? "#"~bookmark.color : app.session.get('colorbgbodydark') }};">
|
||||
{% if canadd %}
|
||||
<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>
|
||||
{% endif %}
|
||||
|
||||
{% if bookmark.target == 'frame' %}
|
||||
<a class="linktosonde" data-sonde="{{ bookmark.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.id }}','{{ bookmark.url|replace({'#login#': username}) }}')">
|
||||
{% elseif bookmark.target == "_self" %}
|
||||
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}">
|
||||
{% else %}
|
||||
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{{ bookmark.target }}">
|
||||
{% endif %}
|
||||
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo" title="{{ bookmark.subtitle|nl2br }}">
|
||||
{% if bookmark.icon %}
|
||||
<img class="grid-item-img" height="110" src="/{{ appAlias }}/{{ bookmark.icon.label }}">
|
||||
{% else %}
|
||||
<img class="grid-item-img" height="110" src="/{{ appAlias }}/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 %}
|
||||
|
||||
{% if canadd %}
|
||||
<div class="grid-item {{ stylegrid }}">
|
||||
<div title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" class="grid-item-content" style="background-color: app.session.get('colorbgbodydark')}};cursor:pointer;">
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-img imageshadow" height="110" src="/{{ appAlias }}/uploads/icon/icon_add.png">
|
||||
</div>
|
||||
<div class="grid-item-title">
|
||||
<h2>Ajouter</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
100
templates/Pagewidget/viewcalendar.html.twig
Normal file
100
templates/Pagewidget/viewcalendar.html.twig
Normal file
@ -0,0 +1,100 @@
|
||||
{% 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) %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-calendar" 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-calendar" 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 access=="config" %}
|
||||
<a title="Gérer mes Calendriers" href='{{ path('app_config_calendar') }}' style="{{ stylewidgetmenu }}"><i class="fa fa-paper-plane fa-fw"></i></a>
|
||||
{% else %}
|
||||
{% set url= path('app_'~access~'_calendar_view') %}
|
||||
{% if usage=="group" and firstcalendar is defined %}
|
||||
{% set url= path('app_'~access~'_calendar_view',{id:firstcalendar}) %}
|
||||
{% endif %}
|
||||
<a title="Ajouter / Modifier un Evènement" onClick="showFrameitem('calendar','{{ url }}',true)" style="{{ stylewidgetmenu }}"><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="/{{ 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>
|
||||
|
||||
{% set firstflux="" %}
|
||||
|
||||
{% if events|length >= 1 %}
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
{% set monthsel = "" %}
|
||||
{% for i in 0..(nbday-1) %}
|
||||
{% set dateeventstart = 'now'|date_modify("+"~i~" day midnight") %}
|
||||
{% set dateeventend = 'now'|date_modify("+"~(i+1)~" day midnight") %}
|
||||
|
||||
{% set fgaffday=false %}
|
||||
{% for event in events %}
|
||||
{% if event.start< dateeventend and event.end>=dateeventstart %}
|
||||
|
||||
{% if monthsel == "" or dateeventstart|date("Y-m")!=monthsel %}
|
||||
{% set monthsel = dateeventstart|date("Y-m") %}
|
||||
{% set libmonth = constants.libmonth(dateeventstart|date("m")) %}
|
||||
<h3>{{ libmonth ~ " " ~ dateeventstart|date("Y") }}</h3>
|
||||
{% endif %}
|
||||
|
||||
{% if not fgaffday %}
|
||||
{% set fgaffday=true %}
|
||||
{% set libday = constants.libday(dateeventstart|date("N")) %}
|
||||
<div style="margin-top:15px; font-weight:bold; font-size:18px;">{{ libday ~ " " ~ dateeventstart|date("d/m/Y") }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="widget-event" style="background-color:{{ event.color }}; color: #FFF; padding:2px;" title="{{ event.description }}">
|
||||
{{ event.name }} =
|
||||
{% if not event.allDay %}
|
||||
{{ event.start | date("H:i") }} -
|
||||
{%endif%}
|
||||
{{ event.title }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% if url is defined %}
|
||||
<div style="cursor:pointer; text-align: right; margin-top:20px;"><a onClick="showFrameitem('calendar','{{url }}',true)" style="{{ stylewidgetbody }}">Voir mes Agendas</a></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
76
templates/Pagewidget/viewchat.html.twig
Normal file
76
templates/Pagewidget/viewchat.html.twig
Normal file
@ -0,0 +1,76 @@
|
||||
{% 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%}
|
56
templates/Pagewidget/vieweditor.html.twig
Normal file
56
templates/Pagewidget/vieweditor.html.twig
Normal file
@ -0,0 +1,56 @@
|
||||
{% 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 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>
|
||||
</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 %}
|
||||
</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>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}; overflow-x:hidden; ">
|
||||
{{ html | raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
67
templates/Pagewidget/viewfile.html.twig
Normal file
67
templates/Pagewidget/viewfile.html.twig
Normal file
@ -0,0 +1,67 @@
|
||||
{% 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 stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
|
||||
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
|
||||
|
141
templates/Pagewidget/viewflux.html.twig
Normal file
141
templates/Pagewidget/viewflux.html.twig
Normal file
@ -0,0 +1,141 @@
|
||||
{% 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 stylewidgetbody = constants.mystylewidgetbody(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-flux" 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-flux" 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>
|
||||
|
||||
{% set firstflux="" %}
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }} ">
|
||||
{% if fluxs is defined %}
|
||||
{% if fluxs|length > 1 %}
|
||||
<div class="cat-list-feed" onClick="showFlux({{ entity.id}},'all')" style="color:#{{ color['fontcolorhover'] }}; background-color: #{{ color['main'] }}">Tout</div>
|
||||
|
||||
{% for flux in fluxs %}
|
||||
{% set stylefeed = "background-color: #" ~ color['main'] ~ ";" %}
|
||||
{% if flux.color is not null %}
|
||||
{% set stylefeed = "background-color: #" ~ flux.color ~ ";" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="cat-list-feed" onClick="showFlux({{ entity.id}},{{ flux.id }})" style="{{ stylefeed }} color:#{{ color['fontcolorhover'] }};">{{ flux.title }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="grid clearfix">
|
||||
{% for feed in feeds %}
|
||||
{% if loop.index==1 %}
|
||||
<div class="grid-sizer {{stylegrid}}"></div>
|
||||
<div class="grid-gutter-sizer {{stylegrid}}-gutter-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% set stylecolor = "background-color: #" ~ color['main'] ~ ";" %}
|
||||
{% if feed.color is defined and feed.color is not null %}
|
||||
{% set stylecolor = "background-color: #" ~ feed.color ~ ";" %}
|
||||
{% endif %}
|
||||
{% set stylefeed = "" %}
|
||||
{% if feed.image is not null and feed.image != ""%}
|
||||
{% set stylefeed = stylefeed ~ "background: url(" ~ feed.image ~ ") no-repeat center; background-size: cover;" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item {{ stylegrid }} feed flux-{{ feed.fluxid }}">
|
||||
<div class="grid-item-content" style="{{ stylecolor }};">
|
||||
<a class="linktosonde" data-sonde="Flux = {{ feed.fluxtitle }}" href="{{ feed.link }}" target="_blank">
|
||||
<div class="item-link clearfix">
|
||||
{% if feed.image is not empty %}
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-img" src="{{feed.image}}" width="100%">
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="caption" style="{{ stylecolor }};">
|
||||
<div class="grid-item-title">
|
||||
<h2>{{ feed.title }}</h2>
|
||||
{% if modelist==0 %}
|
||||
<small>le {{ feed.date|date("d/m/Y à H:i") }}</small><br>
|
||||
{{ feed.description | nl2br }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
77
templates/Pagewidget/viewframe.html.twig
Normal file
77
templates/Pagewidget/viewframe.html.twig
Normal file
@ -0,0 +1,77 @@
|
||||
{% 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 stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %}
|
||||
{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(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-frame" 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-frame" 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,{'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont}) }}" style="margin-top:30px; {{ stylewidgetbodyframe }}" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
|
||||
</div>
|
||||
{% else %}
|
||||
<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 }}">
|
||||
<iframe id="frame-{{directory}}" src="{{ path(tool) }}" data-color="#{{colorbodyfont}}" style="{{ stylewidgetbodyframe }}" class="{% if not entity.autoajust %}notframeajust {% endif %}"></iframe>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
123
templates/Pagewidget/viewgalery.html.twig
Normal file
123
templates/Pagewidget/viewgalery.html.twig
Normal file
@ -0,0 +1,123 @@
|
||||
{% 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 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>
|
||||
</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 %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
116
templates/Pagewidget/viewgroup.html.twig
Normal file
116
templates/Pagewidget/viewgroup.html.twig
Normal file
@ -0,0 +1,116 @@
|
||||
{% 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 permgroup = app.session.get('permgroup') %}
|
||||
{% set canadd = false %}
|
||||
{% if is_granted('ROLE_ADMIN') or (is_granted('ROLE_MODO') and (permgroup=="ROLE_MODO" or permgroup=="ROLE_ANIM" or permgroup=="ROLE_USER")) or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_ANIM" or permgroup=="ROLE_USER")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %}
|
||||
{% set canadd = true %}
|
||||
{% endif %}
|
||||
|
||||
{% if mini %}
|
||||
<div class="widget widget-mini widget-group" 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-group" 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 title="Ajouter un Groupe" href="{{ path('cadoles_core_user_group_submit') }}" target="_top">
|
||||
<i class="fa fa-plus fa-fw" style="{{ stylewidgetmenu }}"></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>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}; overflow-x:hidden; ">
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer grid-small"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% for group in groups %}
|
||||
<div class="grid-item grid-small" >
|
||||
<div class="grid-item-content" style="background-color:{{ group.color ? "#"~group.color : '#'~colormain }}">
|
||||
<a href="{{path('cadoles_core_home',{id:group.id})}}" target="_top" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
{% if group.icon %}
|
||||
<img class="grid-item-img" height="110" src="/{{ alias }}{{ group.icon }}" />
|
||||
{% else %}
|
||||
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/icon_users.png" />
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2>{{ group.title }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if canadd %}
|
||||
<div class="grid-item grid-small">
|
||||
<div class="grid-item-content" style="{{ stylewidgetbodyreverse }};">
|
||||
<a title="Ajouter un Groupe" href="{{path('cadoles_core_user_group_submit')}}" target="_top" style="{{ stylewidgetbodyreverse }};">
|
||||
<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>Ajouter un Groupe</h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
121
templates/Pagewidget/viewgroupmessage.html.twig
Normal file
121
templates/Pagewidget/viewgroupmessage.html.twig
Normal file
@ -0,0 +1,121 @@
|
||||
{% 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 %}
|
||||
|
||||
|
60
templates/Pagewidget/viewinfo.html.twig
Normal file
60
templates/Pagewidget/viewinfo.html.twig
Normal file
@ -0,0 +1,60 @@
|
||||
{% extends 'widget.html.twig' %}
|
||||
|
||||
{% block widgetmenu %}
|
||||
{% endblock %}
|
||||
|
||||
{% block widgetbody %}
|
||||
<div style="text-align: center;">
|
||||
{{ description | raw }}
|
||||
</div>
|
||||
|
||||
{%if usage=="group" %}
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer grid-verysmall"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
|
||||
{% if canadd==true %}
|
||||
<div class="grid-item grid-verysmall" style="{{stylewidgetitem}}">
|
||||
<div class="grid-item-content">
|
||||
<a href="{{path('app_user_group_users',{'id':id,'idreturn':idpage})}}" target="_top">
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-img imageshadow" height="110" src="/{{ appAlias }}/uploads/icon/icon_add.png" />
|
||||
</div>
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2>Ajouter un membre</h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for member in members %}
|
||||
<div class="grid-item grid-verysmall" style="{{stylewidgetitem}}">
|
||||
<div class="grid-item-content">
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img onclick="seeUser({{member.user.id}})" src="/{{ appAlias }}/uploads/avatar/{{ member.user.avatar}}" class="grid-item-img avatar" height="110" style="cursor:pointer;">
|
||||
</div>
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2>
|
||||
{{ member.user.lastname }} {{ member.user.firstname }}
|
||||
{% if member.rolegroup==100 %}
|
||||
<br><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i>
|
||||
{% elseif member.rolegroup==90 %}
|
||||
<br><i class="fa fa-star"></i><i class="fa fa-star"></i>
|
||||
{% elseif member.rolegroup==50 %}
|
||||
<br><i class="fa fa-star"></i>
|
||||
{% endif %}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
263
templates/Pagewidget/viewitem.html.twig
Normal file
263
templates/Pagewidget/viewitem.html.twig
Normal file
@ -0,0 +1,263 @@
|
||||
<style>
|
||||
.widget{
|
||||
margin-bottom:30px;
|
||||
}
|
||||
.widget-bordered {
|
||||
border:1px solid;
|
||||
}
|
||||
.widget-menu {
|
||||
float: right;
|
||||
color: #fff;
|
||||
margin: 10px 5px 0px 0px;
|
||||
display:none;
|
||||
}
|
||||
.widget-menu i {
|
||||
cursor:pointer;
|
||||
}
|
||||
.widget-header {
|
||||
padding:10px;
|
||||
font-family: var(--fonttitle);
|
||||
}
|
||||
.widget-logo {
|
||||
height:30px;
|
||||
margin-right:5px;
|
||||
}
|
||||
.widget-body {
|
||||
padding: 5px 0px 0px 0px;
|
||||
}
|
||||
.widget-bordered .widget-body {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.cat-list {
|
||||
color: var(--colorfttitledark);
|
||||
background-color: var(--colorbgbodydark);
|
||||
padding: 5px 10px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
{% set widgethaveheader=entity.viewheader %}
|
||||
{% set widgetname="item" %}
|
||||
{%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 widgetstylemenu="background-color:var(--colorbgbodydark); color: var(--colorfttitledark); padding:10px; 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);") %}
|
||||
{% set widgeicon= entity.icon ? path('app_minio_image',{file:entity.icon.label}) : path('app_minio_image',{file:"icon/icon_pin.png"}) %}
|
||||
|
||||
{% if modedesktop==0 %}
|
||||
{% set itemsize="item-verysmall" %}
|
||||
{% elseif modedesktop==1 %}
|
||||
{% set itemsize="item-small" %}
|
||||
{% elseif modedesktop==2 %}
|
||||
{% set itemsize="item-medium" %}
|
||||
{% elseif modedesktop==3 %}
|
||||
{% set itemsize="item-large" %}
|
||||
{% elseif modedesktop==4 %}
|
||||
{% set itemsize="item-list" %}
|
||||
{% endif %}
|
||||
|
||||
{% if app.user %}
|
||||
{% set username = app.user.username %}
|
||||
{% else %}
|
||||
{% set username = "" %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% set colorbodyfont = "" %}
|
||||
{% if entity.colorbodyfont is not null %}
|
||||
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="widget widget-{{widgetname}} {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} " data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ widgetstyle }}" height="{{ entity.height }}px">
|
||||
<div class="widget-menu" style="{{ widgetstylemenu }}">
|
||||
{% if canadd %}
|
||||
<i class="fas fa-text-height" title="Changer taille des items" onClick="changeWidget({{ entity.id }},'modedesktop',{{modedesktop}})"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" ></i>
|
||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if canadd and access!="admin"%}
|
||||
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},true)" ></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{%if widgethaveheader %}
|
||||
<div class="widget-header" style="{{ widgetstyleheader }}">
|
||||
<img class="widget-logo" src="{{widgeicon}}" />
|
||||
<span class="widget-title">{{ entity.name }}</span>
|
||||
</div>
|
||||
{%endif%}
|
||||
|
||||
<div class="widget-body" style="{{ widgetstylebody }};">
|
||||
{% set havemenu=false %}
|
||||
{% set havebookmark=false %}
|
||||
|
||||
{% if menu and withbookmark!= 2 and bookmarks is not empty and itemcategorys|length > 1 %}
|
||||
{% set havemenu=true %}
|
||||
<div style="margin-bottom: 5px;">
|
||||
{% if menuall %}
|
||||
<div class="cat-list" onClick="showItemCat({{ entity.id}},'all')">Tout</div>
|
||||
{% endif %}
|
||||
|
||||
{% if bookmarks is not empty %}
|
||||
<div class="cat-list" onClick="showItemCat({{ entity.id}},'fav')"><i class="fa fa-heart"></i></div>
|
||||
{% endif %}
|
||||
|
||||
{% for itemcategory in itemcategorys %}
|
||||
<div class="cat-list" onClick="showItemCat({{ entity.id}},{{itemcategory.id}})">{{itemcategory.label}}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if search %}
|
||||
{% set havemenu=true %}
|
||||
<div class="input-group" style="margin-bottom: 5px;">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-search"></i> </span>
|
||||
</div>
|
||||
<input id="itemsearch" onKeyup="searchItem({{ entity.id}},$(this).val());" type="text" class="form-control" aria-label="Amount (to the nearest dollar)">
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if (bookmarks is not empty or canadd ) and (withbookmark==0 or withbookmark==2) %}
|
||||
{% if withbookmark==0 and itemcategorys|length > 1 %}
|
||||
<h3 class="itemcategory-title {{not havemenu ? "mt-1" : "mt-3"}} mb-0" style="{{ entity.colorbodyfont ? "color:"~entity.colorbodyfont~";" : "color:var(--colorfttitlelight);"}}" data-idcategory="bookmark">Favoris</h3>
|
||||
{% endif %}
|
||||
<div class="items-list" style="margin-top:-5px">
|
||||
{% for bookmark in bookmarks %}
|
||||
{% set havebookmark=true %}
|
||||
{% if bookmark.item %}
|
||||
{% set bookmarktitle = bookmark.item.title %}
|
||||
{% set bookmarksubtitle = bookmark.item.subtitle %}
|
||||
{% set bookmarkbackgroundcolor = bookmark.item.color ? bookmark.item.color : app.session.get('colorbgbodydark')|raw %}
|
||||
{% set bookmarktarget = bookmark.item.target %}
|
||||
{% set bookmarkurl = ( bookmark.item.protected and not app.user ? path("app_login") : bookmark.item.url|replace({'#login#': username}) ) %}
|
||||
{% set bookmarkcontent = bookmark.item.content %}
|
||||
{% set bookmarkicon = (bookmark.item.icon ? bookmark.item.icon.label : "icon/icon_pin.png") %}
|
||||
{% else %}
|
||||
{% set bookmarktitle = bookmark.title %}
|
||||
{% set bookmarksubtitle = bookmark.subtitle %}
|
||||
{% set bookmarkbackgroundcolor = bookmark.color ? bookmark.color : app.session.get('colorbgbodydark')|raw %}
|
||||
{% set bookmarktarget = bookmark.target %}
|
||||
{% set bookmarkurl = bookmark.url|replace({'#login#': username}) %}
|
||||
{% set bookmarkcontent = bookmark.content %}
|
||||
{% set bookmarkicon = bookmark.icon ? bookmark.icon.label : "icon/icon_pin.png" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="item {{itemsize}}" style="background-color: {{ bookmarkbackgroundcolor }};" data-idcategory="bookmark" data-title="{{bookmarktitle|lower}}">
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
{% if bookmarktarget == 'frame' %}
|
||||
<a class="item-link" onClick="showItemframe('bookmark{{ bookmark.id }}','{{ bookmarkurl }}')">
|
||||
{% else %}
|
||||
<a class="item-link" href="{{ bookmarkurl }}" target="{{bookmarktarget }}">
|
||||
{% endif %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:bookmarkicon}) }}">
|
||||
|
||||
<div class="item-title">
|
||||
<h3 >{{ bookmarktitle }}</h3>
|
||||
<div class="item-subtitle">{{ bookmarksubtitle|nl2br }}</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="item-action">
|
||||
{% if bookmarkcontent %}
|
||||
<a style="display:none"><i class="item-info fas fa-circle-info"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-description hide">{{ bookmarkcontent|raw }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if (canadd) %}
|
||||
<div class="item {{ itemsize }}" style="background-color: var(--colorbgbodydark);" data-idcategory="bookmark">
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
<a class="item-link" onClick="addBookmark({{ entity.id }},true)">
|
||||
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_add.png"}) }}">
|
||||
<div class="item-title">
|
||||
<h3 >Ajouter</h3>
|
||||
<div class="item-subtitle">Ajouter un Favoris</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="item-action">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for itemcategory in itemcategorys %}
|
||||
{% if itemcategorys|length > 1 or havebookmark %} <h3 class="itemcategory-title {{loop.first and not havemenu ? "mt-1" : "mt-3"}} mb-0" style="{{ entity.colorbodyfont ? "color:"~entity.colorbodyfont~";" : "color:var(--colorfttitlelight);"}}" data-idcategory="{{itemcategory.id}}">{{itemcategory.label}}</h3> {% endif %}
|
||||
<div class="items-list" style="margin-top:-5px">
|
||||
{% for item in items %}
|
||||
{% if item.itemcategory==itemcategory %}
|
||||
<div class="item {{itemsize}}" style="background-color: {{ item.color ? item.color : "var(--colorbgbodydark)" }};" data-idcategory="{{item.itemcategory.id}}" data-title="{{item.title|lower}}">
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
{% set url=item.url|replace({'#login#': username}) %}
|
||||
{% if item.protected and not app.user %}
|
||||
{% set url=path('app_login') %}
|
||||
{% endif %}
|
||||
|
||||
{% if item.target == 'frame' %}
|
||||
<a class="item-link" onClick="showItemframe({{ item.id }},'{{ url }}')">
|
||||
{% else %}
|
||||
<a class="item-link" href="{{ url }}" target="{{ item.target }}">
|
||||
{% endif %}
|
||||
|
||||
{% if item.icon %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:item.icon.label}) }}">
|
||||
{% else %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_pin.png"}) }}">
|
||||
{% endif %}
|
||||
|
||||
<div class="item-title">
|
||||
<h3 >{{ item.title }}</h3>
|
||||
<div class="item-subtitle">{{ item.subtitle|nl2br }}</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="item-action">
|
||||
{% if canadd %}
|
||||
<a style="display:none" onClick="heartBookmark({{ item.id }})"><i class="item-heart fa fa-heart"></i></a></a>
|
||||
{% endif %}
|
||||
|
||||
{% if item.content %}
|
||||
<a style="display:none"><i class="item-info fas fa-circle-info"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-description hide">{{ item.content|raw }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
249
templates/Pagewidget/viewitemessential.html.twig
Normal file
249
templates/Pagewidget/viewitemessential.html.twig
Normal file
@ -0,0 +1,249 @@
|
||||
{% 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) %}
|
||||
|
||||
|
||||
{% if modedesktop==0 %}
|
||||
{% set stylegrid="" %}
|
||||
{% elseif modedesktop==1 %}
|
||||
{% set stylegrid="grid-medium" %}
|
||||
{% elseif modedesktop==2 %}
|
||||
{% set stylegrid="grid-small" %}
|
||||
{% elseif modedesktop==3 %}
|
||||
{% set stylegrid="grid-list" %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = "" %}
|
||||
{% if entity.colorbodyfont is not null %}
|
||||
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
|
||||
{% endif %}
|
||||
|
||||
{% if app.user %}
|
||||
{% set username = app.user.username %}
|
||||
{% else %}
|
||||
{% set username = "" %}
|
||||
{% endif %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-itemessential" 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-itemessential" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widgetmenu">
|
||||
{% if canadd %}
|
||||
<i class="fas fa-text-height" title="Changer taille des items" onClick="changeWidget({{ entity.id }},'modedesktop',{{modedesktop}})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
|
||||
{% 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 and access!="config"%}
|
||||
<a title="Ajouter une Application" href="{{ path('cadoles_portal_user_page_application') }}">
|
||||
<i class="fa fa-plus fa-fw" style="{{ stylewidgetmenu }}"></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 canadd or bookmarks is not empty or items is not empty %}
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{ stylegrid }}"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
|
||||
{% for bookmark in bookmarks %}
|
||||
{% if bookmark.item %}
|
||||
<div class="grid-item {{ stylegrid }}" data-idcategory="bookmark" data-title="{{ bookmark.item.title|lower }}">
|
||||
<div class="grid-item-content" style="background-color: {{ bookmark.item.color ? "#"~bookmark.item.color : '#'~colormain }};">
|
||||
{% if bookmark.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 canadd %}
|
||||
<a style="cursor:pointer" onClick="delBookmark({{ bookmark.id }})" class="item-heart"><i style="color: #FFF" class="fa fa-trash" title="Supprimer des favoris"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% if bookmark.item.target == 'frame' %}
|
||||
<a class="linktosonde" data-sonde="{{ bookmark.item.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.item.id }}','{{ bookmark.item.url|replace({'#login#': username}) }}')">
|
||||
{% elseif bookmark.target == "_self" %}
|
||||
<a class="linktosonde" data-sonde="{{ bookmark.item.title }}" href="{{ bookmark.item.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.item.target }}{% endif %}">
|
||||
{% else %}
|
||||
<a class="linktosonde" data-sonde="{{ bookmark.item.title }}" href="{{ bookmark.item.url|replace({'#login#': username}) }}" target="{{ bookmark.item.target }}">
|
||||
{% endif %}
|
||||
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo" title="{{ bookmark.item.subtitle|nl2br }}">
|
||||
{% if bookmark.item.icon %}
|
||||
<img class="grid-item-img" src="/{{ alias }}/{{ bookmark.item.icon.label }}">
|
||||
{% else %}
|
||||
<img class="grid-item-img" src="/{{ alias }}/uploads/icon/icon_pin.png">
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2>{{ bookmark.item.title }}</h2>
|
||||
<span>{{ bookmark.item.subtitle|nl2br }}</span>
|
||||
{% if not bookmark.item.badgeurl is empty %}
|
||||
<div style="margin-top:5px;text-align:center;{% if stylegrid == "grid-list"%} float: right;position: absolute;top: 10px;right: -50px; {%endif%}">
|
||||
<div class="itembadgeurl badge badge-pill" data-url="{{bookmark.item.badgeurl}}" style="background-color: #ffffff; color: {{ bookmark.item.color ? "#"~bookmark.item.color : '#'~colormain }};"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="grid-item-body" style="display:none">
|
||||
{{ bookmark.item.content|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%else%}
|
||||
<div class="grid-item {{ stylegrid }}">
|
||||
<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>
|
||||
<a style="cursor:pointer" onClick="delBookmark({{ bookmark.id }})" class="item-heart"><i style="color: #FFF" class="fa fa-trash" title="Supprimer 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|replace({'#login#': username}) }}')">
|
||||
{% elseif bookmark.target == "_self" %}
|
||||
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}">
|
||||
{% else %}
|
||||
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{{ bookmark.target }}">
|
||||
{% endif %}
|
||||
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo" title="{{ bookmark.subtitle|nl2br }}">
|
||||
{% 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>
|
||||
{%endif%}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% for item in items %}
|
||||
<div class="grid-item {{ stylegrid }}" 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 canadd %}
|
||||
<a style="cursor:pointer" onClick="heartBookmark({{ item.id }})" class="item-heart"><i style="color: #FFF" class="fa fa-heart" title="Ajouter aux favoris"></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|replace({'#login#': username}) }}')">
|
||||
{% elseif item.target == "_self" %}
|
||||
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ item.target }}{% endif %}">
|
||||
{% else %}
|
||||
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url|replace({'#login#': username}) }}" target="{{ item.target }}">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo" title="{{ item.subtitle|nl2br }}">
|
||||
{% 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>
|
||||
{% if not item.badgeurl is empty %}
|
||||
<div style="margin-top:5px;text-align:center;{% if stylegrid == "grid-list"%} float: right;position: absolute;top: 10px;right: -50px; {%endif%}">
|
||||
<div class="itembadgeurl badge badge-pill" data-url="{{item.badgeurl}}" style="background-color: #ffffff; color: {{ item.color ? "#"~item.color : '#'~colormain }};"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="grid-item-body" style="display:none">
|
||||
{{ item.content|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if canadd %}
|
||||
<div class="grid-item {{ stylegrid }}">
|
||||
<div class="grid-item-content" style="background-color: #{{colormain}};cursor:pointer;">
|
||||
<a title="Ajouter une Application" href="{{ path('cadoles_portal_user_page_application') }}">
|
||||
<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>Ajouter</h2>
|
||||
<span>Ajouter une Application</<span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
22
templates/Pagewidget/viewlink.html.twig
Normal file
22
templates/Pagewidget/viewlink.html.twig
Normal file
@ -0,0 +1,22 @@
|
||||
{% set onlyheader=true %}
|
||||
{% extends 'widget.html.twig' %}
|
||||
|
||||
{% block widgetheader %}
|
||||
{% if target == 'frame' %}
|
||||
<a class="linktosonde" data-sonde="{{ entity.name }}" style="{{stylewidgetitem}}; font-family: var(--fonttitle); cursor:pointer;" onClick="showFrameitem('link{{ entity.id }}','{{ url|replace({'#login#': username}) }}')">
|
||||
{% elseif target == "_self" %}
|
||||
<a class="linktosonde" data-sonde="{{ entity.name }}" style="{{stylewidgetitem}}; font-family: var(--fonttitle); cursor:pointer;" href="{{ url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ target }}{% endif %}">
|
||||
{% else %}
|
||||
<a class="linktosonde" data-sonde="{{ entity.name }}" style="{{stylewidgetitem}}; font-family: var(--fonttitle); cursor:pointer;" href="{{ url|replace({'#login#': username}) }}" target="{{ target }}">
|
||||
{% endif %}
|
||||
{% if entity.icon %}
|
||||
<img src="/{{ appAlias }}/{{ entity.icon.label }}" style="max-height: 100%; width: auto; display: block; margin: auto; padding-top: 10px;" />
|
||||
{% else %}
|
||||
<img src="/{{ appAlias }}/uploads/icon/icon_pin.png" style="max-height: 100%; width: auto; display: block; margin: auto; padding-top: 10px;" />
|
||||
{% endif %}
|
||||
|
||||
<div style="text-align: center;">{{ entity.name }}</div>
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
||||
|
76
templates/Pagewidget/viewonlydoc.html.twig
Normal file
76
templates/Pagewidget/viewonlydoc.html.twig
Normal file
@ -0,0 +1,76 @@
|
||||
{% 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 stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
|
||||
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(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 entity.border and colorbodyfont is null %}
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = color['main'] %}
|
||||
{% endif %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-onlydoc" 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-onlydoc" 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>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
|
||||
<iframe id="frame-{{directory}}" src="{{ path("cadoles_portal_"~access~"_frame_only",{'directory':directory,'defaultview':view}) }}" data-color="#{{colorbodyfont}}" style="{{ stylewidgetbodyframe }}" class="{% if not entity.autoajust %}notframeajust {% endif %}"></iframe>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
133
templates/Pagewidget/viewproject.html.twig
Normal file
133
templates/Pagewidget/viewproject.html.twig
Normal file
@ -0,0 +1,133 @@
|
||||
{% 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 stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-project" 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-project" 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 access=="config" %}
|
||||
<a href='{{ path('app_config_project') }}' style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
||||
{% elseif app.user %}
|
||||
{% set idproject = "" %}
|
||||
{% set urladd= path('app_user_projecttask_submit') %}
|
||||
{% set urlview= path('app_user_project_view') %}
|
||||
{% if usage=="group" and firstproject is defined %}
|
||||
{% set urladd= path('app_user_projecttask_submit',{idproject:firstproject,page:entity.page.id}) %}
|
||||
{% set urlview= path('app_user_project_view',{id:firstproject}) %}
|
||||
{% endif %}
|
||||
<a onClick="showFrameitem('project','{{ urladd }}',true)" style="{{ stylewidgetmenu }}" title="Ajouter une Tâche"><i class="fa fa-plus fa-fw"></i></a>
|
||||
<a onClick="showFrameitem('project','{{ urlview }}',true)" style="{{ stylewidgetmenu }}" title="Gérer mes Tâches"><i class="fa fa-th 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="/{{ 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>
|
||||
|
||||
{% if projecttasks|length >= 1 %}
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||
<div class="grid clearfix">
|
||||
{% for projecttask in projecttasks %}
|
||||
{% if loop.index==1 %}
|
||||
<div class="grid-sizer grid-list"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item grid-list">
|
||||
{% set colortask = color['main'] %}
|
||||
{% if projecttask.projecttasktag %}
|
||||
{% set colortask = projecttask.projecttasktag.color %}
|
||||
{% endif %}
|
||||
<div class="grid-item-content" style="background-color:#{{ colortask }}; {%if not entity.border%}padding:5px;{%endif%}">
|
||||
<a title="Voir la Tâche" href="{{ path('app_'~access~'_projecttask_view',{'id':projecttask.id,page:entity.page.id}) }}">
|
||||
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo" style="width:10%; margin:0px; text-align: center;">
|
||||
{% if projecttask.user is empty %}
|
||||
<img class='grid-item-img avatar' src="/{{ appAlias }}/uploads/avatar/{{ projecttask.owner.avatar }}" style="width:55px; height:auto">
|
||||
{% else %}
|
||||
<img class='grid-item-img avatar' src="/{{ appAlias }}/uploads/avatar/{{ projecttask.user.avatar }}" style="width:55px; height:auto">
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid-item-title" style="width:90%; position:initial; display: inline-block; padding:0px">
|
||||
<h2 style="line-height:18px;height:auto;padding-left:5px;">{{projecttask.name}}</h2>
|
||||
|
||||
<div style="font-size:9px; display:inline-block; width:40%;padding-left:5px;">Affectée à
|
||||
{% if projecttask.user is empty %}
|
||||
{{ projecttask.owner.username }}
|
||||
{% else %}
|
||||
{{ projecttask.user.username }}
|
||||
{% endif %}
|
||||
<br>Crée le {{ projecttask.submit|date("d/m/Y à H:i") }}
|
||||
<br>Dans le projet {{projecttask.project.name }}
|
||||
</div>
|
||||
|
||||
<div style="text-align: right; font-size:9px; display:inline-block; width:35%;">
|
||||
Priorité = {{ projecttask.priority }}</br>
|
||||
Avant le = {{ projecttask.end|date("d/m/Y") }}</br>
|
||||
{% if projecttask.projecttasktag %}
|
||||
Type = {{ projecttask.projecttasktag.name }}<br>
|
||||
{% endif %}
|
||||
{% if projecttask.projecttaskstatus %}
|
||||
Statut = {{ projecttask.projecttaskstatus.name }}<br>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div style="margin-top:-5px; text-align: right; display:inline-block; width:20%;">
|
||||
<div style="font-size:35px; line-height:30px">
|
||||
{{ projecttask.percentage }}<i style="font-size:12px">%</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
63
templates/Pagewidget/viewseparator.html.twig
Normal file
63
templates/Pagewidget/viewseparator.html.twig
Normal file
@ -0,0 +1,63 @@
|
||||
{% 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>
|
||||
|
95
templates/Pagewidget/viewslide.html.twig
Normal file
95
templates/Pagewidget/viewslide.html.twig
Normal file
@ -0,0 +1,95 @@
|
||||
{% 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 stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %}
|
||||
|
||||
{% 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>
|
||||
</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 %}
|
||||
|
||||
{% 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>
|
||||
{% else %}
|
||||
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<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 %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
|
86
templates/Pagewidget/viewurl.html.twig
Normal file
86
templates/Pagewidget/viewurl.html.twig
Normal file
@ -0,0 +1,86 @@
|
||||
{% 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) %}
|
||||
|
||||
{% if app.user %}
|
||||
{% set username = app.user.username %}
|
||||
{% else %}
|
||||
{% set username = "" %}
|
||||
{% endif %}
|
||||
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-project" 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-url" 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 imagemedia %}
|
||||
{% if entity.autoajust %}
|
||||
<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="{{ stylewidgetbodyframe }}">
|
||||
<img src="{{ url|replace({'#login#': username}) }}" width="100%" >
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widgetheader" style="{{ stylewidgetbodyimage }} width:100%; background-image: url({{ url|replace({'#login#': username}) }}); background-size:cover; background-position:center;")></div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<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="{{ stylewidgetbodyframe }}">
|
||||
{% set minheight="" %}
|
||||
{%if look=="list" %}
|
||||
{% set minheight="min-height:1300px;" %}
|
||||
{% endif %}
|
||||
<iframe src="{{ url|replace({'#login#': username}) }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }} {{minheight}}"></iframe>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
91
templates/Pagewidget/widgetheader.html.twig
Normal file
91
templates/Pagewidget/widgetheader.html.twig
Normal file
@ -0,0 +1,91 @@
|
||||
{%if not mini %}
|
||||
{# Récupération des couleurs #}
|
||||
{% set colorheaderback = entity.colorheaderback %}
|
||||
{% if colorheaderback is null %}
|
||||
{% set colorheaderback = "var(--colorbgbodydark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorheaderfont = entity.colorheaderfont %}
|
||||
{% if colorheaderfont is null %}
|
||||
{% set colorheaderfont = "var(--colorftbodydark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyback = entity.colorbodyback %}
|
||||
{% if colorbodyback is null %}
|
||||
{% set colorbodyback = "var(--colorbgbodydark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = "var(--colorftbodydark)" %}
|
||||
{% endif %}
|
||||
|
||||
{% if not entity.border %}
|
||||
{% set colorbodyback = "var(--colorbgbodylight)" %}
|
||||
{% set colorbodyfont = "var(--colorftbodylight)" %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{# Definition style widget #}
|
||||
{% set widgetheight = "" %}
|
||||
{% if not entity.autoajust %}
|
||||
{% set widgetheight = "height: " ~ entity.height ~ "px; " %}
|
||||
{% endif %}
|
||||
|
||||
{# Definition style widgetheader #}
|
||||
{% set widgetheaderback = "background-color:"~colorheaderback~";" %}
|
||||
{% set widgetheaderfont = "color:"~colorheaderfont~";" %}
|
||||
|
||||
{% set widgetheaderborder = "" %}
|
||||
{% if entity.border %}
|
||||
{% set widgetheaderborder = "border:1px solid " ~ colorheaderback ~ "; " %}
|
||||
{% endif %}
|
||||
|
||||
{# Definition style widgetbody #}
|
||||
{% set widgetbodyback = "background-color:"~colorbodyback~";" %}
|
||||
{% set widgetbodyfont = "color:"~colorbodyfont~";" %}
|
||||
|
||||
{% set widgetbodyborder = "" %}
|
||||
{% if entity.border %}
|
||||
{% set widgetbodyborder = "border:1px solid " ~ colorbodyback ~ "; " %}
|
||||
{% endif %}
|
||||
|
||||
{% set widgetbodypadding = "" %}
|
||||
{% if entity.border %}
|
||||
{% set widgetbodypadding = "padding:10px;" %}
|
||||
{% endif %}
|
||||
|
||||
{% set widgetbodydisplay = "" %}
|
||||
{% if not entity.opened %}
|
||||
{% set widgetbodydisplay = "display:none;" %}
|
||||
{% endif %}
|
||||
|
||||
{% set stylewidgetbodyreverse = widgetheaderback~widgetheaderfont %}
|
||||
|
||||
|
||||
<div
|
||||
class="widget widget-info"
|
||||
data-id="{{ entity.id }}"
|
||||
loc="{{ entity.loc }}"
|
||||
style="{{ widgetheight }}">
|
||||
<div
|
||||
class="widgetmenu"
|
||||
style="{{widgetheaderback}}{{widgetheaderfont}}">
|
||||
{{ widgetmenu|raw }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="widgetheader"
|
||||
style="{{widgetheaderback}}{{widgetheaderfont}}{{widgetheaderborder}}">
|
||||
{% if icon %}
|
||||
<img src="/{{ appAlias }}{{ icon }}" class="logo" style="border-radius:100%"/>
|
||||
{% else %}
|
||||
<img src="{{icondefault}}" class="logo"/>
|
||||
{% endif %}
|
||||
<span class="title">{{ title }}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="widgetbody"
|
||||
style="{{widgetbodyback}}{{widgetbodyfont}}{{widgetbodyborder}}{{widgetbodypadding}}{{widgetbodydisplay}}">
|
||||
{% endif %}
|
13
templates/Pagewidget/widgetmini.html.twig
Normal file
13
templates/Pagewidget/widgetmini.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{%if mini %}
|
||||
<div class="widget widget-mini widget-info" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
|
||||
<div class="widgetheader">
|
||||
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
|
||||
{% if icon %}
|
||||
<img src="/{{ appAlias }}{{ icon }}" class="logo" title="{{ title }}"/>
|
||||
{% else %}
|
||||
<img src="{{icondefault}}" class="logo" title="{{ title }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
Reference in New Issue
Block a user