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.
611 lines
15 KiB
HTML
611 lines
15 KiB
HTML
{% extends "layout.html" %}
|
|
|
|
{% block content %}
|
|
<div class="container">
|
|
<div class="header-section">
|
|
<h1>🏢 {{ company.name }}</h1>
|
|
<p class="subtitle">Company Details - System Administrator View</p>
|
|
<div class="header-actions">
|
|
<a href="{{ url_for('system_admin.system_admin_companies') }}" class="btn btn-secondary">← Back to Companies</a>
|
|
<a href="{{ url_for('system_admin.system_admin_dashboard') }}" class="btn btn-secondary">Dashboard</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Company Information -->
|
|
<div class="info-section">
|
|
<h3>📋 Company Information</h3>
|
|
<div class="info-grid">
|
|
<div class="info-item">
|
|
<label>Company Name:</label>
|
|
<span>{{ company.name }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<label>Slug:</label>
|
|
<span>{{ company.slug }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<label>Type:</label>
|
|
{% if company.is_personal %}
|
|
<span class="badge badge-freelancer">Personal/Freelancer</span>
|
|
{% else %}
|
|
<span class="badge badge-company">Business Company</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="info-item">
|
|
<label>Status:</label>
|
|
{% if company.is_active %}
|
|
<span class="status-badge status-active">Active</span>
|
|
{% else %}
|
|
<span class="status-badge status-inactive">Inactive</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="info-item">
|
|
<label>Created:</label>
|
|
<span>{{ company.created_at.strftime('%Y-%m-%d %H:%M') }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<label>Max Users:</label>
|
|
<span>{{ company.max_users or 'Unlimited' }}</span>
|
|
</div>
|
|
{% if company.description %}
|
|
<div class="info-item full-width">
|
|
<label>Description:</label>
|
|
<span>{{ company.description }}</span>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Statistics Overview -->
|
|
<div class="stats-section">
|
|
<h3>📊 Company Statistics</h3>
|
|
<div class="stats-grid">
|
|
<div class="stat-card">
|
|
<h4>{{ users|length }}</h4>
|
|
<p>Total Users</p>
|
|
</div>
|
|
<div class="stat-card">
|
|
<h4>{{ teams|length }}</h4>
|
|
<p>Teams</p>
|
|
</div>
|
|
<div class="stat-card">
|
|
<h4>{{ projects|length }}</h4>
|
|
<p>Projects</p>
|
|
</div>
|
|
<div class="stat-card">
|
|
<h4>{{ recent_time_entries }}</h4>
|
|
<p>Recent Time Entries</p>
|
|
<small>(Last 7 days)</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Role Distribution -->
|
|
{% if role_counts %}
|
|
<div class="role-section">
|
|
<h3>👥 Role Distribution</h3>
|
|
<div class="role-grid">
|
|
{% for role, count in role_counts.items() %}
|
|
<div class="role-card">
|
|
<span class="role-count">{{ count }}</span>
|
|
<span class="role-name">{{ role }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="content-grid">
|
|
<!-- Users List -->
|
|
<div class="content-card">
|
|
<h3>👤 Users ({{ users|length }})</h3>
|
|
{% if users %}
|
|
<div class="list-container">
|
|
{% for user in users[:10] %}
|
|
<div class="list-item">
|
|
<div class="item-info">
|
|
<strong>{{ user.username }}</strong>
|
|
<small>{{ user.email }}</small>
|
|
</div>
|
|
<div class="item-meta">
|
|
<span class="role-badge role-{{ user.role.name.lower() }}">
|
|
{{ user.role.value }}
|
|
</span>
|
|
{% if user.is_blocked %}
|
|
<span class="status-badge status-blocked">Blocked</span>
|
|
{% elif not user.is_verified %}
|
|
<span class="status-badge status-unverified">Unverified</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% if users|length > 10 %}
|
|
<div class="list-more">
|
|
<a href="{{ url_for('users.system_admin_users', company=company.id) }}" class="btn btn-sm btn-outline">
|
|
View All {{ users|length }} Users →
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% else %}
|
|
<p class="empty-message">No users in this company.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Teams List -->
|
|
<div class="content-card">
|
|
<h3>🏭 Teams ({{ teams|length }})</h3>
|
|
{% if teams %}
|
|
<div class="list-container">
|
|
{% for team in teams %}
|
|
<div class="list-item">
|
|
<div class="item-info">
|
|
<strong>{{ team.name }}</strong>
|
|
{% if team.description %}
|
|
<small>{{ team.description }}</small>
|
|
{% endif %}
|
|
</div>
|
|
<div class="item-meta">
|
|
<small>{{ team.created_at.strftime('%Y-%m-%d') }}</small>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<p class="empty-message">No teams in this company.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Projects List -->
|
|
<div class="content-card">
|
|
<h3>📝 Projects ({{ projects|length }})</h3>
|
|
{% if projects %}
|
|
<div class="list-container">
|
|
{% for project in projects[:10] %}
|
|
<div class="list-item">
|
|
<div class="item-info">
|
|
<strong>{{ project.name }}</strong>
|
|
<small>{{ project.code }}</small>
|
|
{% if project.description %}
|
|
<small>{{ project.description[:50] }}{% if project.description|length > 50 %}...{% endif %}</small>
|
|
{% endif %}
|
|
</div>
|
|
<div class="item-meta">
|
|
{% if project.is_active %}
|
|
<span class="status-badge status-active">Active</span>
|
|
{% else %}
|
|
<span class="status-badge status-inactive">Inactive</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% if projects|length > 10 %}
|
|
<div class="list-more">
|
|
<p class="text-muted">And {{ projects|length - 10 }} more projects...</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% else %}
|
|
<p class="empty-message">No projects in this company.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Management Actions -->
|
|
<div class="actions-section">
|
|
<h3>🛠️ Management Actions</h3>
|
|
<div class="actions-grid">
|
|
<a href="{{ url_for('users.system_admin_users', company=company.id) }}" class="action-card">
|
|
<div class="action-icon">👥</div>
|
|
<div class="action-content">
|
|
<h4>Manage Users</h4>
|
|
<p>View and edit all users in this company</p>
|
|
</div>
|
|
</a>
|
|
<a href="{{ url_for('system_admin.system_admin_time_entries', company=company.id) }}" class="action-card">
|
|
<div class="action-icon">⏱️</div>
|
|
<div class="action-content">
|
|
<h4>View Time Entries</h4>
|
|
<p>Browse time tracking data for this company</p>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Danger Zone -->
|
|
<div class="danger-section">
|
|
<h3>⚠️ Danger Zone</h3>
|
|
<div class="danger-content">
|
|
<p><strong>Delete Company</strong></p>
|
|
<p>Once you delete a company, there is no going back. This will permanently delete:</p>
|
|
<ul>
|
|
<li>All users in the company</li>
|
|
<li>All projects, tasks, and time entries</li>
|
|
<li>All teams and settings</li>
|
|
</ul>
|
|
<form method="POST" action="{{ url_for('system_admin.delete_company', company_id=company.id) }}" onsubmit="return confirm('Are you absolutely sure you want to delete {{ company.name }}? This action cannot be undone!');">
|
|
<button type="submit" class="btn btn-danger">Delete This Company</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.header-section {
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.subtitle {
|
|
color: #6c757d;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.header-actions {
|
|
display: flex;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.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-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.info-item.full-width {
|
|
grid-column: 1 / -1;
|
|
}
|
|
|
|
.info-item label {
|
|
font-weight: 600;
|
|
color: #6c757d;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.stats-section {
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.stats-section h3 {
|
|
margin-bottom: 1rem;
|
|
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;
|
|
}
|
|
|
|
.stat-card small {
|
|
display: block;
|
|
color: #6c757d;
|
|
font-size: 0.75rem;
|
|
margin-top: 0.25rem;
|
|
}
|
|
|
|
.role-section {
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.role-section h3 {
|
|
margin-bottom: 1rem;
|
|
color: #495057;
|
|
}
|
|
|
|
.role-grid {
|
|
display: flex;
|
|
gap: 1rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.role-card {
|
|
background: white;
|
|
border: 1px solid #dee2e6;
|
|
border-radius: 8px;
|
|
padding: 1rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
min-width: 120px;
|
|
}
|
|
|
|
.role-count {
|
|
font-size: 1.5rem;
|
|
font-weight: 600;
|
|
color: #007bff;
|
|
}
|
|
|
|
.role-name {
|
|
font-size: 0.875rem;
|
|
color: #6c757d;
|
|
text-align: center;
|
|
}
|
|
|
|
.content-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
|
gap: 2rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.content-card {
|
|
background: white;
|
|
border: 1px solid #dee2e6;
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.content-card h3 {
|
|
margin-top: 0;
|
|
margin-bottom: 1rem;
|
|
color: #495057;
|
|
}
|
|
|
|
.list-container {
|
|
max-height: 400px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.list-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 0.75rem 0;
|
|
border-bottom: 1px solid #e9ecef;
|
|
}
|
|
|
|
.list-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.item-info {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.item-info strong {
|
|
color: #495057;
|
|
}
|
|
|
|
.item-info small {
|
|
color: #6c757d;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.item-meta {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-end;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.list-more {
|
|
padding: 1rem 0;
|
|
text-align: center;
|
|
border-top: 1px solid #e9ecef;
|
|
}
|
|
|
|
.empty-message {
|
|
color: #6c757d;
|
|
font-style: italic;
|
|
text-align: center;
|
|
padding: 2rem;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.badge, .status-badge, .role-badge {
|
|
padding: 0.25rem 0.5rem;
|
|
border-radius: 4px;
|
|
font-size: 0.75rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.badge-company {
|
|
background: #d1ecf1;
|
|
color: #0c5460;
|
|
}
|
|
|
|
.badge-freelancer {
|
|
background: #d4edda;
|
|
color: #155724;
|
|
}
|
|
|
|
.status-active {
|
|
background: #d4edda;
|
|
color: #155724;
|
|
}
|
|
|
|
.status-inactive {
|
|
background: #f8d7da;
|
|
color: #721c24;
|
|
}
|
|
|
|
.status-blocked {
|
|
background: #f8d7da;
|
|
color: #721c24;
|
|
}
|
|
|
|
.status-unverified {
|
|
background: #fff3cd;
|
|
color: #856404;
|
|
}
|
|
|
|
.role-team_member {
|
|
background: #e2e3e5;
|
|
color: #495057;
|
|
}
|
|
|
|
.role-team_leader {
|
|
background: #d4edda;
|
|
color: #155724;
|
|
}
|
|
|
|
.role-supervisor {
|
|
background: #d1ecf1;
|
|
color: #0c5460;
|
|
}
|
|
|
|
.role-admin {
|
|
background: #fff3cd;
|
|
color: #856404;
|
|
}
|
|
|
|
.role-system_admin {
|
|
background: #f1c0e8;
|
|
color: #6a1b99;
|
|
}
|
|
|
|
/* 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;
|
|
}
|
|
|
|
.text-muted {
|
|
color: #6c757d;
|
|
}
|
|
|
|
/* Danger Zone */
|
|
.danger-section {
|
|
margin-top: 3rem;
|
|
padding: 1.5rem;
|
|
background-color: #fef2f2;
|
|
border: 1px solid #fecaca;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.danger-section h3 {
|
|
color: #dc2626;
|
|
margin-top: 0;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.danger-content {
|
|
color: #7f1d1d;
|
|
}
|
|
|
|
.danger-content p {
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.danger-content ul {
|
|
margin: 1rem 0 1.5rem 2rem;
|
|
}
|
|
|
|
.danger-content .btn-danger {
|
|
background-color: #dc2626;
|
|
color: white;
|
|
border: none;
|
|
padding: 0.5rem 1.5rem;
|
|
}
|
|
|
|
.danger-content .btn-danger:hover {
|
|
background-color: #b91c1c;
|
|
}
|
|
</style>
|
|
{% endblock %} |