mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
36 lines
No EOL
1.3 KiB
Twig
36 lines
No EOL
1.3 KiB
Twig
{% macro loop(page, parent_loop) %}
|
|
{% import _self as macros %}
|
|
{% if parent_loop|length > 0 %}
|
|
{% set data_level = parent_loop %}
|
|
{% else %}
|
|
{% set data_level = 0 %}
|
|
{% endif %}
|
|
{% for p in page.children.visible %}
|
|
{% set parent_page = p.activeChild ? ' parent' : '' %}
|
|
{% set current_page = p.active ? ' active' : '' %}
|
|
<li class="dd-item{{ parent_page }}{{ current_page }}" data-nav-id="{{ p.route }}">
|
|
<a href="{{ p.url }}" {% if p.header.class %}class="{{ p.header.class }}"{% endif %}>
|
|
<i class="fa fa-check-square read-icon"></i>
|
|
<span><b>{% if data_level == 0 %}{{ loop.index }}. {% endif %}</b>{{ p.menu }}</span>
|
|
</a>
|
|
{% if p.children.count > 0 %}
|
|
<ul>
|
|
{{ macros.loop(p, parent_loop|default(0)+loop.index) }}
|
|
</ul>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
{% endmacro %}
|
|
|
|
{% macro version(p) %}
|
|
{% set parent_page = p.activeChild ? ' parent' : '' %}
|
|
{% set current_page = p.active ? ' active' : '' %}
|
|
<h5 class="{{ parent_page }}{{ current_page }}">
|
|
{% if p.activeChild or p.active %}
|
|
<i class="fa fa-chevron-down fa-fw"></i>
|
|
{% else %}
|
|
<i class="fa fa-plus fa-fw"></i>
|
|
{% endif %}
|
|
<a href="{{ p.url }}">{{ p.menu }}</a>
|
|
</h5>
|
|
{% endmacro %} |