Add admin nav link and reuse site header/footer on admin pages
Admins now see an Admin link in the main navigation, and the admin section inherits the branded header/footer from layout/site.html.twig instead of the bare base layout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% extends 'layout/site.html.twig' %}
|
||||
|
||||
{% block main %}
|
||||
<div style="display: flex; min-height: calc(100vh - 60px);">
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
<a class="nav-link" href="{{ path('game_dashboard') }}">{{ 'nav.game'|trans }}</a>
|
||||
</li>
|
||||
{% if app.user %}
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ path('game_admin_dashboard') }}">{{ 'nav.admin'|trans }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ path('app_logout') }}">{{ 'nav.logout'|trans }}</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user