ajout du nom de la page dans la barre de navigation (fixes #32762)

This commit is contained in:
afornerot 2021-06-11 14:31:01 +02:00
parent 465bfd0374
commit 3ba041b207
2 changed files with 18 additions and 59 deletions

View File

@ -13,7 +13,7 @@
{% endif %} {% endif %}
<li id="menupage-{{page.id}}" {{ isactive }} class="list-group-item {{isactive}}" onClick="$('#listgrouppage li').removeClass('active'); $(this).addClass('active') " style="cursor:pointer"> <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}}')"> <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 %} {% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i> <i class="{{ page.fonticon }} fa-faw"></i>
{% else %} {% else %}
@ -55,7 +55,7 @@
{% endif %} {% endif %}
<li id="menupage-{{page.id}}" {{ isactive }} style="cursor:pointer"> <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}}')"> <a data-group="{{groupshared.id}}" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','group','{{forcereload}}','{{groupshared.id}}','{{page.name}}')">
{% if page.fonticon %} {% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i> <i class="{{ page.fonticon }} fa-faw"></i>
{% else %} {% else %}
@ -93,7 +93,7 @@
{% endif %} {% endif %}
<li id="menupage-{{page.id}}" {{isactive}} style="cursor:pointer"> <li id="menupage-{{page.id}}" {{isactive}} style="cursor:pointer">
<a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','group','{{forcereload}}','{{groupshared.id}}')"> <a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','group','{{forcereload}}','{{groupshared.id}}','{{page.name}}')">
{% if page.fonticon %} {% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i> <i class="{{ page.fonticon }} fa-faw"></i>
{% endif %} {% endif %}

View File

@ -15,7 +15,7 @@
{% if entity.id is defined and page.id==entity.id %} {% if entity.id is defined and page.id==entity.id %}
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer"> <li id="menupage-{{page.id}}" class="active" style="cursor:pointer">
<a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','portal','{{forcereload}}')"> <a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','portal','{{forcereload}}',null,'{{page.name}}')">
{% if page.fonticon %} {% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>&nbsp; <i class="{{ page.fonticon }} fa-faw"></i>&nbsp;
{% endif %} {% endif %}
@ -24,7 +24,7 @@
</li> </li>
{% else %} {% else %}
<li id="menupage-{{page.id}}"> <li id="menupage-{{page.id}}">
<a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','portal','{{forcereload}}')"> <a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','portal','{{forcereload}}',null,'{{page.name}}')">
{% if page.fonticon %} {% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>&nbsp; <i class="{{ page.fonticon }} fa-faw"></i>&nbsp;
{% endif %} {% endif %}
@ -45,7 +45,7 @@
{% if entity.id is defined and page.id==entity.id %} {% if entity.id is defined and page.id==entity.id %}
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer"> <li id="menupage-{{page.id}}" class="active" style="cursor:pointer">
<a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','user','{{forcereload}}')"> <a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','user','{{forcereload}}',null,'{{page.name}}')">
{% if page.fonticon %} {% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i> <i class="{{ page.fonticon }} fa-faw"></i>
{% else %} {% else %}
@ -56,7 +56,7 @@
</li> </li>
{% else %} {% else %}
<li id="menupage-{{page.id}}"> <li id="menupage-{{page.id}}">
<a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','user','{{forcereload}}')"> <a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}','user','{{forcereload}}',null,'{{page.name}}')">
{% if page.fonticon %} {% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i> <i class="{{ page.fonticon }} fa-faw"></i>
{% else %} {% else %}
@ -91,6 +91,8 @@
<div id="menupageaction"> <div id="menupageaction">
<a id="menuname" style="cursor:pointer;font-size:80%" href="">qsfqsdf</a>
{% if canadd %} {% if canadd %}
<a id="menusubmit" style="cursor:pointer" onclick="submitPage()" title='Ajouter une page'><i class='fa fa-plus fa-fw'></i></a> <a id="menusubmit" style="cursor:pointer" onclick="submitPage()" title='Ajouter une page'><i class='fa fa-plus fa-fw'></i></a>
{% endif %} {% endif %}
@ -256,20 +258,20 @@
{% if gotoroute is empty %} {% if gotoroute is empty %}
{% for page in pagesadmin %} {% for page in pagesadmin %}
{% if page.id==entity.id %} {% if page.id==entity.id %}
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','portal'); showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','portal',false,null,'{{page.name}}');
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for page in pagesuser %} {% for page in pagesuser %}
{% if page.id==entity.id %} {% if page.id==entity.id %}
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','user'); showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','user',false,null,'{{page.name}}');
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for groupshared in groupsshared %} {% for groupshared in groupsshared %}
{% for page in groupshared.pagesshared %} {% for page in groupshared.pagesshared %}
{% if page.id==entity.id %} {% if page.id==entity.id %}
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','group',true,{{groupshared.id}}); showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','group',true,{{groupshared.id}},'{{page.name}}');
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
@ -406,7 +408,7 @@
} }
// Affichages des pages // Affichages des pages
function showPage(id,catid,canupdate,usage,forcereload,groupid) { function showPage(id,catid,canupdate,usage,forcereload,groupid,pagename) {
// Sauvegarder la page en cours // Sauvegarder la page en cours
idpage=id; idpage=id;
@ -449,6 +451,10 @@
$("#badge-"+groupid).remove() $("#badge-"+groupid).remove()
} }
// Nom de la page
console.log(pagename);
$("#menuname").html(pagename);
// Cacher les actions possibles sur la page // Cacher les actions possibles sur la page
$("#menuupdate").hide(); $("#menuupdate").hide();
$("#menushare").hide(); $("#menushare").hide();
@ -578,19 +584,7 @@
$(location).attr('href', url); $(location).attr('href', url);
}; };
function loadmsgCounter() { function loadmsgCounter() {
/*
menu=$("a[data-group='"+payload.group+"']");
if(menu.length) {
if(payload.add) {
console.log("Ajout counter pour group "+payload.group+" by "+payload.from);
if(menu.children(".badge").length) {
menu.children(".badge").html(+(menu.children(".badge").html())+1);
}
else menu.append("<span id='badge-"+payload.group+"' class='badge'>1</span");
}
}
*/
$.ajax({ $.ajax({
method: "POST", method: "POST",
@ -611,40 +605,5 @@
}); });
} }
}); });
/*
$.ajax({
method: "GET",
url: "process.php?process=process-notifuser.php",
success: function(data, dataType)
{
if(data.trim()!="") {
var result=data.split(",");
if(parseInt(result[0])) {
$("#notif").show();
if(result[1]!=0) {
$("#notifbadge").html(result[1]);
$("#notifbadge").css('display', 'inline-block');
}
else {
$("#notifbadge").hide();
}
}
else $("#notifbadge").hide();
}
else {
$("#notif").hide();
}
}
});
*/
} }
// Permet de déclencher l'évenement de modification des counter
/* Plus nécessaire on passe par de l'ajax
function counter(event) {
$('#refreshcounter').data("event",event);
$('#refreshcounter').click();
};
*/
{% endblock %} {% endblock %}