nineskeletor/templates/Page/menugroupe.html.twig

69 lines
3.8 KiB
Twig
Raw Permalink Normal View History

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