2019-04-02 11:26:41 +02:00
{% 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 %}
2019-04-16 09:49:49 +02:00
{% set forcereload = true %}
{% if page .pagecategory .id == 1 %}
2021-03-05 13:50:07 +01:00
{% set forcereload = page .toreload %}
2019-04-16 09:49:49 +02:00
{% endif %}
2021-07-05 10:44:59 +02:00
{% set usage = "portal" %}
{% if loop .first %} {% set usage = "accueil" %} {% endif %}
2019-04-02 11:26:41 +02:00
{% if entity .id is defined and page .id == entity .id %}
2020-09-25 13:54:49 +02:00
<li id="menupage- {{ page .id }} " class="active" style="cursor:pointer">
2021-07-05 10:44:59 +02:00
<a onClick="showPage( {{ page .id }} , {{ page .pagecategory .id }} ,' {{ page .canupdate }} ',' {{ usage }} ',' {{ forcereload }} ',null,' {{ page .name }} ')">
2020-09-25 13:54:49 +02:00
{% if page .fonticon %}
<i class=" {{ page .fonticon }} fa-faw"></i>
{% endif %}
{{ page .name }}
</a>
</li>
2019-04-02 11:26:41 +02:00
{% else %}
2020-09-25 13:54:49 +02:00
<li id="menupage- {{ page .id }} ">
2021-06-11 14:31:01 +02:00
<a style="cursor:pointer" onClick="showPage( {{ page .id }} , {{ page .pagecategory .id }} ,' {{ page .canupdate }} ','portal',' {{ forcereload }} ',null,' {{ page .name }} ')">
2020-09-25 13:54:49 +02:00
{% if page .fonticon %}
<i class=" {{ page .fonticon }} fa-faw"></i>
{% endif %}
{{ page .name }}
</a>
</li>
2019-04-02 11:26:41 +02:00
{% endif %}
{% endfor %}
2019-04-05 11:52:31 +02:00
</ul>
2019-04-02 11:26:41 +02:00
2019-04-05 11:52:31 +02:00
<ul id="pagesuser" class="nav navbar-top-links navbar-left">
{% for page in pagesuser %}
2019-04-16 09:49:49 +02:00
{% set forcereload = true %}
{% if page .pagecategory .id == 1 %}
2021-03-05 13:50:07 +01:00
{% set forcereload = page .toreload %}
2019-04-16 09:49:49 +02:00
{% endif %}
2021-03-05 13:50:07 +01:00
2019-04-16 09:49:49 +02:00
2019-04-02 11:26:41 +02:00
{% if entity .id is defined and page .id == entity .id %}
2020-09-25 13:54:49 +02:00
<li id="menupage- {{ page .id }} " class="active" style="cursor:pointer">
2021-06-11 14:31:01 +02:00
<a onClick="showPage( {{ page .id }} , {{ page .pagecategory .id }} ,' {{ page .canupdate }} ','user',' {{ forcereload }} ',null,' {{ page .name }} ')">
2020-09-25 13:54:49 +02:00
{% if page .fonticon %}
<i class=" {{ page .fonticon }} fa-faw"></i>
{% else %}
<i class="fa fa-user fa-fw"></i>
{% endif %}
{{ page .name }}
</a>
</li>
2019-04-02 11:26:41 +02:00
{% else %}
2020-09-25 13:54:49 +02:00
<li id="menupage- {{ page .id }} ">
2021-06-11 14:31:01 +02:00
<a style="cursor:pointer" onClick="showPage( {{ page .id }} , {{ page .pagecategory .id }} ,' {{ page .canupdate }} ','user',' {{ forcereload }} ',null,' {{ page .name }} ')">
2020-09-25 13:54:49 +02:00
{% if page .fonticon %}
<i class=" {{ page .fonticon }} fa-faw"></i>
{% else %}
<i class="fa fa-user fa-fw"></i>
{% endif %}
{{ page .name }}
</a>
</li>
2019-04-02 11:26:41 +02:00
{% endif %}
{% endfor %}
</ul>
2019-07-04 16:11:50 +02:00
<ul id="pagesgroup" class="nav navbar-top-links navbar-left">
2020-02-28 13:57:03 +01:00
2021-02-15 11:29:02 +01:00
<!-- On regroupe l'ensemble des pages si plus de x groupes -->
{% set nbgroupregrouped = 5 %}
{% if groupsshared | length > nbgroupregrouped %}
2020-02-28 13:57:03 +01:00
<ul id="pagesshared" class="nav navbar-top-links navbar-left">
2021-02-15 11:29:02 +01:00
<li>
<a id="menugrouppages" style='cursor:pointer' data-toggle='modal' data-target='#selgrouppages'>
2020-09-25 13:54:49 +02:00
<i class="fa fa-users fa-fw"></i> Mes Groupes
2020-02-28 13:57:03 +01:00
<span class="caret"></span>
2021-02-15 11:29:02 +01:00
</a>
2019-07-19 16:51:11 +02:00
</li>
2021-02-15 11:29:02 +01:00
</ul>
{% else %}
{% set inmenu = true %}
{{ include ( '@CadolesPortal/Page/menugroupe.html.twig' ) }}
{% endif %}
2020-02-28 13:57:03 +01:00
2019-07-04 16:11:50 +02:00
</ul>
2019-04-05 11:52:31 +02:00
2019-04-02 11:26:41 +02:00
<div id="menupageaction">
2021-07-05 14:30:46 +02:00
<a id="menuname" style="cursor:pointer;font-size:80%" href=""></a>
2021-06-11 14:31:01 +02:00
2019-04-02 11:26:41 +02:00
{% 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>
2019-04-05 11:52:31 +02:00
<a id="menushare" style="cursor:pointer;display:none" onclick="sharePage()" title='Partager une page'><i class='fa fa-share-alt fa-fw'></i></a>
2019-04-02 11:26:41 +02:00
<a id="menudelete" style="cursor:pointer;display:none" onclick="deletePage()" title='Supprimer une page'><i class='fa fa-trash fa-fw'></i></a>
2021-03-05 16:23:12 +01:00
<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>
2019-07-09 11:02:21 +02:00
<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>
2019-04-02 11:26:41 +02:00
</div>
2021-02-15 11:29:02 +01:00
2019-04-02 11:26:41 +02:00
{% endblock %}
{% block pagewrapper %}
<div id="pagecontainer" style="margin: 0px -30px;"></div>
2020-06-18 10:41:48 +02:00
{% if activate_widonlyoffice %}
<iframe src=" {{ widonlyoffice_url }} /sso/login" style="display:none"></iframe>
{% endif %}
2021-02-15 11:29:02 +01:00
{% 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 %}
2019-07-09 11:02:21 +02:00
<div id="selwidgetuser" class="modal fade bs-item-modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
2019-04-02 11:26:41 +02:00
<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">
2019-07-09 11:02:21 +02:00
<a onclick="$('#selwidgetuser').modal('hide');" class="btn btn-default">
2019-04-02 11:26:41 +02:00
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>
2019-07-09 11:02:21 +02:00
{% for widget in widgetsuser %}
2019-04-02 11:26:41 +02:00
<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>
2019-07-09 11:02:21 +02:00
</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>
2019-07-19 16:51:11 +02:00
</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 %}
2019-04-02 11:26:41 +02:00
{% endblock %}
{% block localjavascript %}
var idpage;
2021-03-08 15:27:33 +01:00
pagebookmark=" {{ app .session .get ( "pagebookmark" ) }} ";
2019-04-02 11:26:41 +02:00
$('document').ready(function() {
2020-04-15 10:43:15 +02:00
{% if gotoroute is empty %}
{% for page in pagesadmin %}
2019-07-04 16:11:50 +02:00
{% if page .id == entity .id %}
2021-07-05 10:44:59 +02:00
{% set usage = "portal" %}
{% if loop .first %} {% set usage = "accueil" %} {% endif %}
showPage( {{ page .id }} , {{ page .pagecategory .id }} ,' {{ page .canupdate }} ',' {{ usage }} ',false,null,' {{ page .name }} ');
2019-07-04 16:11:50 +02:00
{% endif %}
2020-04-15 10:43:15 +02:00
{% endfor %}
{% for page in pagesuser %}
{% if page .id == entity .id %}
2021-06-11 14:31:01 +02:00
showPage( {{ page .id }} , {{ page .pagecategory .id }} ,' {{ page .canupdate }} ','user',false,null,' {{ page .name }} ');
2020-04-15 10:43:15 +02:00
{% endif %}
{% endfor %}
{% for groupshared in groupsshared %}
{% for page in groupshared .pagesshared %}
{% if page .id == entity .id %}
2021-06-11 14:31:01 +02:00
showPage( {{ page .id }} , {{ page .pagecategory .id }} ,' {{ page .canupdate }} ','group',true, {{ groupshared .id }} ,' {{ page .name }} ');
2020-04-15 10:43:15 +02:00
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
var url=" {{ path ( gotoroute , { id : gotoid } ) }} ";
showGoto(url);
{% endif %}
2020-01-02 14:36:26 +01:00
2019-04-05 11:52:31 +02:00
// Rendre les pages user déplacable
$("#pagesuser").sortable( {
axis: "x",
forcePlaceholderSize: true,
2019-04-16 09:49:49 +02:00
placeholder: "placeholder",
2019-04-05 11:52:31 +02:00
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
2019-07-09 11:02:21 +02:00
$('.table').DataTable( {
2019-04-05 11:52:31 +02:00
columnDefs: [ { "targets": 'no-sort', "orderable": false }, { "targets": 0, "className": "text-center" } ],
responsive: true,
iDisplayLength: 10,
order: [[ 1, "asc" ]],
2019-07-19 16:51:11 +02:00
});
2021-07-05 14:26:51 +02:00
{% if app .user and app .session .get ( "timerefreshnotif" ) > 0 %}
2019-09-19 13:46:25 +02:00
setInterval(function() {
loadmsgCounter()
2021-07-05 14:26:51 +02:00
}, {{ ( app .session .get ( "timerefreshnotif" ) * 1 0 0 0 ) }} );
2019-09-19 13:46:25 +02:00
{% endif %}
2019-04-02 11:26:41 +02:00
});
$(window).resize(function() {
resizeFrame();
});
function resizeFrame() {
var iFrame = document.getElementById('frameContent');
var heightbody = $('html').height();
2021-02-01 11:32:27 +01:00
if($('.header').length)
var heightheader = $('.header').height();
else
var heightheader = $('.navbarsmall').height();
2019-04-02 11:26:41 +02:00
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);
});
}
2019-04-16 09:49:49 +02:00
2019-04-02 11:26:41 +02:00
// Affichage des frames associés aux items de bureau
function showFrameitem(id,url,forcereload) {
2019-09-19 13:46:25 +02:00
$(".pageframereload").remove();
2019-04-02 11:26:41 +02:00
$(".pageframe").hide();
2019-04-16 09:49:49 +02:00
// 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)
2019-04-02 11:26:41 +02:00
$("#frameitem-"+id).show();
2019-04-16 09:49:49 +02:00
// Sinon on la génère
2019-09-19 13:46:25 +02:00
else {
var myclass="";
if(forcereload) myclass="pageframereload";
2020-06-12 14:02:19 +02:00
$("#pagecontainer").append("<iframe onload='this.contentWindow.focus()' id='frameitem-"+id+"' class='pageframe "+myclass+"' src='"+url+"' style='border:none; width:100%'></iframe>");
2019-09-19 13:46:25 +02:00
}
2019-04-16 09:49:49 +02:00
2019-04-02 11:26:41 +02:00
resizeFrame();
}
// Affichages des pages
2021-06-11 14:31:01 +02:00
function showPage(id,catid,canupdate,usage,forcereload,groupid,pagename) {
2019-04-02 11:26:41 +02:00
// Sauvegarder la page en cours
2020-04-15 10:43:15 +02:00
idpage=id;
2020-01-02 14:36:26 +01:00
2019-04-02 11:26:41 +02:00
// Cacher toutes les pages
2019-09-19 13:46:25 +02:00
$(".pageframereload").remove();
2019-04-02 11:26:41 +02:00
$(".pageframe").hide();
// Rendre actif le page en cours dans le menu
$(".navbar-top-links li").removeClass("active");
2020-01-16 16:00:24 +01:00
$(".dropdown-toggle").removeClass("dropdownactive");
2019-04-02 11:26:41 +02:00
$("#menupage-"+id).addClass("active");
2020-01-16 16:00:24 +01:00
$('a[data-group="'+groupid+'"][data-toggle="dropdown"]').addClass("dropdownactive");;
2019-04-16 09:49:49 +02:00
2019-07-09 11:02:21 +02:00
var url=" {{ path ( 'cadoles_portal_user_page_view' , { id :'xx' , usage :'yy' , 'group' :'zz' } ) }} ";
2019-04-16 09:49:49 +02:00
url=url.replace('xx',id);
2019-07-09 11:02:21 +02:00
url=url.replace('yy',usage);
url=url.replace('zz',groupid);
2019-04-02 11:26:41 +02:00
2020-01-02 14:36:26 +01:00
passurl=" {{ path ( 'cadoles_core_home' , { id :'xx' } ) }} ";
passurl=passurl.replace('xx',id);
history.pushState('data to be passed', 'Title of the page', passurl);
2019-04-16 09:49:49 +02:00
// 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)
2019-04-02 11:26:41 +02:00
$("#page-"+id).show();
// Sinon on la génère
2019-09-19 13:46:25 +02:00
else {
var myclass="";
if(forcereload) myclass="pageframereload";
2020-06-12 14:02:19 +02:00
$("#pagecontainer").append("<iframe onload='this.contentWindow.focus()' id='page-"+id+"' data-category='"+catid+"' class='pageframe "+myclass+"' src='"+url+"' style='border:none; width:100%'></iframe>");
2019-09-19 13:46:25 +02:00
}
2019-04-02 11:26:41 +02:00
2019-07-19 16:51:11 +02:00
// Détruire le badge associé car normalement de fait on a lu les notif
if(usage=="group") {
$("#badge-"+groupid).remove()
}
2021-06-11 14:31:01 +02:00
// Nom de la page
console.log(pagename);
$("#menuname").html(pagename);
2019-04-02 11:26:41 +02:00
// Cacher les actions possibles sur la page
$("#menuupdate").hide();
2019-04-05 11:52:31 +02:00
$("#menushare").hide();
2019-04-02 11:26:41 +02:00
$("#menudelete").hide();
2021-03-05 16:23:12 +01:00
$("#menubookmark").hide();
2019-07-09 11:02:21 +02:00
$("#menuwidgetuser").hide();
$("#menuwidgetgroup").hide();
2019-04-02 11:26:41 +02:00
if(canupdate) {
$("#menuupdate").show();
2019-04-05 11:52:31 +02:00
$("#menushare").show();
2019-04-02 11:26:41 +02:00
$("#menudelete").show();
}
2021-03-05 16:23:12 +01:00
{% if app .user %}
2021-03-08 15:27:33 +01:00
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")
}
2021-03-05 16:23:12 +01:00
$("#menubookmark").show();
{% endif %}
2019-04-02 11:26:41 +02:00
// Si page de type widget on affiche la selection des widgets à insérer
2019-07-09 11:02:21 +02:00
if($("#page-"+id).data('category')==2&&canupdate) {
if(usage=="user") $("#menuwidgetuser").show();
if(usage=="group") $("#menuwidgetgroup").show();
}
2020-06-12 14:02:19 +02:00
2020-04-15 10:43:15 +02:00
// On resize les frame
resizeFrame();
2020-06-12 14:02:19 +02:00
// Mettre le focus dans la frame
//$("#page-"+id).contentWindow.focus();
2020-04-15 10:43:15 +02:00
}
// Affichages des pages
function showGoto(url) {
2020-06-12 14:02:19 +02:00
$("#pagecontainer").append("<iframe onload='this.contentWindow.focus()' id='goto' class='pageframe pageframereload' src='"+url+"' style='border:none; width:100%'></iframe>");
2019-04-02 11:26:41 +02:00
// On resize les frame
resizeFrame();
}
2020-04-15 10:43:15 +02:00
2019-04-02 11:26:41 +02:00
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);
}
}
2019-04-05 11:52:31 +02:00
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);
}
}
2019-04-02 11:26:41 +02:00
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);
}
}
}
2021-03-05 16:23:12 +01:00
function bookmarkPage() {
{% if app .user %}
if($("#page-"+idpage).length) {
2021-03-08 15:27:33 +01:00
if(pagebookmark==idpage)
2021-04-01 17:13:16 +02:00
confirmtext="Votre page d'accueil redevient l'accueil général de {{ app .session .get ( "appname" ) }} .";
2021-03-08 15:27:33 +01:00
else
2021-04-01 17:13:16 +02:00
confirmtext="Cette page sera votre page d'acueil à l'ouverture de {{ app .session .get ( "appname" ) }} , vous pourrez à tout moment changer de page d'accueil.";
2021-03-08 15:27:33 +01:00
if (confirm(confirmtext)) {
2021-03-05 16:23:12 +01:00
$.ajax( {
method: "POST",
url: " {{ path ( 'cadoles_core_user_preference' ) }} ",
data: {
id:0,
key:'pagebookmark',
value: idpage
2021-03-08 15:27:33 +01:00
},
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")
}
}
2021-03-05 16:23:12 +01:00
});
}
}
{% endif %}
}
2019-04-02 11:26:41 +02:00
// 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);
};
2021-06-11 14:31:01 +02:00
function loadmsgCounter() {
2019-09-19 13:46:25 +02:00
$.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");
}
});
}
});
}
2019-04-02 11:26:41 +02:00
{% endblock %}