Properly consider new role in templates.

This commit is contained in:
Jens Luedicke
2025-07-03 01:53:32 +02:00
parent 2a62dcdcf3
commit 1145e1a517
3 changed files with 6 additions and 6 deletions

View File

@@ -11,7 +11,7 @@
<h3>Company Work Policies <span class="read-only">(Read-only)</span></h3> <h3>Company Work Policies <span class="read-only">(Read-only)</span></h3>
<p class="section-description"> <p class="section-description">
These policies are set by your administrator and apply to all employees. These policies are set by your administrator and apply to all employees.
{% if g.user.role == Role.ADMIN %} {% if g.user.role == Role.ADMIN or g.user.role == Role.SYSTEM_ADMIN %}
<a href="{{ url_for('admin_work_policies') }}">Click here to modify these settings</a>. <a href="{{ url_for('admin_work_policies') }}">Click here to modify these settings</a>.
{% endif %} {% endif %}
</p> </p>

View File

@@ -3,7 +3,7 @@
{% block content %} {% block content %}
<div class="admin-container"> <div class="admin-container">
<h1> <h1>
{% if g.user.role == Role.ADMIN %} {% if g.user.role == Role.ADMIN or g.user.role == Role.SYSTEM_ADMIN %}
Admin Dashboard Admin Dashboard
{% elif g.user.role == Role.SUPERVISOR %} {% elif g.user.role == Role.SUPERVISOR %}
Supervisor Dashboard Supervisor Dashboard
@@ -39,7 +39,7 @@
</div> </div>
<!-- Admin-only sections --> <!-- Admin-only sections -->
{% if g.user.role == Role.ADMIN %} {% if g.user.role == Role.ADMIN or g.user.role == Role.SYSTEM_ADMIN %}
<div class="stats-section"> <div class="stats-section">
<h2>System Overview</h2> <h2>System Overview</h2>
<div class="stats-grid"> <div class="stats-grid">
@@ -90,7 +90,7 @@
{% endif %} {% endif %}
<!-- Team Leader and Supervisor sections --> <!-- Team Leader and Supervisor sections -->
{% if g.user.role in [Role.TEAM_LEADER, Role.SUPERVISOR, Role.ADMIN] %} {% if g.user.role in [Role.TEAM_LEADER, Role.SUPERVISOR, Role.ADMIN, Role.SYSTEM_ADMIN] %}
<div class="team-section"> <div class="team-section">
<h2>Team Management</h2> <h2>Team Management</h2>
@@ -107,7 +107,7 @@
</div> </div>
<div class="admin-panel"> <div class="admin-panel">
{% if g.user.role == Role.ADMIN %} {% if g.user.role == Role.ADMIN or g.user.role == Role.SYSTEM_ADMIN %}
<div class="admin-card"> <div class="admin-card">
<h2>Team Configuration</h2> <h2>Team Configuration</h2>
<p>Create and manage team structures.</p> <p>Create and manage team structures.</p>

View File

@@ -44,7 +44,7 @@
<li><a href="{{ url_for('analytics') }}" data-tooltip="Time Analytics"><i class="nav-icon">📊</i><span class="nav-text">Analytics</span></a></li> <li><a href="{{ url_for('analytics') }}" data-tooltip="Time Analytics"><i class="nav-icon">📊</i><span class="nav-text">Analytics</span></a></li>
<!-- Role-based menu items --> <!-- Role-based menu items -->
{% if g.user.role == Role.ADMIN %} {% if g.user.role == Role.ADMIN or g.user.role == Role.SYSTEM_ADMIN %}
<li class="nav-divider">Admin</li> <li class="nav-divider">Admin</li>
<li><a href="{{ url_for('profile') }}" data-tooltip="Profile"><i class="nav-icon">👤</i><span class="nav-text">Profile</span></a></li> <li><a href="{{ url_for('profile') }}" data-tooltip="Profile"><i class="nav-icon">👤</i><span class="nav-text">Profile</span></a></li>
<li><a href="{{ url_for('config') }}" data-tooltip="Config"><i class="nav-icon">⚙️</i><span class="nav-text">Config</span></a></li> <li><a href="{{ url_for('config') }}" data-tooltip="Config"><i class="nav-icon">⚙️</i><span class="nav-text">Config</span></a></li>