Add complete project management system with role-based access control: **Core Features:** - Project creation and management for Admins/Supervisors - Time tracking with optional project selection and notes - Project-based filtering and reporting in history - Enhanced export functionality with project data - Team-specific project assignments **Database Changes:** - New Project model with full relationships - Enhanced TimeEntry model with project_id and notes - Updated migration scripts with rollback support - Sample project creation for testing **User Interface:** - Project management templates (create, edit, list) - Enhanced time tracking with project dropdown - Project filtering in history page - Updated navigation for role-based access - Modern styling with hover effects and responsive design **API Enhancements:** - Project validation and access control - Updated arrive endpoint with project support - Enhanced export functions with project data - Role-based route protection **Migration Support:** - Comprehensive migration scripts (migrate_projects.py) - Updated main migration script (migrate_db.py) - Detailed migration documentation - Rollback functionality for safe deployment **Role-Based Access:** - Admins: Full project CRUD operations - Supervisors: Project creation and management - Team Leaders: View team hours with projects - Team Members: Select projects when tracking time 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
93 lines
4.5 KiB
HTML
93 lines
4.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{ title }} - TimeTrack</title>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<nav>
|
|
<ul>
|
|
<li><a href="{{ url_for('home') }}">Home</a></li>
|
|
{% if g.user %}
|
|
<li><a href="{{ url_for('history') }}">History</a></li>
|
|
<li><a href="{{ url_for('about') }}">About</a></li>
|
|
|
|
<!-- Role-based dropdown menu -->
|
|
{% if g.user.is_admin %}
|
|
<li class="dropdown admin-dropdown">
|
|
<a href="#" class="dropdown-toggle">Admin</a>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="{{ url_for('profile') }}">Profile</a></li>
|
|
<li><a href="{{ url_for('config') }}">Config</a></li>
|
|
<li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
|
|
<li><a href="{{ url_for('admin_dashboard') }}">Admin Dashboard</a></li>
|
|
<li><a href="{{ url_for('admin_users') }}">Manage Users</a></li>
|
|
<li><a href="{{ url_for('admin_teams') }}">Manage Teams</a></li>
|
|
<li><a href="{{ url_for('admin_projects') }}">Manage Projects</a></li>
|
|
<li><a href="{{ url_for('admin_settings') }}">System Settings</a></li>
|
|
{% if g.user.team_id %}
|
|
<li><a href="{{ url_for('team_hours') }}">Team Hours</a></li>
|
|
{% endif %}
|
|
<li><a href="{{ url_for('logout') }}">Logout</a></li>
|
|
</ul>
|
|
</li>
|
|
{% elif g.user.role in [Role.TEAM_LEADER, Role.SUPERVISOR] %}
|
|
<!-- Team Leader/Supervisor dropdown menu -->
|
|
<li class="dropdown admin-dropdown">
|
|
<a href="#" class="dropdown-toggle">{{ g.user.username }}</a>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="{{ url_for('profile') }}">Profile</a></li>
|
|
<li><a href="{{ url_for('config') }}">Config</a></li>
|
|
<li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
|
|
{% if g.user.role == Role.SUPERVISOR %}
|
|
<li><a href="{{ url_for('admin_projects') }}">Manage Projects</a></li>
|
|
{% endif %}
|
|
{% if g.user.team_id %}
|
|
<li><a href="{{ url_for('team_hours') }}">Team Hours</a></li>
|
|
{% endif %}
|
|
<li><a href="{{ url_for('logout') }}">Logout</a></li>
|
|
</ul>
|
|
</li>
|
|
{% else %}
|
|
<!-- Regular user dropdown menu -->
|
|
<li class="dropdown admin-dropdown">
|
|
<a href="#" class="dropdown-toggle">{{ g.user.username }}</a>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="{{ url_for('profile') }}">Profile</a></li>
|
|
<li><a href="{{ url_for('config') }}">Config</a></li>
|
|
<li><a href="{{ url_for('logout') }}">Logout</a></li>
|
|
</ul>
|
|
</li>
|
|
{% endif %}
|
|
{% else %}
|
|
<li><a href="{{ url_for('login') }}">Login</a></li>
|
|
<li><a href="{{ url_for('register') }}">Register</a></li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
</header>
|
|
|
|
<main>
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
<div class="flash-messages">
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ category }}">{{ message }}</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
|
|
<footer>
|
|
<p>© {{ current_year }} TimeTrack. All rights reserved.</p>
|
|
</footer>
|
|
|
|
<script src="{{ url_for('static', filename='js/script.js') }}"></script>
|
|
</body>
|
|
</html> |