Files
TimeTrack/templates/system_admin_settings.html
Jens Luedicke 9a79778ad6 Squashed commit of the following:
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.
2025-07-07 21:16:36 +02:00

517 lines
14 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "layout.html" %}
{% block content %}
<div class="container">
<div class="header-section">
<h1>⚙️ System Administrator Settings</h1>
<p class="subtitle">Global system configuration and management</p>
<a href="{{ url_for('system_admin.system_admin_dashboard') }}" class="btn btn-secondary">← Back to Dashboard</a>
</div>
<!-- System Statistics -->
<div class="stats-section">
<h3>📊 System Overview</h3>
<div class="stats-grid">
<div class="stat-card">
<h4>{{ total_companies }}</h4>
<p>Total Companies</p>
</div>
<div class="stat-card">
<h4>{{ total_users }}</h4>
<p>Total Users</p>
</div>
<div class="stat-card">
<h4>{{ total_system_admins }}</h4>
<p>System Administrators</p>
</div>
</div>
</div>
<!-- System Settings Form -->
<div class="settings-section">
<h3>🔧 System Configuration</h3>
<form method="POST" class="settings-form">
<div class="setting-group">
<div class="setting-header">
<h4>User Registration</h4>
<p>Control whether new users can register accounts</p>
</div>
<div class="setting-control">
<label class="toggle-label">
<input type="checkbox" name="registration_enabled"
{% if settings.get('registration_enabled', True) %}checked{% endif %}>
<span class="toggle-slider"></span>
<span class="toggle-text">Allow new user registration</span>
</label>
<small class="setting-description">
When enabled, new users can create accounts through the registration page.
When disabled, only administrators can create new user accounts.
</small>
</div>
</div>
<div class="setting-group">
<div class="setting-header">
<h4>Email Verification</h4>
<p>Require email verification for new accounts</p>
</div>
<div class="setting-control">
<label class="toggle-label">
<input type="checkbox" name="email_verification_required"
{% if settings.get('email_verification_required', True) %}checked{% endif %}>
<span class="toggle-slider"></span>
<span class="toggle-text">Require email verification</span>
</label>
<small class="setting-description">
When enabled, new users must verify their email address before they can log in.
This helps ensure valid email addresses and improves security.
</small>
</div>
</div>
<div class="setting-group">
<div class="setting-header">
<h4>Tracking Script</h4>
<p>Enable custom tracking script (e.g., Google Analytics)</p>
</div>
<div class="setting-control">
<label class="toggle-label">
<input type="checkbox" name="tracking_script_enabled"
{% if settings.get('tracking_script_enabled', False) %}checked{% endif %}>
<span class="toggle-slider"></span>
<span class="toggle-text">Enable tracking script</span>
</label>
<small class="setting-description">
When enabled, the custom tracking script will be included on all pages.
Use this for analytics tracking, monitoring, or other custom JavaScript.
</small>
</div>
</div>
<div class="setting-group full-width">
<div class="setting-header">
<h4>Tracking Script Code</h4>
<p>Enter your tracking script code (HTML/JavaScript)</p>
</div>
<div class="setting-control">
<textarea name="tracking_script_code"
class="form-control code-textarea"
rows="8"
placeholder="<!-- Paste your tracking script here (e.g., Google Analytics, custom JavaScript) -->"
>{{ settings.get('tracking_script_code', '') }}</textarea>
<small class="setting-description">
This code will be inserted at the bottom of every page before the closing &lt;/body&gt; tag.
Common use cases: Google Analytics, Facebook Pixel, custom JavaScript, monitoring scripts.
</small>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save Settings</button>
<a href="{{ url_for('system_admin.system_admin_dashboard') }}" class="btn btn-secondary">Cancel</a>
</div>
</form>
</div>
<!-- System Information -->
<div class="info-section">
<h3> System Information</h3>
<div class="info-grid">
<div class="info-card">
<h4>Application Version</h4>
<p>{{ g.branding.app_name }} v1.0</p>
</div>
<div class="info-card">
<h4>Database</h4>
<p>PostgreSQL</p>
</div>
<div class="info-card">
<h4>System Admin Access</h4>
<p>Full system control</p>
</div>
</div>
</div>
<!-- Danger Zone -->
<div class="danger-section">
<h3>⚠️ Danger Zone</h3>
<div class="danger-content">
<div class="danger-item">
<div class="danger-info">
<h4>System Maintenance</h4>
<p>Advanced system operations should be performed with caution.
Always backup the database before making significant changes.</p>
</div>
<div class="danger-actions">
<button class="btn btn-danger" onclick="alert('Database backup functionality would be implemented here.')">
Backup Database
</button>
</div>
</div>
<div class="danger-item">
<div class="danger-info">
<h4>System Health Check</h4>
<p>Run diagnostic checks to identify potential issues with the system.</p>
</div>
<div class="danger-actions">
<a href="{{ url_for('system_admin.system_admin_health') }}" class="btn btn-warning">
Run Health Check
</a>
</div>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="actions-section">
<h3>🚀 Quick Actions</h3>
<div class="actions-grid">
<a href="{{ url_for('users.system_admin_users') }}" class="action-card">
<div class="action-icon">👥</div>
<div class="action-content">
<h4>Manage All Users</h4>
<p>View, edit, and manage users across all companies</p>
</div>
</a>
<a href="{{ url_for('system_admin.system_admin_companies') }}" class="action-card">
<div class="action-icon">🏢</div>
<div class="action-content">
<h4>Manage Companies</h4>
<p>View and manage all companies in the system</p>
</div>
</a>
<a href="{{ url_for('system_admin.system_admin_time_entries') }}" class="action-card">
<div class="action-icon">⏱️</div>
<div class="action-content">
<h4>View Time Entries</h4>
<p>Browse time tracking data across all companies</p>
</div>
</a>
</div>
</div>
</div>
<style>
.header-section {
margin-bottom: 2rem;
}
.subtitle {
color: #6c757d;
margin-bottom: 1rem;
}
.stats-section {
background: #f8f9fa;
border-radius: 8px;
padding: 2rem;
margin-bottom: 2rem;
}
.stats-section h3 {
margin-top: 0;
margin-bottom: 1.5rem;
color: #495057;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.stat-card {
background: white;
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 1.5rem;
text-align: center;
}
.stat-card h4 {
font-size: 2rem;
margin: 0 0 0.5rem 0;
color: #007bff;
}
.stat-card p {
margin: 0;
color: #6c757d;
font-weight: 500;
}
.settings-section {
background: white;
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 2rem;
margin-bottom: 2rem;
}
.settings-section h3 {
margin-top: 0;
margin-bottom: 1.5rem;
color: #495057;
}
.settings-form {
display: flex;
flex-direction: column;
gap: 2rem;
}
.setting-group {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
padding: 1.5rem;
border: 1px solid #e9ecef;
border-radius: 8px;
}
.setting-group.full-width {
grid-template-columns: 1fr;
}
.code-textarea {
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 0.875rem;
line-height: 1.4;
background: #f8f9fa;
border: 1px solid #ced4da;
border-radius: 4px;
padding: 0.75rem;
resize: vertical;
min-height: 120px;
}
.form-control {
width: 100%;
box-sizing: border-box;
}
.setting-header h4 {
margin: 0 0 0.5rem 0;
color: #495057;
}
.setting-header p {
margin: 0;
color: #6c757d;
font-size: 0.9rem;
}
.toggle-label {
display: flex;
align-items: center;
gap: 1rem;
cursor: pointer;
margin-bottom: 0.5rem;
}
.toggle-label input[type="checkbox"] {
display: none;
}
.toggle-slider {
position: relative;
width: 50px;
height: 24px;
background: #ccc;
border-radius: 24px;
transition: background 0.3s;
}
.toggle-slider::before {
content: '';
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
background: white;
top: 2px;
left: 2px;
transition: transform 0.3s;
}
.toggle-label input[type="checkbox"]:checked + .toggle-slider {
background: #007bff;
}
.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
transform: translateX(26px);
}
.toggle-text {
font-weight: 500;
color: #495057;
}
.setting-description {
color: #6c757d;
font-size: 0.875rem;
line-height: 1.4;
}
.form-actions {
display: flex;
gap: 1rem;
padding-top: 1rem;
border-top: 1px solid #e9ecef;
}
.info-section {
background: #f8f9fa;
border-radius: 8px;
padding: 2rem;
margin-bottom: 2rem;
}
.info-section h3 {
margin-top: 0;
margin-bottom: 1.5rem;
color: #495057;
}
.info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
}
.info-card {
background: white;
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 1.5rem;
}
.info-card h4 {
margin: 0 0 0.5rem 0;
color: #495057;
font-size: 1rem;
}
.info-card p {
margin: 0;
color: #6c757d;
}
.danger-section {
background: #f8d7da;
border: 2px solid #dc3545;
border-radius: 8px;
padding: 2rem;
margin-bottom: 2rem;
}
.danger-section h3 {
margin-top: 0;
margin-bottom: 1.5rem;
color: #721c24;
}
.danger-content {
display: flex;
flex-direction: column;
gap: 1rem;
}
.danger-item {
display: flex;
justify-content: space-between;
align-items: center;
background: white;
padding: 1.5rem;
border-radius: 8px;
border: 1px solid #dc3545;
}
.danger-info h4 {
margin: 0 0 0.5rem 0;
color: #721c24;
}
.danger-info p {
margin: 0;
color: #721c24;
font-size: 0.9rem;
}
.actions-section {
background: #f8f9fa;
border-radius: 8px;
padding: 2rem;
}
.actions-section h3 {
margin-top: 0;
margin-bottom: 1.5rem;
color: #495057;
}
.actions-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1rem;
}
.action-card {
background: white;
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 1.5rem;
display: flex;
align-items: center;
gap: 1rem;
text-decoration: none;
color: inherit;
transition: all 0.2s;
}
.action-card:hover {
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
text-decoration: none;
color: inherit;
}
.action-icon {
font-size: 2rem;
width: 60px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
background: #f8f9fa;
border-radius: 8px;
}
.action-content h4 {
margin: 0 0 0.5rem 0;
color: #495057;
}
.action-content p {
margin: 0;
color: #6c757d;
font-size: 0.875rem;
}
/* Button styles now centralized in main style.css */
@media (max-width: 768px) {
.setting-group {
grid-template-columns: 1fr;
}
.danger-item {
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}
}
</style>
{% endblock %}