commit 1eeea9f83ad9230a5c1f7a75662770eaab0df837 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 21:15:41 2025 +0200 Disable resuming of old time entries. commit 3e3ec2f01cb7943622b819a19179388078ae1315 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 20:59:19 2025 +0200 Refactor db migrations. commit 15a51a569da36c6b7c9e01ab17b6fdbdee6ad994 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 19:58:04 2025 +0200 Apply new style for Time Tracking view. commit 77e5278b303e060d2b03853b06277f8aa567ae68 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 18:06:04 2025 +0200 Allow direct registrations as a Company. commit 188a8772757cbef374243d3a5f29e4440ddecabe Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 18:04:45 2025 +0200 Add email invitation feature. commit d9ebaa02aa01b518960a20dccdd5a327d82f30c6 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 17:12:32 2025 +0200 Apply common style for Company, User, Team management pages. commit 81149caf4d8fc6317e2ab1b4f022b32fc5aa6d22 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 16:44:32 2025 +0200 Move export functions to own module. commit 1a26e19338e73f8849c671471dd15cc3c1b1fe82 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 15:51:15 2025 +0200 Split up models.py. commit 61f1ccd10f721b0ff4dc1eccf30c7a1ee13f204d Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 12:05:28 2025 +0200 Move utility function into own modules. commit 84b341ed35e2c5387819a8b9f9d41eca900ae79f Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 11:44:24 2025 +0200 Refactor auth functions use. commit 923e311e3da5b26d85845c2832b73b7b17c48adb Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 11:35:52 2025 +0200 Refactor route nameing and fix bugs along the way. commit f0a5c4419c340e62a2615c60b2a9de28204d2995 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 10:34:33 2025 +0200 Fix URL endpoints in announcement template. commit b74d74542a1c8dc350749e4788a9464d067a88b5 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 09:25:53 2025 +0200 Move announcements to own module. commit 9563a28021ac46c82c04fe4649b394dbf96f92c7 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 09:16:30 2025 +0200 Combine Company view and edit templates. commit 6687c373e681d54e4deab6b2582fed5cea9aadf6 Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 08:17:42 2025 +0200 Move Users, Company and System Administration to own modules. commit 8b7894a2e3eb84bb059f546648b6b9536fea724e Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 07:40:57 2025 +0200 Move Teams and Projects to own modules. commit d11bf059d99839ecf1f5d7020b8c8c8a2454c00b Author: Jens Luedicke <jens@luedicke.me> Date: Mon Jul 7 07:09:33 2025 +0200 Move Tasks and Sprints to own modules.
1379 lines
41 KiB
HTML
1379 lines
41 KiB
HTML
{% extends "layout.html" %}
|
||
|
||
{% block content %}
|
||
{% if not g.user %}
|
||
|
||
<!-- Decadent Splash Page -->
|
||
<div class="splash-container">
|
||
<!-- Hero Section -->
|
||
<section class="splash-hero">
|
||
<div class="hero-content">
|
||
<h1 class="hero-title">Transform Your Productivity</h1>
|
||
<p class="hero-subtitle">Experience the future of time management with {{ g.branding.app_name if g.branding else 'TimeTrack' }}'s intelligent tracking system</p>
|
||
<div class="cta-buttons">
|
||
<a href="{{ url_for('register') }}" class="btn-primary">Get Started Free</a>
|
||
<a href="{{ url_for('login') }}" class="btn-secondary">Sign In</a>
|
||
</div>
|
||
</div>
|
||
<div class="hero-visual">
|
||
<div class="floating-clock">
|
||
<div class="clock-face">
|
||
<div class="hour-hand"></div>
|
||
<div class="minute-hand"></div>
|
||
<div class="second-hand"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- Features Grid -->
|
||
<section class="features-grid">
|
||
<h2 class="section-title">Powerful Features for Modern Teams</h2>
|
||
<div class="feature-cards">
|
||
<div class="feature-card">
|
||
<div class="feature-icon">⚡</div>
|
||
<h3>Lightning Fast</h3>
|
||
<p>Start tracking in seconds with our intuitive one-click interface</p>
|
||
</div>
|
||
<div class="feature-card">
|
||
<div class="feature-icon">📊</div>
|
||
<h3>Advanced Analytics</h3>
|
||
<p>Gain insights with comprehensive reports and visual dashboards</p>
|
||
</div>
|
||
<div class="feature-card">
|
||
<div class="feature-icon">🏃♂️</div>
|
||
<h3>Sprint Management</h3>
|
||
<p>Organize work into sprints with agile project tracking</p>
|
||
</div>
|
||
<div class="feature-card">
|
||
<div class="feature-icon">👥</div>
|
||
<h3>Team Collaboration</h3>
|
||
<p>Manage teams, projects, and resources all in one place</p>
|
||
</div>
|
||
<div class="feature-card">
|
||
<div class="feature-icon">🔒</div>
|
||
<h3>Enterprise Security</h3>
|
||
<p>Bank-level encryption with role-based access control</p>
|
||
</div>
|
||
<div class="feature-card">
|
||
<div class="feature-icon">🌐</div>
|
||
<h3>Multi-Company Support</h3>
|
||
<p>Perfect for agencies managing multiple client accounts</p>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- Why Choose Section -->
|
||
<section class="statistics">
|
||
<h2 class="section-title">Why Choose {{ g.branding.app_name if g.branding else 'TimeTrack' }}?</h2>
|
||
<div class="stat-item">
|
||
<div class="stat-number">100%</div>
|
||
<div class="stat-label">Free & Open Source</div>
|
||
</div>
|
||
<div class="stat-item">
|
||
<div class="stat-number">∞</div>
|
||
<div class="stat-label">Unlimited Tracking</div>
|
||
</div>
|
||
<div class="stat-item">
|
||
<div class="stat-number">0</div>
|
||
<div class="stat-label">Hidden Fees</div>
|
||
</div>
|
||
<div class="stat-item">
|
||
<div class="stat-number">24/7</div>
|
||
<div class="stat-label">Always Available</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- Getting Started Section -->
|
||
<section class="testimonials">
|
||
<h2 class="section-title">Get Started in Minutes</h2>
|
||
<div class="testimonial-grid">
|
||
<div class="testimonial-card">
|
||
<div class="feature-icon">1️⃣</div>
|
||
<h3>Sign Up</h3>
|
||
<p>Create your free account in seconds. No credit card required.</p>
|
||
</div>
|
||
<div class="testimonial-card">
|
||
<div class="feature-icon">2️⃣</div>
|
||
<h3>Set Up Your Workspace</h3>
|
||
<p>Add your company, teams, and projects to organize your time tracking.</p>
|
||
</div>
|
||
<div class="testimonial-card">
|
||
<div class="feature-icon">3️⃣</div>
|
||
<h3>Start Tracking</h3>
|
||
<p>Click "Arrive" to start tracking, "Leave" when done. It's that simple!</p>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- Open Source Section -->
|
||
<section class="pricing">
|
||
<h2 class="section-title">Forever Free, Forever Open</h2>
|
||
<div class="pricing-cards">
|
||
<div class="pricing-card featured">
|
||
<div class="badge">100% Free</div>
|
||
<h3>{{ g.branding.app_name if g.branding else 'TimeTrack' }} Community</h3>
|
||
<div class="price">$0<span>/forever</span></div>
|
||
<ul class="pricing-features">
|
||
<li>✓ Unlimited users</li>
|
||
<li>✓ All features included</li>
|
||
<li>✓ Time tracking & analytics</li>
|
||
<li>✓ Sprint management</li>
|
||
<li>✓ Team collaboration</li>
|
||
<li>✓ Project management</li>
|
||
<li>✓ Self-hosted option</li>
|
||
<li>✓ No restrictions</li>
|
||
</ul>
|
||
<a href="{{ url_for('register') }}" class="btn-pricing">Get Started Free</a>
|
||
</div>
|
||
</div>
|
||
<p style="text-align: center; margin-top: 2rem; color: #666;">
|
||
The software {{ g.branding.app_name if g.branding else 'TimeTrack' }} runs is open source software.<br />
|
||
Host it yourself or use our free hosted version.<br />
|
||
The source is available on GitHub:
|
||
<a href="https://github.com/nullmedium/TimeTrack" target="_blank">https://github.com/nullmedium/TimeTrack</a>
|
||
</p>
|
||
</section>
|
||
|
||
<!-- Final CTA -->
|
||
<section class="final-cta">
|
||
<h2>Ready to Take Control of Your Time?</h2>
|
||
<p>Start tracking your time effectively today - no strings attached</p>
|
||
<a href="{{ url_for('register') }}" class="btn-primary large">Create Free Account</a>
|
||
</section>
|
||
</div>
|
||
|
||
{% else %}
|
||
|
||
<!-- Include the modern time tracking interface from time_tracking.html -->
|
||
<div class="time-tracking-container">
|
||
<!-- Header Section -->
|
||
<div class="page-header">
|
||
<div class="header-content">
|
||
<div class="header-left">
|
||
<h1 class="page-title">
|
||
<span class="page-icon">⏱️</span>
|
||
Time Tracking
|
||
</h1>
|
||
<p class="page-subtitle">Track your work hours efficiently</p>
|
||
</div>
|
||
<div class="header-actions">
|
||
<button id="manual-entry-btn" class="btn btn-secondary">
|
||
<span class="icon">📝</span>
|
||
Manual Entry
|
||
</button>
|
||
<a href="{{ url_for('analytics') }}" class="btn btn-secondary">
|
||
<span class="icon">📊</span>
|
||
View Analytics
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Timer Section -->
|
||
<div class="timer-section">
|
||
{% if active_entry %}
|
||
<!-- Active Timer -->
|
||
<div class="timer-card active">
|
||
<div class="timer-display">
|
||
<div class="timer-value" id="timer"
|
||
data-start="{{ active_entry.arrival_time.timestamp() }}"
|
||
data-breaks="{{ active_entry.total_break_duration }}"
|
||
data-paused="{{ 'true' if active_entry.is_paused else 'false' }}">
|
||
00:00:00
|
||
</div>
|
||
<div class="timer-status">
|
||
{% if active_entry.is_paused %}
|
||
<span class="status-badge paused">On Break</span>
|
||
{% else %}
|
||
<span class="status-badge active">Working</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
|
||
<div class="timer-info">
|
||
<div class="info-row">
|
||
<span class="info-label">Started:</span>
|
||
<span class="info-value">{{ active_entry.arrival_time|format_datetime }}</span>
|
||
</div>
|
||
|
||
{% if active_entry.project %}
|
||
<div class="info-row">
|
||
<span class="info-label">Project:</span>
|
||
<span class="info-value project-badge" style="background-color: {{ active_entry.project.color or '#667eea' }}">
|
||
{{ active_entry.project.code }} - {{ active_entry.project.name }}
|
||
</span>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if active_entry.task %}
|
||
<div class="info-row">
|
||
<span class="info-label">Task:</span>
|
||
<span class="info-value task-badge">
|
||
{{ active_entry.task.title }}
|
||
</span>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if active_entry.notes %}
|
||
<div class="info-row">
|
||
<span class="info-label">Notes:</span>
|
||
<span class="info-value">{{ active_entry.notes }}</span>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if active_entry.is_paused %}
|
||
<div class="info-row">
|
||
<span class="info-label">Break started:</span>
|
||
<span class="info-value">{{ active_entry.pause_start_time|format_time }}</span>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if active_entry.total_break_duration > 0 %}
|
||
<div class="info-row">
|
||
<span class="info-label">Total breaks:</span>
|
||
<span class="info-value">{{ active_entry.total_break_duration|format_duration }}</span>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div class="timer-actions">
|
||
<button id="pause-btn" class="btn {% if active_entry.is_paused %}btn-success{% else %}btn-warning{% endif %}"
|
||
data-id="{{ active_entry.id }}">
|
||
{% if active_entry.is_paused %}
|
||
<span class="icon">▶️</span>
|
||
Resume Work
|
||
{% else %}
|
||
<span class="icon">⏸️</span>
|
||
Take Break
|
||
{% endif %}
|
||
</button>
|
||
<button id="leave-btn" class="btn btn-danger" data-id="{{ active_entry.id }}">
|
||
<span class="icon">⏹️</span>
|
||
Stop Working
|
||
</button>
|
||
</div>
|
||
</div>
|
||
{% else %}
|
||
<!-- Inactive Timer -->
|
||
<div class="timer-card inactive">
|
||
<div class="start-work-container">
|
||
<h2>Start Tracking Time</h2>
|
||
<p>Select a project and task to begin tracking your work</p>
|
||
|
||
<form id="start-work-form" class="modern-form">
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label for="project-select" class="form-label">
|
||
Project <span class="optional-badge">Optional</span>
|
||
</label>
|
||
<select id="project-select" name="project_id" class="form-control">
|
||
<option value="">No specific project</option>
|
||
{% for project in available_projects %}
|
||
<option value="{{ project.id }}" data-color="{{ project.color or '#667eea' }}">
|
||
{{ project.code }} - {{ project.name }}
|
||
</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="task-select" class="form-label">
|
||
Task <span class="optional-badge">Optional</span>
|
||
</label>
|
||
<select id="task-select" name="task_id" class="form-control" disabled>
|
||
<option value="">Select a project first</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="work-notes" class="form-label">
|
||
Notes <span class="optional-badge">Optional</span>
|
||
</label>
|
||
<textarea id="work-notes" name="notes" class="form-control"
|
||
rows="2" placeholder="What are you working on?"></textarea>
|
||
</div>
|
||
|
||
<div class="form-actions">
|
||
<button type="submit" id="arrive-btn" class="btn btn-primary btn-large">
|
||
<span class="icon">▶️</span>
|
||
Start Working
|
||
</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Quick Stats -->
|
||
{% if today_hours is defined %}
|
||
<div class="stats-section">
|
||
<div class="stat-card">
|
||
<div class="stat-value">{{ today_hours|format_duration }}</div>
|
||
<div class="stat-label">Today</div>
|
||
</div>
|
||
<div class="stat-card">
|
||
<div class="stat-value">{{ week_hours|format_duration }}</div>
|
||
<div class="stat-label">This Week</div>
|
||
</div>
|
||
<div class="stat-card">
|
||
<div class="stat-value">{{ month_hours|format_duration }}</div>
|
||
<div class="stat-label">This Month</div>
|
||
</div>
|
||
<div class="stat-card">
|
||
<div class="stat-value">{{ active_projects|length if active_projects else 0 }}</div>
|
||
<div class="stat-label">Active Projects</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Recent Entries -->
|
||
<div class="entries-section">
|
||
<div class="section-header">
|
||
<h2 class="section-title">
|
||
<span class="icon">📋</span>
|
||
Recent Time Entries
|
||
</h2>
|
||
<div class="view-toggle">
|
||
<button class="toggle-btn active" data-view="list">
|
||
<span class="icon">📝</span>
|
||
List
|
||
</button>
|
||
<button class="toggle-btn" data-view="grid">
|
||
<span class="icon">📊</span>
|
||
Grid
|
||
</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- List View -->
|
||
<div id="list-view" class="view-container active">
|
||
{% if history %}
|
||
<div class="entries-table-container">
|
||
<table class="entries-table">
|
||
<thead>
|
||
<tr>
|
||
<th>Date</th>
|
||
<th>Time</th>
|
||
<th>Project / Task</th>
|
||
<th>Duration</th>
|
||
<th>Break</th>
|
||
<th>Notes</th>
|
||
<th>Actions</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for entry in history %}
|
||
<tr data-entry-id="{{ entry.id }}" class="entry-row">
|
||
<td>
|
||
<div class="date-cell">
|
||
<span class="date-day">{{ entry.arrival_time.strftime('%d') }}</span>
|
||
<span class="date-month">{{ entry.arrival_time.strftime('%b') }}</span>
|
||
</div>
|
||
</td>
|
||
<td>
|
||
<div class="time-cell">
|
||
<span class="time-start">{{ entry.arrival_time|format_time }}</span>
|
||
<span class="time-separator">→</span>
|
||
<span class="time-end">{{ entry.departure_time|format_time if entry.departure_time else 'Active' }}</span>
|
||
</div>
|
||
</td>
|
||
<td>
|
||
<div class="project-task-cell">
|
||
{% if entry.project %}
|
||
<span class="project-tag" style="background-color: {{ entry.project.color or '#667eea' }}">
|
||
{{ entry.project.code }}
|
||
</span>
|
||
{% endif %}
|
||
{% if entry.task %}
|
||
<span class="task-name">{{ entry.task.title }}</span>
|
||
{% elif entry.project %}
|
||
<span class="project-name">{{ entry.project.name }}</span>
|
||
{% else %}
|
||
<span class="no-project">No project</span>
|
||
{% endif %}
|
||
</div>
|
||
</td>
|
||
<td>
|
||
<span class="duration-badge">
|
||
{{ entry.duration|format_duration if entry.duration is not none else 'In progress' }}
|
||
</span>
|
||
</td>
|
||
<td>
|
||
<span class="break-duration">
|
||
{{ entry.total_break_duration|format_duration if entry.total_break_duration else '-' }}
|
||
</span>
|
||
</td>
|
||
<td>
|
||
<span class="notes-preview" title="{{ entry.notes or '' }}">
|
||
{{ entry.notes[:30] + '...' if entry.notes and entry.notes|length > 30 else entry.notes or '-' }}
|
||
</span>
|
||
</td>
|
||
<td>
|
||
<div class="actions-cell">
|
||
{% if entry.departure_time and not active_entry %}
|
||
<button class="btn-icon resume-work-btn" data-id="{{ entry.id }}" title="Resume">
|
||
<span class="icon">🔄</span>
|
||
</button>
|
||
{% endif %}
|
||
<button class="btn-icon edit-entry-btn" data-id="{{ entry.id }}" title="Edit">
|
||
<span class="icon">✏️</span>
|
||
</button>
|
||
<button class="btn-icon delete-entry-btn" data-id="{{ entry.id }}" title="Delete">
|
||
<span class="icon">🗑️</span>
|
||
</button>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{% else %}
|
||
<div class="empty-state">
|
||
<div class="empty-icon">📭</div>
|
||
<h3>No time entries yet</h3>
|
||
<p>Start tracking your time to see entries here</p>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Grid View -->
|
||
<div id="grid-view" class="view-container">
|
||
<div class="entries-grid">
|
||
{% for entry in history %}
|
||
<div class="entry-card" data-entry-id="{{ entry.id }}">
|
||
<div class="entry-header">
|
||
<div class="entry-date">
|
||
{{ entry.arrival_time.strftime('%d %b %Y') }}
|
||
</div>
|
||
<div class="entry-duration">
|
||
{{ entry.duration|format_duration if entry.duration is not none else 'Active' }}
|
||
</div>
|
||
</div>
|
||
|
||
<div class="entry-body">
|
||
{% if entry.project %}
|
||
<div class="entry-project" style="border-left-color: {{ entry.project.color or '#667eea' }}">
|
||
<strong>{{ entry.project.code }}</strong> - {{ entry.project.name }}
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if entry.task %}
|
||
<div class="entry-task">
|
||
<span class="icon">📋</span> {{ entry.task.title }}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<div class="entry-time">
|
||
<span class="icon">🕐</span>
|
||
{{ entry.arrival_time|format_time }} - {{ entry.departure_time|format_time if entry.departure_time else 'Active' }}
|
||
</div>
|
||
|
||
{% if entry.notes %}
|
||
<div class="entry-notes">
|
||
<span class="icon">📝</span>
|
||
{{ entry.notes }}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div class="entry-footer">
|
||
<button class="btn-sm edit-entry-btn" data-id="{{ entry.id }}">Edit</button>
|
||
<button class="btn-sm btn-danger delete-entry-btn" data-id="{{ entry.id }}">Delete</button>
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Modals -->
|
||
<!-- Edit Entry Modal -->
|
||
<div id="edit-modal" class="modal">
|
||
<div class="modal-overlay"></div>
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h3 class="modal-title">Edit Time Entry</h3>
|
||
<button class="modal-close">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form id="edit-entry-form" class="modern-form">
|
||
<input type="hidden" id="edit-entry-id">
|
||
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label for="edit-arrival-date" class="form-label">Start Date</label>
|
||
<input type="date" id="edit-arrival-date" class="form-control" required>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="edit-arrival-time" class="form-label">Start Time</label>
|
||
<input type="time" id="edit-arrival-time" class="form-control" required step="60">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label for="edit-departure-date" class="form-label">End Date</label>
|
||
<input type="date" id="edit-departure-date" class="form-control">
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="edit-departure-time" class="form-label">End Time</label>
|
||
<input type="time" id="edit-departure-time" class="form-control" step="60">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="edit-project" class="form-label">Project</label>
|
||
<select id="edit-project" class="form-control">
|
||
<option value="">No specific project</option>
|
||
{% for project in available_projects %}
|
||
<option value="{{ project.id }}">{{ project.code }} - {{ project.name }}</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="edit-notes" class="form-label">Notes</label>
|
||
<textarea id="edit-notes" class="form-control" rows="3"></textarea>
|
||
</div>
|
||
|
||
<div class="form-actions">
|
||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||
<button type="button" class="btn btn-ghost modal-cancel">Cancel</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Manual Entry Modal -->
|
||
<div id="manual-modal" class="modal">
|
||
<div class="modal-overlay"></div>
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h3 class="modal-title">Add Manual Time Entry</h3>
|
||
<button class="modal-close">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form id="manual-entry-form" class="modern-form">
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label for="manual-start-date" class="form-label">Start Date</label>
|
||
<input type="date" id="manual-start-date" class="form-control" required>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="manual-start-time" class="form-label">Start Time</label>
|
||
<input type="time" id="manual-start-time" class="form-control" required step="60">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label for="manual-end-date" class="form-label">End Date</label>
|
||
<input type="date" id="manual-end-date" class="form-control" required>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="manual-end-time" class="form-label">End Time</label>
|
||
<input type="time" id="manual-end-time" class="form-control" required step="60">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="manual-project" class="form-label">Project</label>
|
||
<select id="manual-project" name="project_id" class="form-control">
|
||
<option value="">No specific project</option>
|
||
{% for project in available_projects %}
|
||
<option value="{{ project.id }}">{{ project.code }} - {{ project.name }}</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="manual-task" class="form-label">Task</label>
|
||
<select id="manual-task" name="task_id" class="form-control" disabled>
|
||
<option value="">Select a project first</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="manual-break" class="form-label">Break Duration (minutes)</label>
|
||
<input type="number" id="manual-break" class="form-control" min="0" value="0">
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="manual-notes" class="form-label">Notes</label>
|
||
<textarea id="manual-notes" class="form-control" rows="3" placeholder="Description of work performed"></textarea>
|
||
</div>
|
||
|
||
<div class="form-actions">
|
||
<button type="submit" class="btn btn-primary">Add Entry</button>
|
||
<button type="button" class="btn btn-ghost modal-cancel">Cancel</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Delete Confirmation Modal -->
|
||
<div id="delete-modal" class="modal">
|
||
<div class="modal-overlay"></div>
|
||
<div class="modal-content modal-small">
|
||
<div class="modal-header">
|
||
<h3 class="modal-title">Confirm Deletion</h3>
|
||
<button class="modal-close">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<p>Are you sure you want to delete this time entry? This action cannot be undone.</p>
|
||
<input type="hidden" id="delete-entry-id">
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button id="confirm-delete" class="btn btn-danger">Delete Entry</button>
|
||
<button class="btn btn-ghost modal-cancel">Cancel</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<style>
|
||
/* Container */
|
||
.time-tracking-container {
|
||
max-width: 1400px;
|
||
margin: 0 auto;
|
||
padding: 2rem;
|
||
}
|
||
|
||
/* Page Header - reuse existing styles */
|
||
.page-header {
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
border-radius: 16px;
|
||
padding: 2rem;
|
||
color: white;
|
||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||
margin-bottom: 2rem;
|
||
}
|
||
|
||
.header-content {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
flex-wrap: wrap;
|
||
gap: 2rem;
|
||
}
|
||
|
||
.page-title {
|
||
font-size: 2rem;
|
||
font-weight: 700;
|
||
margin: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 0.75rem;
|
||
}
|
||
|
||
.page-icon {
|
||
font-size: 2.5rem;
|
||
display: inline-block;
|
||
animation: float 3s ease-in-out infinite;
|
||
}
|
||
|
||
@keyframes float {
|
||
0%, 100% { transform: translateY(0); }
|
||
50% { transform: translateY(-10px); }
|
||
}
|
||
|
||
.page-subtitle {
|
||
font-size: 1.1rem;
|
||
opacity: 0.9;
|
||
margin: 0.5rem 0 0 0;
|
||
}
|
||
|
||
.header-actions {
|
||
display: flex;
|
||
gap: 1rem;
|
||
}
|
||
|
||
/* Timer Section */
|
||
.timer-section {
|
||
margin-bottom: 2rem;
|
||
}
|
||
|
||
.timer-card {
|
||
background: white;
|
||
border-radius: 16px;
|
||
padding: 2rem;
|
||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
|
||
border: 1px solid #e5e7eb;
|
||
}
|
||
|
||
.timer-card.active {
|
||
border: 2px solid #10b981;
|
||
background: linear-gradient(135deg, #10b98110 0%, #059b6910 100%);
|
||
}
|
||
|
||
.timer-display {
|
||
text-align: center;
|
||
margin-bottom: 2rem;
|
||
}
|
||
|
||
.timer-value {
|
||
font-size: 4rem;
|
||
font-weight: 700;
|
||
color: #1f2937;
|
||
font-family: 'Monaco', 'Courier New', monospace;
|
||
letter-spacing: 0.1em;
|
||
}
|
||
|
||
.timer-status {
|
||
margin-top: 0.5rem;
|
||
}
|
||
|
||
.status-badge {
|
||
display: inline-block;
|
||
padding: 0.5rem 1rem;
|
||
border-radius: 20px;
|
||
font-size: 0.875rem;
|
||
font-weight: 600;
|
||
text-transform: uppercase;
|
||
}
|
||
|
||
.status-badge.active {
|
||
background: #10b981;
|
||
color: white;
|
||
}
|
||
|
||
.status-badge.paused {
|
||
background: #f59e0b;
|
||
color: white;
|
||
}
|
||
|
||
.timer-info {
|
||
background: #f8f9fa;
|
||
border-radius: 12px;
|
||
padding: 1.5rem;
|
||
margin-bottom: 1.5rem;
|
||
}
|
||
|
||
.info-row {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 0.5rem 0;
|
||
border-bottom: 1px solid #e5e7eb;
|
||
}
|
||
|
||
.info-row:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
.info-label {
|
||
font-weight: 600;
|
||
color: #6b7280;
|
||
}
|
||
|
||
.info-value {
|
||
color: #1f2937;
|
||
}
|
||
|
||
.project-badge {
|
||
display: inline-block;
|
||
padding: 0.25rem 0.75rem;
|
||
border-radius: 16px;
|
||
color: white;
|
||
font-size: 0.875rem;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.task-badge {
|
||
display: inline-block;
|
||
padding: 0.25rem 0.75rem;
|
||
background: #e5e7eb;
|
||
border-radius: 8px;
|
||
font-size: 0.875rem;
|
||
}
|
||
|
||
.timer-actions {
|
||
display: flex;
|
||
gap: 1rem;
|
||
justify-content: center;
|
||
}
|
||
|
||
/* Start Work Form */
|
||
.start-work-container {
|
||
text-align: center;
|
||
}
|
||
|
||
.start-work-container h2 {
|
||
font-size: 1.75rem;
|
||
color: #1f2937;
|
||
margin-bottom: 0.5rem;
|
||
}
|
||
|
||
.start-work-container p {
|
||
color: #6b7280;
|
||
margin-bottom: 2rem;
|
||
}
|
||
|
||
.modern-form {
|
||
max-width: 600px;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.form-row {
|
||
display: grid;
|
||
grid-template-columns: 1fr 1fr;
|
||
gap: 1rem;
|
||
}
|
||
|
||
.form-group {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 0.5rem;
|
||
}
|
||
|
||
.form-label {
|
||
font-weight: 600;
|
||
color: #374151;
|
||
font-size: 0.95rem;
|
||
}
|
||
|
||
.optional-badge {
|
||
background: #e5e7eb;
|
||
color: #6b7280;
|
||
padding: 0.125rem 0.5rem;
|
||
border-radius: 12px;
|
||
font-size: 0.75rem;
|
||
font-weight: 500;
|
||
margin-left: 0.5rem;
|
||
}
|
||
|
||
.form-control {
|
||
padding: 0.75rem 1rem;
|
||
border: 2px solid #e5e7eb;
|
||
border-radius: 8px;
|
||
font-size: 1rem;
|
||
transition: all 0.2s ease;
|
||
background-color: #f9fafb;
|
||
}
|
||
|
||
.form-control:focus {
|
||
outline: none;
|
||
border-color: #667eea;
|
||
background-color: white;
|
||
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
||
}
|
||
|
||
.form-actions {
|
||
margin-top: 1.5rem;
|
||
}
|
||
|
||
/* Stats Section */
|
||
.stats-section {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||
gap: 1.5rem;
|
||
margin-bottom: 2rem;
|
||
}
|
||
|
||
.stat-card {
|
||
background: white;
|
||
padding: 1.5rem;
|
||
border-radius: 12px;
|
||
text-align: center;
|
||
border: 1px solid #e5e7eb;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||
transition: all 0.3s ease;
|
||
}
|
||
|
||
.stat-card:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
|
||
}
|
||
|
||
.stat-value {
|
||
font-size: 2rem;
|
||
font-weight: 700;
|
||
margin-bottom: 0.5rem;
|
||
color: #667eea;
|
||
}
|
||
|
||
.stat-label {
|
||
font-size: 0.9rem;
|
||
color: #6b7280;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.5px;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* Entries Section */
|
||
.entries-section {
|
||
background: white;
|
||
border-radius: 16px;
|
||
padding: 2rem;
|
||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
|
||
border: 1px solid #e5e7eb;
|
||
}
|
||
|
||
.section-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-bottom: 2rem;
|
||
}
|
||
|
||
.section-title {
|
||
font-size: 1.5rem;
|
||
font-weight: 600;
|
||
color: #1f2937;
|
||
margin: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 0.5rem;
|
||
}
|
||
|
||
.view-toggle {
|
||
display: flex;
|
||
gap: 0.5rem;
|
||
}
|
||
|
||
.toggle-btn {
|
||
padding: 0.5rem 1rem;
|
||
border: 2px solid #e5e7eb;
|
||
background: white;
|
||
border-radius: 8px;
|
||
cursor: pointer;
|
||
transition: all 0.2s ease;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 0.25rem;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.toggle-btn.active {
|
||
background: #667eea;
|
||
color: white;
|
||
border-color: #667eea;
|
||
}
|
||
|
||
.view-container {
|
||
display: none;
|
||
}
|
||
|
||
.view-container.active {
|
||
display: block;
|
||
}
|
||
|
||
/* Table Styles */
|
||
.entries-table-container {
|
||
overflow-x: auto;
|
||
}
|
||
|
||
.entries-table {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
}
|
||
|
||
.entries-table th {
|
||
text-align: left;
|
||
padding: 1rem;
|
||
border-bottom: 2px solid #e5e7eb;
|
||
font-weight: 600;
|
||
color: #374151;
|
||
background: #f8f9fa;
|
||
}
|
||
|
||
.entries-table td {
|
||
padding: 1rem;
|
||
border-bottom: 1px solid #e5e7eb;
|
||
}
|
||
|
||
.entry-row:hover {
|
||
background: #f8f9fa;
|
||
}
|
||
|
||
.date-cell {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
text-align: center;
|
||
}
|
||
|
||
.date-day {
|
||
font-size: 1.25rem;
|
||
font-weight: 700;
|
||
color: #1f2937;
|
||
}
|
||
|
||
.date-month {
|
||
font-size: 0.875rem;
|
||
color: #6b7280;
|
||
text-transform: uppercase;
|
||
}
|
||
|
||
.time-cell {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 0.5rem;
|
||
font-family: 'Monaco', 'Courier New', monospace;
|
||
}
|
||
|
||
.time-separator {
|
||
color: #9ca3af;
|
||
}
|
||
|
||
.project-task-cell {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 0.5rem;
|
||
}
|
||
|
||
.project-tag {
|
||
display: inline-block;
|
||
padding: 0.25rem 0.5rem;
|
||
border-radius: 4px;
|
||
color: white;
|
||
font-size: 0.75rem;
|
||
font-weight: 600;
|
||
text-transform: uppercase;
|
||
}
|
||
|
||
.task-name,
|
||
.project-name {
|
||
color: #374151;
|
||
}
|
||
|
||
.no-project {
|
||
color: #9ca3af;
|
||
font-style: italic;
|
||
}
|
||
|
||
.duration-badge {
|
||
display: inline-block;
|
||
padding: 0.25rem 0.75rem;
|
||
background: #ede9fe;
|
||
color: #5b21b6;
|
||
border-radius: 16px;
|
||
font-weight: 600;
|
||
font-size: 0.875rem;
|
||
}
|
||
|
||
.break-duration {
|
||
color: #6b7280;
|
||
}
|
||
|
||
.notes-preview {
|
||
color: #6b7280;
|
||
font-size: 0.875rem;
|
||
}
|
||
|
||
.actions-cell {
|
||
display: flex;
|
||
gap: 0.5rem;
|
||
}
|
||
|
||
/* Grid View */
|
||
.entries-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
|
||
gap: 1.5rem;
|
||
}
|
||
|
||
.entry-card {
|
||
background: #f8f9fa;
|
||
border-radius: 12px;
|
||
padding: 1.5rem;
|
||
border: 1px solid #e5e7eb;
|
||
transition: all 0.3s ease;
|
||
}
|
||
|
||
.entry-card:hover {
|
||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
.entry-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-bottom: 1rem;
|
||
}
|
||
|
||
.entry-date {
|
||
font-weight: 600;
|
||
color: #374151;
|
||
}
|
||
|
||
.entry-duration {
|
||
font-size: 1.25rem;
|
||
font-weight: 700;
|
||
color: #667eea;
|
||
}
|
||
|
||
.entry-body {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 0.75rem;
|
||
}
|
||
|
||
.entry-project {
|
||
padding-left: 1rem;
|
||
border-left: 4px solid;
|
||
}
|
||
|
||
.entry-task,
|
||
.entry-time,
|
||
.entry-notes {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 0.5rem;
|
||
color: #6b7280;
|
||
font-size: 0.875rem;
|
||
}
|
||
|
||
.entry-footer {
|
||
display: flex;
|
||
gap: 0.5rem;
|
||
margin-top: 1rem;
|
||
padding-top: 1rem;
|
||
border-top: 1px solid #e5e7eb;
|
||
}
|
||
|
||
/* Buttons */
|
||
.btn {
|
||
padding: 0.75rem 1.5rem;
|
||
border: none;
|
||
border-radius: 8px;
|
||
font-weight: 600;
|
||
font-size: 1rem;
|
||
cursor: pointer;
|
||
transition: all 0.2s ease;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 0.5rem;
|
||
text-decoration: none;
|
||
}
|
||
|
||
.btn-large {
|
||
padding: 1rem 2rem;
|
||
font-size: 1.125rem;
|
||
}
|
||
|
||
.btn-sm {
|
||
padding: 0.5rem 1rem;
|
||
font-size: 0.875rem;
|
||
}
|
||
|
||
.btn-icon {
|
||
padding: 0.5rem;
|
||
border: 1px solid #e5e7eb;
|
||
background: white;
|
||
border-radius: 8px;
|
||
cursor: pointer;
|
||
transition: all 0.2s ease;
|
||
}
|
||
|
||
.btn-icon:hover {
|
||
background: #f3f4f6;
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
.btn-primary {
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
color: white;
|
||
}
|
||
|
||
.btn-primary:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
|
||
}
|
||
|
||
.btn-secondary {
|
||
background: white;
|
||
color: #4b5563;
|
||
border: 2px solid #e5e7eb;
|
||
}
|
||
|
||
.btn-secondary:hover {
|
||
background: #f3f4f6;
|
||
}
|
||
|
||
.btn-success {
|
||
background: #10b981;
|
||
color: white;
|
||
}
|
||
|
||
.btn-success:hover {
|
||
background: #059669;
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
.btn-warning {
|
||
background: #f59e0b;
|
||
color: white;
|
||
}
|
||
|
||
.btn-warning:hover {
|
||
background: #d97706;
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
.btn-danger {
|
||
background: #ef4444;
|
||
color: white;
|
||
}
|
||
|
||
.btn-danger:hover {
|
||
background: #dc2626;
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
.btn-ghost {
|
||
background: transparent;
|
||
color: #6b7280;
|
||
}
|
||
|
||
.btn-ghost:hover {
|
||
color: #374151;
|
||
background: #f3f4f6;
|
||
}
|
||
|
||
/* Empty State */
|
||
.empty-state {
|
||
text-align: center;
|
||
padding: 4rem 2rem;
|
||
}
|
||
|
||
.empty-icon {
|
||
font-size: 4rem;
|
||
margin-bottom: 1rem;
|
||
}
|
||
|
||
.empty-state h3 {
|
||
font-size: 1.5rem;
|
||
font-weight: 600;
|
||
color: #1f2937;
|
||
margin-bottom: 0.5rem;
|
||
}
|
||
|
||
.empty-state p {
|
||
color: #6b7280;
|
||
}
|
||
|
||
/* Modal Styles */
|
||
.modal {
|
||
display: none;
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
z-index: 1000;
|
||
}
|
||
|
||
.modal-overlay {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background: rgba(0, 0, 0, 0.5);
|
||
}
|
||
|
||
.modal-content {
|
||
position: relative;
|
||
background: white;
|
||
border-radius: 16px;
|
||
max-width: 600px;
|
||
margin: 5vh auto;
|
||
max-height: 90vh;
|
||
overflow-y: auto;
|
||
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
|
||
}
|
||
|
||
.modal-small {
|
||
max-width: 400px;
|
||
}
|
||
|
||
.modal-header {
|
||
padding: 2rem;
|
||
border-bottom: 1px solid #e5e7eb;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.modal-title {
|
||
font-size: 1.5rem;
|
||
font-weight: 600;
|
||
color: #1f2937;
|
||
margin: 0;
|
||
}
|
||
|
||
.modal-close {
|
||
background: none;
|
||
border: none;
|
||
font-size: 1.5rem;
|
||
cursor: pointer;
|
||
color: #6b7280;
|
||
width: 40px;
|
||
height: 40px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: 8px;
|
||
transition: all 0.2s ease;
|
||
}
|
||
|
||
.modal-close:hover {
|
||
background: #f3f4f6;
|
||
color: #1f2937;
|
||
}
|
||
|
||
.modal-body {
|
||
padding: 2rem;
|
||
}
|
||
|
||
.modal-footer {
|
||
padding: 1.5rem 2rem;
|
||
border-top: 1px solid #e5e7eb;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 1rem;
|
||
}
|
||
|
||
/* Responsive */
|
||
@media (max-width: 768px) {
|
||
.time-tracking-container {
|
||
padding: 1rem;
|
||
}
|
||
|
||
.form-row {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
|
||
.timer-value {
|
||
font-size: 3rem;
|
||
}
|
||
|
||
.entries-grid {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
|
||
.entries-table {
|
||
font-size: 0.875rem;
|
||
}
|
||
|
||
.entries-table th,
|
||
.entries-table td {
|
||
padding: 0.5rem;
|
||
}
|
||
}
|
||
</style>
|
||
|
||
<script src="{{ url_for('static', filename='js/timer.js') }}"></script>
|
||
<script src="{{ url_for('static', filename='js/time-tracking.js') }}"></script>
|
||
|
||
{% endif %}
|
||
|
||
{% endblock %} |