Fix login page layout - hide navbar for non-authenticated users

- Made header/navbar conditional on user authentication
- Login and register pages now display without navbar
- Forms remain centered on full page background
- Notifications still work on all pages
parent 433054e2
...@@ -66,22 +66,22 @@ ...@@ -66,22 +66,22 @@
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>
<body> <body>
{% if user %}
<header class="header"> <header class="header">
<div class="header-content"> <div class="header-content">
<div class="logo">VidAI</div> <div class="logo">VidAI</div>
<nav class="nav"> <nav class="nav">
<a href="/dashboard" {% if active_page == 'dashboard' %}class="active"{% endif %}>Dashboard</a> <a href="/dashboard" {% if active_page == 'dashboard' %}class="active"{% endif %}>Dashboard</a>
<a href="/analyze" {% if active_page == 'analyze' %}class="active"{% endif %}>Analyze</a> <a href="/analyze" {% if active_page == 'analyze' %}class="active"{% endif %}>Analyze</a>
{% if user and user.get('role') == 'admin' %} {% if user.get('role') == 'admin' %}
<a href="/train" {% if active_page == 'train' %}class="active"{% endif %}>Train</a> <a href="/train" {% if active_page == 'train' %}class="active"{% endif %}>Train</a>
{% endif %} {% endif %}
<a href="/history" {% if active_page == 'history' %}class="active"{% endif %}>History</a> <a href="/history" {% if active_page == 'history' %}class="active"{% endif %}>History</a>
{% if user and user.get('role') == 'admin' %} {% if user.get('role') == 'admin' %}
<a href="/api_tokens" {% if active_page == 'api_tokens' %}class="active"{% endif %}>API Tokens</a> <a href="/api_tokens" {% if active_page == 'api_tokens' %}class="active"{% endif %}>API Tokens</a>
{% endif %} {% endif %}
<a href="/settings" {% if active_page == 'settings' %}class="active"{% endif %}>Settings</a> <a href="/settings" {% if active_page == 'settings' %}class="active"{% endif %}>Settings</a>
</nav> </nav>
{% if user %}
<div class="user-menu"> <div class="user-menu">
<div class="user-icon" onclick="toggleUserMenu()"> <div class="user-icon" onclick="toggleUserMenu()">
<i class="fas fa-user"></i> <i class="fas fa-user"></i>
...@@ -97,9 +97,9 @@ ...@@ -97,9 +97,9 @@
<a href="/logout">Logout</a> <a href="/logout">Logout</a>
</div> </div>
</div> </div>
{% endif %}
</div> </div>
</header> </header>
{% endif %}
<!-- Notification container --> <!-- Notification container -->
<div class="notification-container" id="notificationContainer"> <div class="notification-container" id="notificationContainer">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment