Fix: Dashboard altijd zichtbaar in sidebar (onafhankelijk van plugin status)
Dashboard was niet zichtbaar in de sidebar als de Dashboard plugin niet in enabled_plugins stond. Nu is Dashboard hardcoded bovenaan de Algemeen sectie, en wordt het uit de plugin menu items gefilterd om dubbele links te voorkomen.
This commit is contained in:
@@ -40,10 +40,14 @@
|
|||||||
<i class="bi bi-gear-fill"></i> {{ ta.admin_title|default('CodePress Admin') }}
|
<i class="bi bi-gear-fill"></i> {{ ta.admin_title|default('CodePress Admin') }}
|
||||||
</div>
|
</div>
|
||||||
<ul class="nav flex-column mt-2">
|
<ul class="nav flex-column mt-2">
|
||||||
{# Algemene sectie: Dashboard (plugin) + plugin items met section=general #}
|
{# Algemene sectie: Dashboard (altijd zichtbaar) + plugin items met section=general #}
|
||||||
{% set general_plugins = plugin_admin_menu|filter(item => (item.section|default('general')) == 'general') %}
|
{% set general_plugins = plugin_admin_menu|filter(item => (item.section|default('general')) == 'general' and item.route != 'dashboard') %}
|
||||||
{% if general_plugins is not empty or has_permission('dashboard') or true %}
|
|
||||||
<li class="nav-section">{{ ta.section_general|default('Algemeen') }}</li>
|
<li class="nav-section">{{ ta.section_general|default('Algemeen') }}</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link {{ route == 'dashboard' or route == '' ? 'active' : '' }}" href="/admin/dashboard">
|
||||||
|
<i class="bi bi-speedometer2"></i> {{ ta.dashboard|default('Dashboard') }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
{% for item in general_plugins %}
|
{% for item in general_plugins %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link {{ route == item.route or route starts with item.route ~ '/' ? 'active' : '' }}" href="/admin/{{ item.route }}">
|
<a class="nav-link {{ route == item.route or route starts with item.route ~ '/' ? 'active' : '' }}" href="/admin/{{ item.route }}">
|
||||||
@@ -51,7 +55,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if has_permission('content') %}
|
{% if has_permission('content') %}
|
||||||
<li class="nav-section">{{ ta.section_content|default('Content') }}</li>
|
<li class="nav-section">{{ ta.section_content|default('Content') }}</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user