Files
long2ice 1118e990a9 Sync pro
2021-05-01 20:45:28 +08:00

37 lines
1.8 KiB
HTML

<li class="nav-item dropdown {% if resource_label in resource.resources|map(attribute='label') %}
active
{% endif %}">
<a class="nav-link dropdown-toggle {% include 'components/dropdown-show.html' %}" href="#"
data-bs-toggle="dropdown"
role="button">
<span class="nav-link-icon d-md-none d-lg-inline-block">
<i class="{{ resource.icon }}"></i>
</span>
<span class="nav-link-title">
{{ resource.label }}
</span>
</a>
<div class="dropdown-menu {% include 'components/dropdown-show.html' %}">
<div class="dropdown-menu-columns">
<div class="dropdown-menu-column">
{% for item in resource.resources %}
{% if item.type == 'link' %}
<a href="{{ item.url }}" class="dropdown-item {% if resource_label == item.label %}
active
{% endif %}" target="{{ item.target }}">{{ item.label }}</a>
{% elif item.type == 'model' %}
<a href="{{ request.app.admin_path }}/{{ item.model }}/list"
class="dropdown-item {% if resource_label == item.label %}
active
{% endif %}">{{ item.label }}</a>
{% elif item.type == 'dropdown' %}
{% with resource=item %}
{% include 'components/dropdown.html' %}
{% endwith %}
{% endif %}
{% endfor %}
</div>
</div>
</div>
</li>