gestion du menu grouppage

This commit is contained in:
afornerot 2021-02-15 11:29:02 +01:00
parent 1b36560d80
commit 3f1eab00ad
3 changed files with 150 additions and 89 deletions

View File

@ -127,11 +127,6 @@ body {
border-bottom: 5px solid #FFF; border-bottom: 5px solid #FFF;
} }
.dropdown-menu {
max-height: 450px;
overflow-y: auto;
}
.dropdown-submenu { .dropdown-submenu {
position: relative; position: relative;
} }

View 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=false %}
{% 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}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>
{% else %}
<i class="fa fa-users fa-fw"></i>
{% endif %}
&nbsp;{{ 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=false %}
{% 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}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>
{% else %}
<i class="fa fa-users fa-fw"></i>
{% endif %}
&nbsp;{{ groupshared.label }}
{% if page.counterread > 0 %}
<span id="badge-{{groupshared.id}}" class="badge">{{page.counterread}}</span>
{% endif %}
</a>
</li>
{% else %}
<ul id="pagesshared" class="nav navbar-top-links navbar-left">
<li class="dropdown">
<a data-group="{{groupshared.id}}" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-users fa-fw"></i>
&nbsp;{{ groupshared.label }}
<span class="caret"></span>
{% if groupshared.pagesshared[0].counterread > 0 %}
<span id="badge-{{groupshared.id}}" class="badge">{{groupshared.pagesshared[0].counterread}}</span>
{% endif %}
</a>
<ul class="dropdown-menu">
{% for page in groupshared.pagesshared %}
{% set forcereload=true %}
{% if page.pagecategory.id==1 %}
{% set forcereload=false %}
{% 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}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>
{% endif %}
{{ page.name }}
</a>
</li>
{% endfor %}
</ul>
</li>
</ul>
{% endif %}
{% endfor %}
{% endif %}

View File

@ -70,94 +70,21 @@
<ul id="pagesgroup" class="nav navbar-top-links navbar-left"> <ul id="pagesgroup" class="nav navbar-top-links navbar-left">
<!-- On regroupe l'ensemble des pages si plus de 10 groupes --> <!-- On regroupe l'ensemble des pages si plus de x groupes -->
{% set submenu="" %} {% set nbgroupregrouped=5 %}
{% if groupsshared|length > 5 %} {% if groupsshared|length > nbgroupregrouped %}
{% set submenu="-submenu" %}
<ul id="pagesshared" class="nav navbar-top-links navbar-left"> <ul id="pagesshared" class="nav navbar-top-links navbar-left">
<li class="dropdown"> <li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <a id="menugrouppages" style='cursor:pointer' data-toggle='modal' data-target='#selgrouppages'>
<i class="fa fa-users fa-fw"></i>&nbsp;Mes Groupes <i class="fa fa-users fa-fw"></i>&nbsp;Mes Groupes
<span class="caret"></span> <span class="caret"></span>
</a> </a>
<ul class="dropdown-menu">
{%endif%}
{% for groupshared in groupsshared %}
{% if groupshared.pagesshared|length == 1 %}
{% set page = groupshared.pagesshared[0] %}
{% set forcereload=true %}
{% if page.pagecategory.id==1 %}
{% set forcereload=false %}
{% 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}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>
{% else %}
<i class="fa fa-users fa-fw"></i>
{% endif %}
&nbsp;{{ groupshared.label }}
{% if page.counterread > 0 %}
<span id="badge-{{groupshared.id}}" class="badge">{{page.counterread}}</span>
{% endif %}
</a>
</li> </li>
{% else %} </ul>
<ul id="pagesshared" class="nav navbar-top-links navbar-left"> {%else%}
<li class="dropdown{{submenu}}"> {% set inmenu=true %}
<a data-group="{{groupshared.id}}" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> {{ include('@CadolesPortal/Page/menugroupe.html.twig') }}
<i class="fa fa-users fa-fw"></i> {% endif %}
&nbsp;{{ groupshared.label }}
{%if submenu is empty %}
<span class="caret"></span>
{% endif %}
{% 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=false %}
{% 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}}')">
{% if page.fonticon %}
<i class="{{ page.fonticon }} fa-faw"></i>
{% endif %}
{{ page.name }}
</a>
</li>
{% endfor %}
</ul>
</li>
</ul>
{% endif %}
{% endfor %}
{% if groupsshared|length > 3 %}
</ul>
</li>
</ul>
{%endif%}
</ul> </ul>
@ -172,6 +99,13 @@
<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="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> <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> </div>
{% endblock %} {% endblock %}
{% block pagewrapper %} {% block pagewrapper %}
@ -182,6 +116,29 @@
<iframe src="{{ widonlyoffice_url }}/sso/login" style="display:none"></iframe> <iframe src="{{ widonlyoffice_url }}/sso/login" style="display:none"></iframe>
{% endif %} {% 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">&times;</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 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-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">