refactor: move nav items to base navbar template
Consolidate navigation items into the base navbar template instead of requiring each app to override nav blocks. Nav links are now conditionally rendered based on authentication status, removing the need for duplicate nav block definitions in dashboard.html.
This commit is contained in:
@@ -1,21 +1,5 @@
|
|||||||
{% extends "themis/base.html" %}
|
{% extends "themis/base.html" %}
|
||||||
|
|
||||||
{% block nav_items_desktop %}
|
|
||||||
<li><a href="{% url 'dashboard' %}" class="font-semibold">Dashboard</a></li>
|
|
||||||
<li><a href="{% url 'library:library-list' %}">Libraries</a></li>
|
|
||||||
<li><a href="{% url 'library:search' %}">Search</a></li>
|
|
||||||
<li><a href="{% url 'llm_manager:dashboard' %}">LLM Manager</a></li>
|
|
||||||
<li><a href="{% url 'themis:key-list' %}">API Keys</a></li>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block nav_items %}
|
|
||||||
<li><a href="{% url 'dashboard' %}">Dashboard</a></li>
|
|
||||||
<li><a href="{% url 'library:library-list' %}">Libraries</a></li>
|
|
||||||
<li><a href="{% url 'library:search' %}">Search</a></li>
|
|
||||||
<li><a href="{% url 'llm_manager:dashboard' %}">LLM Manager</a></li>
|
|
||||||
<li><a href="{% url 'themis:key-list' %}">API Keys</a></li>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block title %}Dashboard — Mnemosyne{% endblock %}
|
{% block title %}Dashboard — Mnemosyne{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|||||||
@@ -13,7 +13,15 @@
|
|||||||
<ul tabindex="0"
|
<ul tabindex="0"
|
||||||
class="menu menu-sm dropdown-content bg-base-200 rounded-box z-10 mt-3 w-52 p-2 shadow">
|
class="menu menu-sm dropdown-content bg-base-200 rounded-box z-10 mt-3 w-52 p-2 shadow">
|
||||||
{% block nav_items_mobile %}
|
{% block nav_items_mobile %}
|
||||||
{% block nav_items %}{% endblock %}
|
{% block nav_items %}
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<li><a href="{% url 'dashboard' %}">Dashboard</a></li>
|
||||||
|
<li><a href="{% url 'library:library-list' %}">Libraries</a></li>
|
||||||
|
<li><a href="{% url 'library:search' %}">Search</a></li>
|
||||||
|
<li><a href="{% url 'llm_manager:dashboard' %}">LLM Manager</a></li>
|
||||||
|
<li><a href="{% url 'themis:key-list' %}">API Keys</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,7 +36,13 @@
|
|||||||
<div class="navbar-center hidden lg:flex">
|
<div class="navbar-center hidden lg:flex">
|
||||||
<ul class="menu menu-horizontal px-1">
|
<ul class="menu menu-horizontal px-1">
|
||||||
{% block nav_items_desktop %}
|
{% block nav_items_desktop %}
|
||||||
<!-- Apps fill this block with their nav items -->
|
{% if user.is_authenticated %}
|
||||||
|
<li><a href="{% url 'dashboard' %}">Dashboard</a></li>
|
||||||
|
<li><a href="{% url 'library:library-list' %}">Libraries</a></li>
|
||||||
|
<li><a href="{% url 'library:search' %}">Search</a></li>
|
||||||
|
<li><a href="{% url 'llm_manager:dashboard' %}">LLM Manager</a></li>
|
||||||
|
<li><a href="{% url 'themis:key-list' %}">API Keys</a></li>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user