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.
405 lines
11 KiB
HTML
405 lines
11 KiB
HTML
{% extends "layout.html" %}
|
|
|
|
{% block content %}
|
|
<div class="container">
|
|
<div class="header-section">
|
|
<h1>⏱️ System Admin - Time Entries</h1>
|
|
<p class="subtitle">View time entries across all companies</p>
|
|
<a href="{{ url_for('system_admin.system_admin_dashboard') }}" class="btn btn-secondary">← Back to Dashboard</a>
|
|
</div>
|
|
|
|
<!-- Filter Section -->
|
|
<div class="filter-section">
|
|
<h3>Filter Time Entries</h3>
|
|
<form method="GET" class="filter-form">
|
|
<div class="filter-group">
|
|
<label for="company">Company:</label>
|
|
<select name="company" id="company" class="form-control" onchange="this.form.submit()">
|
|
<option value="">All Companies</option>
|
|
{% for company in companies %}
|
|
<option value="{{ company.id }}" {% if current_company|string == company.id|string %}selected{% endif %}>
|
|
{{ company.name }}
|
|
{% if company.is_personal %}(Personal){% endif %}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
{% if current_company %}
|
|
<a href="{{ url_for('system_admin.system_admin_time_entries') }}" class="btn btn-sm btn-outline">Clear Filter</a>
|
|
{% endif %}
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Time Entries Table -->
|
|
{% if entries.items %}
|
|
<div class="table-section">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>User</th>
|
|
<th>Company</th>
|
|
<th>Project</th>
|
|
<th>Arrival</th>
|
|
<th>Departure</th>
|
|
<th>Duration</th>
|
|
<th>Status</th>
|
|
<th>Notes</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for entry_data in entries.items %}
|
|
{% set entry = entry_data[0] %}
|
|
{% set username = entry_data[1] %}
|
|
{% set company_name = entry_data[2] %}
|
|
{% set project_name = entry_data[3] %}
|
|
<tr class="{% if entry.is_paused %}paused-entry{% endif %}">
|
|
<td>
|
|
<strong>{{ username }}</strong>
|
|
</td>
|
|
<td>
|
|
<span class="company-name">{{ company_name }}</span>
|
|
</td>
|
|
<td>
|
|
{% if project_name %}
|
|
<span class="project-name">{{ project_name }}</span>
|
|
{% else %}
|
|
<span class="text-muted">No project</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ entry.arrival_time.strftime('%Y-%m-%d %H:%M') }}</td>
|
|
<td>
|
|
{% if entry.departure_time %}
|
|
{{ entry.departure_time.strftime('%Y-%m-%d %H:%M') }}
|
|
{% else %}
|
|
<span class="text-muted">Still working</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if entry.duration %}
|
|
{% set hours = entry.duration // 3600 %}
|
|
{% set minutes = (entry.duration % 3600) // 60 %}
|
|
<span class="duration">{{ hours }}h {{ minutes }}m</span>
|
|
{% else %}
|
|
<span class="text-muted">Ongoing</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if entry.is_paused %}
|
|
<span class="status-badge status-paused">Paused</span>
|
|
{% elif not entry.departure_time %}
|
|
<span class="status-badge status-active">Active</span>
|
|
{% else %}
|
|
<span class="status-badge status-completed">Completed</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if entry.notes %}
|
|
<span class="notes" title="{{ entry.notes }}">
|
|
{{ entry.notes[:30] }}{% if entry.notes|length > 30 %}...{% endif %}
|
|
</span>
|
|
{% else %}
|
|
<span class="text-muted">No notes</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
{% if entries.pages > 1 %}
|
|
<div class="pagination-section">
|
|
<div class="pagination">
|
|
{% if entries.has_prev %}
|
|
<a href="{{ url_for('system_admin.system_admin_time_entries', page=entries.prev_num, company=current_company) }}" class="page-link">← Previous</a>
|
|
{% endif %}
|
|
|
|
{% for page_num in entries.iter_pages() %}
|
|
{% if page_num %}
|
|
{% if page_num != entries.page %}
|
|
<a href="{{ url_for('system_admin.system_admin_time_entries', page=page_num, company=current_company) }}" class="page-link">{{ page_num }}</a>
|
|
{% else %}
|
|
<span class="page-link current">{{ page_num }}</span>
|
|
{% endif %}
|
|
{% else %}
|
|
<span class="page-link">…</span>
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% if entries.has_next %}
|
|
<a href="{{ url_for('system_admin.system_admin_time_entries', page=entries.next_num, company=current_company) }}" class="page-link">Next →</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<p class="pagination-info">
|
|
Showing {{ entries.per_page * (entries.page - 1) + 1 }} -
|
|
{{ entries.per_page * (entries.page - 1) + entries.items|length }} of {{ entries.total }} time entries
|
|
</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
<div class="empty-state">
|
|
<h3>No time entries found</h3>
|
|
{% if current_company %}
|
|
<p>No time entries found for the selected company.</p>
|
|
{% else %}
|
|
<p>No time entries exist in the system yet.</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Summary Statistics -->
|
|
{% if entries.items %}
|
|
<div class="summary-section">
|
|
<h3>📊 Summary Statistics</h3>
|
|
<div class="summary-grid">
|
|
<div class="summary-card">
|
|
<h4>Total Entries</h4>
|
|
<p class="summary-number">{{ entries.total }}</p>
|
|
</div>
|
|
<div class="summary-card">
|
|
<h4>Active Sessions</h4>
|
|
<p class="summary-number">{{ entries.items | selectattr('0.departure_time', 'equalto', None) | list | length }}</p>
|
|
</div>
|
|
<div class="summary-card">
|
|
<h4>Paused Sessions</h4>
|
|
<p class="summary-number">{{ entries.items | selectattr('0.is_paused', 'equalto', True) | list | length }}</p>
|
|
</div>
|
|
<div class="summary-card">
|
|
<h4>Completed Today</h4>
|
|
<p class="summary-number">
|
|
{{ entries.items | selectattr('0.arrival_time') | selectattr('0.departure_time', 'defined') |
|
|
list | length }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<style>
|
|
.header-section {
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.subtitle {
|
|
color: #6c757d;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.filter-section {
|
|
background: #f8f9fa;
|
|
padding: 1.5rem;
|
|
border-radius: 8px;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.filter-section h3 {
|
|
margin-top: 0;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.filter-form {
|
|
display: flex;
|
|
align-items: end;
|
|
gap: 1rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.filter-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.filter-group label {
|
|
font-weight: 500;
|
|
color: #495057;
|
|
}
|
|
|
|
.form-control {
|
|
padding: 0.5rem;
|
|
border: 1px solid #ced4da;
|
|
border-radius: 4px;
|
|
font-size: 1rem;
|
|
min-width: 200px;
|
|
}
|
|
|
|
.table-section {
|
|
background: white;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin: 0;
|
|
}
|
|
|
|
.table th,
|
|
.table td {
|
|
padding: 0.75rem;
|
|
text-align: left;
|
|
border-bottom: 1px solid #dee2e6;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.table th {
|
|
background: #f8f9fa;
|
|
font-weight: 600;
|
|
color: #495057;
|
|
}
|
|
|
|
.paused-entry {
|
|
background-color: #fff3cd !important;
|
|
}
|
|
|
|
.company-name {
|
|
font-weight: 500;
|
|
color: #495057;
|
|
}
|
|
|
|
.project-name {
|
|
color: #007bff;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.duration {
|
|
font-weight: 600;
|
|
color: #28a745;
|
|
}
|
|
|
|
.notes {
|
|
color: #6c757d;
|
|
font-style: italic;
|
|
}
|
|
|
|
.text-muted {
|
|
color: #6c757d;
|
|
}
|
|
|
|
.status-badge {
|
|
padding: 0.25rem 0.5rem;
|
|
border-radius: 4px;
|
|
font-size: 0.75rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.status-active {
|
|
background: #d4edda;
|
|
color: #155724;
|
|
}
|
|
|
|
.status-paused {
|
|
background: #fff3cd;
|
|
color: #856404;
|
|
}
|
|
|
|
.status-completed {
|
|
background: #d1ecf1;
|
|
color: #0c5460;
|
|
}
|
|
|
|
.pagination-section {
|
|
margin: 2rem 0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.pagination {
|
|
display: flex;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.page-link {
|
|
padding: 0.5rem 0.75rem;
|
|
border: 1px solid #dee2e6;
|
|
color: #007bff;
|
|
text-decoration: none;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.page-link:hover {
|
|
background: #e9ecef;
|
|
}
|
|
|
|
.page-link.current {
|
|
background: #007bff;
|
|
color: white;
|
|
border-color: #007bff;
|
|
}
|
|
|
|
.pagination-info {
|
|
color: #6c757d;
|
|
margin: 0;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 3rem;
|
|
color: #6c757d;
|
|
}
|
|
|
|
.summary-section {
|
|
background: #f8f9fa;
|
|
border-radius: 8px;
|
|
padding: 2rem;
|
|
}
|
|
|
|
.summary-section h3 {
|
|
margin-top: 0;
|
|
margin-bottom: 1.5rem;
|
|
color: #495057;
|
|
}
|
|
|
|
.summary-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 1rem;
|
|
}
|
|
|
|
.summary-card {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
text-align: center;
|
|
border: 1px solid #dee2e6;
|
|
}
|
|
|
|
.summary-card h4 {
|
|
margin: 0 0 0.5rem 0;
|
|
color: #6c757d;
|
|
font-size: 0.875rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.summary-number {
|
|
font-size: 2rem;
|
|
font-weight: 600;
|
|
color: #007bff;
|
|
margin: 0;
|
|
}
|
|
|
|
/* Button styles now centralized in main style.css */
|
|
|
|
.btn-outline {
|
|
background: transparent;
|
|
color: #007bff;
|
|
border: 1px solid #007bff;
|
|
}
|
|
|
|
.btn-outline:hover {
|
|
background: #007bff;
|
|
color: white;
|
|
}
|
|
</style>
|
|
{% endblock %} |