Refaktor 4/4: admin kao Blueprint-ovi + auto-meni

Admin stranica app-a živi u folderu app-a:
- idriz/apps/superheroji/admin.py (Flask Blueprint BP + NAV), template preseljen u
  idriz/apps/superheroji/templates/superheroji.html.
- admin/app.py: registruje sve iz ADMIN_APPS, lijevi meni se puni iz njihovih NAV
  (context processor), globalni before_request štiti i Blueprint rute.
- Uklonjena inline /superheroji ruta i hardkodiran link u base.html.

Dodavanje admin stranice novom app-u = admin.py (BP+NAV) u folderu app-a + upis u
ADMIN_APPS. Time je mini-app potpuno samostalan: prompt, tools, config i admin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LzKpYaEsuWDevuNnvSjcFW
This commit is contained in:
idriz
2026-09-11 12:31:39 +02:00
parent e21b08c1b7
commit e74c617228
4 changed files with 69 additions and 37 deletions

View File

@@ -98,9 +98,11 @@
<a href="{{ url_for('status') }}" class="{{ 'active' if active_page == 'status' else '' }}">
<span class="icon">●</span> Status servisa
</a>
<a href="{{ url_for('superheroji') }}" class="{{ 'active' if active_page == 'superheroji' else '' }}">
<span class="icon">★</span> Superheroji
{% for it in nav_apps %}
<a href="{{ url_for(it.endpoint) }}" class="{{ 'active' if active_page == it.page else '' }}">
<span class="icon">{{ it.icon }}</span> {{ it.title }}
</a>
{% endfor %}
</nav>
<div class="sidebar-foot">
{% if session.user %}<a href="{{ url_for('logout') }}">↩ Odjava</a>{% endif %}