Initial commit: Quality App v2 - FG Scan Module with Reports

This commit is contained in:
Quality App Developer
2026-01-25 22:25:18 +02:00
commit 3c5a273a89
66 changed files with 15368 additions and 0 deletions

352
app/static/css/base.css Normal file
View File

@@ -0,0 +1,352 @@
/* Base Styles */
:root {
--primary-color: #667eea;
--secondary-color: #764ba2;
--success-color: #48bb78;
--danger-color: #f56565;
--warning-color: #ed8936;
--info-color: #4299e1;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f7f9fc;
color: #333;
display: flex;
flex-direction: column;
margin: 0;
padding: 0;
height: 100%;
}
html {
height: 100%;
display: flex;
flex-direction: column;
margin: 0;
padding: 0;
}
/* Main Layout */
.main-content {
flex: 1;
display: block;
min-height: calc(100vh - 80px);
width: 100%;
padding-bottom: 120px;
}
.footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #f8f9fa;
border-top: 1px solid #dee2e6;
padding: 20px 0;
width: 100%;
z-index: 1000;
}
/* Navigation Bar */
.navbar-dark {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.navbar-brand {
font-weight: 700;
font-size: 20px;
letter-spacing: 0.5px;
}
.navbar-brand i {
margin-right: 8px;
}
/* Cards and Containers */
.card {
border: none;
border-radius: 12px;
transition: all 0.3s ease;
}
.card:hover {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
/* Welcome Card */
.welcome-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-radius: 12px;
box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}
.welcome-card h1 {
font-weight: 700;
margin-bottom: 10px;
}
/* Stat Cards */
.stat-card {
background: white;
border-radius: 12px;
padding: 20px;
display: flex;
align-items: center;
gap: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
}
.stat-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.stat-icon {
width: 60px;
height: 60px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 24px;
}
.stat-content h3 {
margin: 0;
font-size: 28px;
font-weight: 700;
color: #333;
}
.stat-content p {
margin: 5px 0 0 0;
color: #999;
font-size: 14px;
}
/* Module Cards */
.module-card {
border: none;
border-radius: 12px;
transition: all 0.3s ease;
cursor: pointer;
}
.module-card:hover {
transform: translateY(-8px);
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}
.module-icon {
font-size: 48px;
transition: all 0.3s ease;
}
.module-card:hover .module-icon {
transform: scale(1.1);
}
.module-card .card-title {
font-weight: 700;
color: #333;
margin-top: 10px;
}
.module-card .card-text {
font-size: 14px;
}
/* Alerts */
.alert {
border: none;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.alert-success {
background-color: #f0fdf4;
color: #166534;
border-left: 4px solid #22c55e;
}
.alert-danger {
background-color: #fef2f2;
color: #991b1b;
border-left: 4px solid #ef4444;
}
.alert-warning {
background-color: #fffbeb;
color: #92400e;
border-left: 4px solid #f59e0b;
}
.alert-info {
background-color: #f0f9ff;
color: #0c2d6b;
border-left: 4px solid #3b82f6;
}
/* Buttons */
.btn {
border-radius: 8px;
font-weight: 600;
padding: 10px 20px;
transition: all 0.3s ease;
}
.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
color: white;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
color: white;
}
.btn-success {
background-color: #48bb78;
border: none;
color: white;
}
.btn-success:hover {
background-color: #38a169;
color: white;
}
/* Tables */
.table {
border-collapse: collapse;
}
.table thead th {
background-color: #f8f9fa;
font-weight: 600;
color: #555;
border: none;
padding: 15px;
}
.table tbody td {
padding: 15px;
border-bottom: 1px solid #e0e0e0;
}
.table tbody tr:hover {
background-color: #f9f9f9;
}
/* Forms */
.form-control, .form-select {
border-radius: 8px;
border: 1px solid #e0e0e0;
padding: 10px 15px;
font-size: 15px;
transition: all 0.3s ease;
}
.form-control:focus, .form-select:focus {
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-label {
font-weight: 600;
color: #555;
margin-bottom: 8px;
}
/* List Groups */
.list-group-item {
border: 1px solid #e0e0e0;
border-radius: 8px;
margin-bottom: 8px;
padding: 12px 16px;
transition: all 0.3s ease;
}
.list-group-item:first-child {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.list-group-item:last-child {
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
.list-group-item.active {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-color: #667eea;
color: white;
}
.list-group-item i {
margin-right: 10px;
width: 20px;
}
/* Hover Effects */
.hover-shadow {
transition: box-shadow 0.3s ease;
}
.hover-shadow:hover {
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}
/* Responsive */
@media (max-width: 768px) {
.main-content {
min-height: calc(100vh - 60px);
padding-bottom: 60px;
}
.stat-card {
flex-direction: column;
text-align: center;
padding: 15px;
}
.module-card {
margin-bottom: 15px;
}
.navbar-brand {
font-size: 18px;
}
}
@media (max-width: 480px) {
.navbar {
padding: 0.5rem 0;
}
.container, .container-fluid {
padding: 10px;
}
.card {
border-radius: 8px;
}
.btn {
padding: 8px 16px;
font-size: 14px;
}
}

565
app/static/css/fg_scan.css Normal file
View File

@@ -0,0 +1,565 @@
/* FG Scan Module - Custom Styling with Theme Integration */
/* Page Container */
.scan-container {
width: 100%;
max-width: 100%;
margin: 0;
padding: 20px;
background-color: var(--bg-secondary);
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
min-height: calc(100vh - 100px);
transition: background-color 0.3s ease, color 0.3s ease;
}
/* Card Base Styling */
.scan-form-card,
.scan-table-card {
background-color: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 8px;
box-shadow: 0 2px 8px var(--card-shadow);
padding: 20px;
transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.scan-form-card h3,
.scan-table-card h3 {
margin: 0 0 15px 0;
font-size: 1.2em;
font-weight: 600;
color: var(--text-primary);
border-bottom: 2px solid var(--primary-color);
padding-bottom: 10px;
transition: color 0.3s ease;
}
/* Scan Form Card */
.scan-form-card {
width: 500px;
max-width: 95%;
flex: 0 0 auto;
max-height: 750px;
overflow-y: auto;
padding: 15px;
}
.scan-form-card form {
display: grid;
grid-template-columns: 140px 1fr;
gap: 10px 12px;
align-items: center;
}
.scan-form-card label {
font-weight: 500;
font-size: 15px;
text-align: right;
padding-right: 8px;
color: var(--text-primary);
white-space: nowrap;
}
.scan-form-card input[type="text"],
.scan-form-card input[type="password"] {
padding: 8px 12px;
font-size: 15px;
border: 1px solid var(--input-border);
border-radius: 3px;
width: 100%;
box-sizing: border-box;
background-color: var(--input-bg);
color: var(--text-primary);
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.scan-form-card input[type="text"]:focus,
.scan-form-card input[type="password"]:focus {
outline: none;
border-color: var(--input-focus-border);
box-shadow: 0 0 5px var(--input-focus-shadow);
}
.form-buttons {
grid-column: 1 / -1;
display: flex;
gap: 10px;
justify-content: center;
margin-top: 15px;
}
.scan-form-card button[type="submit"],
.scan-form-card button[type="button"] {
padding: 10px 24px;
font-size: 15px;
font-weight: 500;
border: none;
border-radius: 4px;
cursor: pointer;
transition: all 0.3s ease;
}
.btn-submit {
background-color: var(--primary-color);
color: white;
}
.btn-submit:hover {
background-color: var(--secondary-color);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn-clear {
background-color: var(--warning-color);
color: white;
}
.btn-clear:hover {
background-color: #d97706;
transform: translateY(-2px);
}
.btn-secondary {
background-color: var(--info-color);
color: white;
padding: 10px 20px;
font-size: 14px;
}
.btn-secondary:hover {
background-color: #2563eb;
}
/* Form Options */
.form-options {
grid-column: 1 / -1;
margin-top: 15px;
padding-top: 15px;
border-top: 1px solid var(--border-color);
}
.checkbox-label {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
margin: 0;
color: var(--text-primary);
}
.checkbox-label input[type="checkbox"] {
cursor: pointer;
}
/* Quick Box Section */
.quick-box-section {
grid-column: 1 / -1;
margin-top: 15px;
}
.scan-form-card input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
}
/* Scan Table Card */
.scan-table-card {
flex: 1 1 auto;
min-width: 600px;
max-width: 100%;
margin-top: 0;
}
.table-wrapper {
max-height: 600px;
overflow-y: auto;
overflow-x: auto;
border: 1px solid var(--border-color);
border-radius: 3px;
position: relative;
}
.scan-table {
width: 100%;
border-collapse: collapse;
margin-top: 0;
font-size: 12px;
}
.scan-table th,
.scan-table td {
border: 1px solid var(--border-color);
padding: 8px;
text-align: center;
vertical-align: middle;
color: var(--text-primary);
}
.scan-table th {
background-color: var(--bg-tertiary);
font-weight: bold;
position: sticky;
top: 0;
z-index: 5;
border-bottom: 2px solid var(--border-color);
}
.scan-table tbody tr:nth-child(even) {
background-color: var(--table-hover-bg);
}
.scan-table tbody tr:hover {
background-color: var(--bg-secondary);
}
.scan-table tbody td {
padding: 8px;
}
/* Responsive Design */
@media (max-width: 1200px) {
.scan-container {
flex-direction: column;
align-items: stretch;
}
.scan-form-card {
width: 100%;
max-width: 100%;
flex: 0 0 auto;
}
.scan-table-card {
flex: 0 0 auto;
min-width: auto;
}
}
@media (max-width: 768px) {
.scan-container {
padding: 10px;
gap: 15px;
}
.card {
padding: 15px;
}
.scan-form-card {
width: 100%;
}
.scan-form-card form {
grid-template-columns: 100%;
gap: 8px;
}
.scan-form-card label {
text-align: left;
padding-right: 0;
font-weight: 600;
}
.scan-table {
font-size: 11px;
}
.scan-table th,
.scan-table td {
padding: 5px;
}
}
/* Dark Mode Support using data-theme attribute */
[data-theme="dark"] .scan-container {
background-color: var(--bg-secondary);
}
[data-theme="dark"] .scan-form-card,
[data-theme="dark"] .scan-table-card {
background-color: var(--bg-primary);
border-color: var(--border-color);
}
[data-theme="dark"] .scan-form-card h3,
[data-theme="dark"] .scan-table-card h3 {
color: var(--text-primary);
border-bottom-color: var(--primary-color);
}
[data-theme="dark"] .scan-form-card label {
color: var(--text-primary);
}
[data-theme="dark"] .scan-form-card input[type="text"],
[data-theme="dark"] .scan-form-card input[type="password"] {
background-color: var(--input-bg);
border-color: var(--input-border);
color: var(--text-primary);
}
[data-theme="dark"] .scan-form-card input[type="text"]:focus,
[data-theme="dark"] .scan-form-card input[type="password"]:focus {
border-color: var(--input-focus-border);
box-shadow: 0 0 5px var(--input-focus-shadow);
}
[data-theme="dark"] .scan-table {
color: var(--text-primary);
}
[data-theme="dark"] .scan-table th {
background-color: var(--bg-tertiary);
color: var(--text-primary);
border-color: var(--border-color);
}
[data-theme="dark"] .scan-table td {
border-color: var(--border-color);
color: var(--text-primary);
}
[data-theme="dark"] .scan-table tbody tr:nth-child(even) {
background-color: var(--table-hover-bg);
}
[data-theme="dark"] .scan-table tbody tr:hover {
background-color: var(--bg-secondary);
}
[data-theme="dark"] .table-wrapper {
border-color: var(--border-color);
}
[data-theme="dark"] .checkbox-label {
color: var(--text-primary);
}
/* Error Messages */
.error-message {
color: var(--danger-color);
font-size: 0.9em;
margin-top: 3px;
display: none;
grid-column: 2 / -1;
padding: 5px 0;
font-weight: 500;
}
.error-message.show {
display: block;
}
/* Floating Help Button */
.floating-help-btn {
position: fixed;
top: 80px;
right: 20px;
z-index: 1000;
width: 50px;
height: 50px;
border-radius: 50%;
background: linear-gradient(135deg, #17a2b8, #138496);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
}
.floating-help-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.floating-help-btn a {
color: white;
text-decoration: none;
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
}
body.dark-mode .floating-help-btn {
background: linear-gradient(135deg, #0dcaf0, #0aa2c0);
}
/* Notifications */
.notification {
position: fixed;
top: 20px;
right: 20px;
padding: 12px 20px;
border-radius: 4px;
color: white;
font-weight: bold;
z-index: 10001;
box-shadow: 0 4px 12px var(--card-shadow);
animation: slideIn 0.3s ease;
}
@keyframes slideIn {
from {
transform: translateX(400px);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.notification-success {
background-color: var(--success-color);
}
.notification-error {
background-color: var(--danger-color);
}
.notification-warning {
background-color: var(--warning-color);
color: #333;
}
.notification-info {
background-color: var(--info-color);
}
/* Box Modal Styling */
.box-modal {
position: fixed;
z-index: 10000;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
}
.box-modal-content {
background-color: var(--bg-primary);
padding: 0;
border: 1px solid var(--border-color);
width: 500px;
max-width: 90%;
border-radius: 8px;
box-shadow: 0 4px 20px var(--card-shadow-hover);
animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
from {
transform: translateY(-50px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.modal-header {
padding: 15px 20px;
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
color: white;
border-radius: 8px 8px 0 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-header h2 {
margin: 0;
color: white;
border: none;
padding: 0;
font-size: 1.1em;
}
.modal-close {
font-size: 28px;
font-weight: bold;
cursor: pointer;
line-height: 1;
color: white;
transition: color 0.2s;
background: none;
border: none;
padding: 0;
}
.modal-close:hover {
color: #ccc;
}
.modal-body {
padding: 20px;
color: var(--text-primary);
}
.modal-body label {
display: block;
margin-bottom: 8px;
font-weight: 500;
color: var(--text-primary);
}
.modal-body input {
width: 100%;
padding: 8px;
margin-bottom: 15px;
border: 1px solid var(--input-border);
border-radius: 4px;
background-color: var(--input-bg);
color: var(--text-primary);
box-sizing: border-box;
}
.modal-body input:focus {
outline: none;
border-color: var(--input-focus-border);
box-shadow: 0 0 5px var(--input-focus-shadow);
}
.modal-footer {
padding: 15px 20px;
border-top: 1px solid var(--border-color);
display: flex;
gap: 10px;
justify-content: flex-end;
}
.modal-footer button {
padding: 8px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.3s;
}
/* Additional form styling for consistency */
.form-centered {
margin: 0 auto;
}
input[type="text"]:invalid {
border-color: #dc3545;
}
input[type="text"]:valid {
border-color: #28a745;
}

143
app/static/css/login.css Normal file
View File

@@ -0,0 +1,143 @@
/* Login Page Styles */
body {
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.login-page {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 20px;
}
.login-container {
width: 100%;
max-width: 420px;
}
.login-card {
background: white;
border-radius: 12px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
overflow: hidden;
animation: slideUp 0.5s ease;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.login-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 40px 20px;
text-align: center;
}
.login-header i {
font-size: 48px;
margin-bottom: 15px;
}
.login-header h1 {
margin: 10px 0;
font-size: 28px;
font-weight: 700;
}
.login-form {
padding: 40px;
}
.login-form h2 {
margin: 0 0 30px 0;
font-size: 24px;
color: #333;
text-align: center;
}
.form-label {
font-weight: 600;
color: #555;
margin-bottom: 8px;
}
.form-control, .input-group-text {
border-radius: 8px;
border: 1px solid #e0e0e0;
padding: 12px;
font-size: 15px;
transition: all 0.3s ease;
}
.form-control {
border-left: none;
}
.input-group-text {
background: #f5f5f5;
border-right: none;
color: #667eea;
}
.input-group:focus-within .form-control {
border-color: #667eea;
box-shadow: none;
}
.input-group:focus-within .input-group-text {
border-color: #667eea;
}
.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
padding: 12px;
font-weight: 600;
font-size: 16px;
border-radius: 8px;
transition: all 0.3s ease;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}
.login-footer {
text-align: center;
}
/* Responsive Design */
@media (max-width: 480px) {
.login-card {
border-radius: 0;
}
.login-form {
padding: 30px 20px;
}
.login-header {
padding: 30px 20px;
}
.login-header i {
font-size: 36px;
}
.login-header h1 {
font-size: 22px;
}
}

68
app/static/css/scan.css Normal file
View File

@@ -0,0 +1,68 @@
/* Scan Module Specific Styles */
.scan-form-card {
width: 500px;
max-width: 500px;
margin: 0 auto 20px auto;
max-height: 700px;
overflow-y: auto;
padding: 12px 18px 12px 18px;
}
.scan-form-card h3 {
margin-top: 0;
margin-bottom: 8px;
}
.scan-form-card form {
display: grid;
grid-template-columns: 140px 1fr;
gap: 8px;
align-items: center;
}
.scan-form-card label {
font-weight: 500;
margin-bottom: 0;
margin-top: 0;
font-size: 13px;
text-align: left;
padding-right: 8px;
}
.scan-form-card input[type="text"] {
padding: 5px 10px;
font-size: 13px;
margin-bottom: 0;
}
.scan-form-card button[type="submit"],
.scan-form-card button[type="button"] {
grid-column: 1 / -1;
}
.scan-form-card > form > div {
grid-column: 1 / -1;
}
.scan-table-card {
overflow-x: auto;
}
.scan-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-size: 11px;
}
.scan-table th, .scan-table td {
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}
.scan-table th {
background-color: #f4f4f4;
font-weight: bold;
}

480
app/static/css/theme.css Normal file
View File

@@ -0,0 +1,480 @@
/* Light Mode (Default) - CSS Variables */
:root {
--text-primary: #333333;
--text-secondary: #666666;
--text-muted: #999999;
--bg-primary: #ffffff;
--bg-secondary: #f7f9fc;
--bg-tertiary: #f8f9fa;
--border-color: #dee2e6;
--card-shadow: rgba(0, 0, 0, 0.08);
--card-shadow-hover: rgba(0, 0, 0, 0.12);
--navbar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--welcome-card-color: #ffffff;
--table-hover-bg: #f9f9f9;
--input-bg: #ffffff;
--input-border: #e0e0e0;
--input-focus-border: #667eea;
--input-focus-shadow: rgba(102, 126, 234, 0.1);
}
/* Dark Mode - Override CSS Variables */
[data-theme="dark"] {
--text-primary: #e8e8e8;
--text-secondary: #b8b8b8;
--text-muted: #888888;
--bg-primary: #1e1e1e;
--bg-secondary: #2d2d2d;
--bg-tertiary: #3a3a3a;
--border-color: #444444;
--card-shadow: rgba(0, 0, 0, 0.3);
--card-shadow-hover: rgba(0, 0, 0, 0.5);
--navbar-bg: linear-gradient(135deg, #4a5f8f 0%, #5a3f7a 100%);
--welcome-card-color: #e8e8e8;
--table-hover-bg: #2d2d2d;
--input-bg: #2d2d2d;
--input-border: #444444;
--input-focus-border: #7b8fd9;
--input-focus-shadow: rgba(123, 143, 217, 0.2);
}
/* Apply Theme Variables to Elements */
body {
background-color: var(--bg-secondary);
color: var(--text-primary);
transition: background-color 0.3s ease, color 0.3s ease;
}
.footer {
background-color: var(--bg-tertiary);
border-top-color: var(--border-color);
transition: background-color 0.3s ease, border-color 0.3s ease;
}
.navbar-dark {
background: var(--navbar-bg) !important;
transition: background 0.3s ease;
}
.welcome-card {
color: var(--welcome-card-color);
transition: color 0.3s ease;
}
.welcome-card h1 {
color: #1a1a2e;
transition: color 0.3s ease;
font-weight: 700;
}
.welcome-card p {
color: rgba(255, 255, 255, 0.95);
}
[data-theme="dark"] .welcome-card h1 {
color: #ffffff;
}
.stat-card {
background: var(--bg-primary);
color: var(--text-primary);
box-shadow: 0 2px 8px var(--card-shadow);
transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
box-shadow: 0 8px 20px var(--card-shadow-hover);
}
.stat-content h3 {
color: var(--text-primary);
transition: color 0.3s ease;
}
.stat-content p {
color: var(--text-secondary);
transition: color 0.3s ease;
}
.card {
background-color: var(--bg-primary);
color: var(--text-primary);
border-color: var(--border-color);
box-shadow: 0 2px 8px var(--card-shadow);
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
box-shadow: 0 8px 24px var(--card-shadow-hover);
}
.card-header {
background-color: var(--bg-tertiary);
border-bottom-color: var(--border-color);
color: var(--text-primary);
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.card-header.bg-light {
background-color: var(--bg-tertiary) !important;
color: var(--text-primary) !important;
}
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
color: var(--text-primary);
transition: color 0.3s ease;
margin-bottom: 0;
}
.card-body {
background-color: var(--bg-primary);
color: var(--text-primary);
transition: background-color 0.3s ease, color 0.3s ease;
}
.card-footer {
background-color: var(--bg-tertiary);
border-top-color: var(--border-color);
color: var(--text-primary);
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
/* Ensure good contrast in dark mode for card content */
[data-theme="dark"] .card {
border-color: #444444;
}
[data-theme="dark"] .card-header {
background-color: #3a3a3a;
color: #e8e8e8;
}
[data-theme="dark"] .card-header h1,
[data-theme="dark"] .card-header h2,
[data-theme="dark"] .card-header h3,
[data-theme="dark"] .card-header h4,
[data-theme="dark"] .card-header h5,
[data-theme="dark"] .card-header h6 {
color: #e8e8e8;
}
[data-theme="dark"] .card-body {
background-color: #1e1e1e;
}
.module-card {
background-color: var(--bg-primary);
color: var(--text-primary);
transition: background-color 0.3s ease, color 0.3s ease;
}
.module-card .card-title {
color: var(--text-primary);
transition: color 0.3s ease;
}
.module-card .card-text {
color: var(--text-secondary);
transition: color 0.3s ease;
}
.table {
color: var(--text-primary);
background-color: var(--bg-secondary);
transition: color 0.3s ease, background-color 0.3s ease;
}
.table thead th {
background-color: var(--bg-tertiary);
color: var(--text-primary);
border-color: var(--border-color);
border-bottom: 2px solid var(--border-color) !important;
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
font-weight: 600;
}
.table tbody {
background-color: var(--bg-secondary);
transition: background-color 0.3s ease;
}
.table tbody td {
background-color: var(--bg-secondary);
border-bottom-color: var(--border-color);
color: var(--text-primary);
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.table tbody tr {
background-color: var(--bg-secondary);
transition: background-color 0.3s ease;
}
.table tbody tr:hover {
background-color: var(--table-hover-bg) !important;
transition: background-color 0.3s ease;
}
/* Empty table state */
.table tbody td.text-center {
color: var(--text-secondary);
}
.table tbody tr td .text-muted {
color: var(--text-secondary) !important;
}
/* Badge styling for tables */
.table .badge {
transition: all 0.3s ease;
}
.form-control,
.form-select {
background-color: var(--input-bg);
color: var(--text-primary);
border-color: var(--input-border);
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.form-control::placeholder {
color: var(--text-muted);
transition: color 0.3s ease;
}
.form-control:disabled,
.form-select:disabled {
background-color: var(--bg-tertiary);
color: var(--text-secondary);
border-color: var(--input-border);
}
.form-control:focus,
.form-select:focus {
background-color: var(--input-bg);
color: var(--text-primary);
border-color: var(--input-focus-border);
box-shadow: 0 0 0 3px var(--input-focus-shadow);
}
.form-label {
color: var(--text-primary);
transition: color 0.3s ease;
font-weight: 600;
}
.form-text {
color: var(--text-secondary);
transition: color 0.3s ease;
}
.list-group-item {
background-color: var(--bg-primary);
color: var(--text-primary);
border-color: var(--border-color);
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.list-group-item:hover {
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
.list-group-item.active {
background-color: #667eea;
border-color: #667eea;
color: white;
}
[data-theme="dark"] .list-group-item.active {
background-color: #7b8fd9;
border-color: #7b8fd9;
}
/* Alert Styling */
.alert-success {
background-color: rgba(34, 197, 94, 0.15);
color: #22c55e;
border-left-color: #22c55e;
}
[data-theme="dark"] .alert-success {
background-color: rgba(34, 197, 94, 0.2);
color: #86efac;
border-left-color: #86efac;
}
.alert-danger {
background-color: rgba(239, 68, 68, 0.15);
color: #ef4444;
border-left-color: #ef4444;
}
[data-theme="dark"] .alert-danger {
background-color: rgba(239, 68, 68, 0.2);
color: #fca5a5;
border-left-color: #fca5a5;
}
.alert-warning {
background-color: rgba(245, 158, 11, 0.15);
color: #f59e0b;
border-left-color: #f59e0b;
}
[data-theme="dark"] .alert-warning {
background-color: rgba(245, 158, 11, 0.2);
color: #fcd34d;
border-left-color: #fcd34d;
}
.alert-info {
background-color: rgba(59, 130, 246, 0.15);
color: #3b82f6;
border-left-color: #3b82f6;
}
[data-theme="dark"] .alert-info {
background-color: rgba(59, 130, 246, 0.2);
color: #93c5fd;
border-left-color: #93c5fd;
}
/* Theme Toggle Button */
.theme-toggle {
background: none;
border: none;
color: white;
font-size: 18px;
cursor: pointer;
padding: 5px 10px;
transition: all 0.3s ease;
}
.theme-toggle:hover {
transform: rotate(20deg);
}
.theme-toggle:focus {
outline: none;
}
/* Dropdown Styling for Dark Mode */
[data-theme="dark"] .dropdown-menu {
background-color: var(--bg-secondary);
color: var(--text-primary);
}
[data-theme="dark"] .dropdown-item {
color: var(--text-primary);
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
[data-theme="dark"] .dropdown-divider {
border-color: var(--border-color);
}
/* Close Button for Dark Mode */
[data-theme="dark"] .btn-close {
filter: invert(1);
}
/* Empty State Message */
.empty-state-message {
color: var(--text-secondary);
transition: color 0.3s ease;
font-size: 16px;
}
.empty-state-message i {
opacity: 0.6;
transition: opacity 0.3s ease;
}
/* Text Utilities */
.text-muted {
color: var(--text-muted) !important;
transition: color 0.3s ease;
}
.text-secondary {
color: var(--text-secondary) !important;
transition: color 0.3s ease;
}
.text-primary {
color: var(--text-primary) !important;
transition: color 0.3s ease;
}
/* Code blocks and inline code */
code,
pre {
background-color: var(--input-bg);
color: var(--text-primary);
border: 1px solid var(--border-color);
border-radius: 4px;
padding: 2px 6px;
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
pre {
padding: 10px;
overflow-x: auto;
}
pre code {
padding: 0;
border: none;
background-color: transparent;
}
/* Headings */
h1, h2, h3, h4, h5, h6 {
color: var(--text-primary);
transition: color 0.3s ease;
}
/* Bootstrap Utility Classes - Dark Mode Overrides */
.bg-light {
background-color: var(--bg-secondary) !important;
transition: background-color 0.3s ease;
}
[data-theme="dark"] .bg-light {
background-color: var(--bg-tertiary) !important;
color: var(--text-primary) !important;
}
/* Ensure form elements in bg-light sections have proper contrast */
.bg-light .form-control,
.bg-light .form-select {
background-color: var(--input-bg);
color: var(--text-primary);
border-color: var(--input-border);
}
[data-theme="dark"] .bg-light .form-control,
[data-theme="dark"] .bg-light .form-select {
background-color: var(--input-bg);
color: var(--text-primary);
border-color: var(--input-border);
}
.bg-light .form-label {
color: var(--text-primary);
}
[data-theme="dark"] .bg-light .form-label {
color: var(--text-primary);
}

137
app/static/js/base.js Normal file
View File

@@ -0,0 +1,137 @@
/* Base JavaScript Utilities */
document.addEventListener('DOMContentLoaded', function() {
// Initialize tooltips and popovers
initializeBootstrap();
// Setup flash message auto-close
setupFlashMessages();
// Setup theme toggle if available
setupThemeToggle();
});
/**
* Initialize Bootstrap tooltips and popovers
*/
function initializeBootstrap() {
// Initialize all tooltips
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// Initialize all popovers
const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl);
});
}
/**
* Auto-close flash messages after 5 seconds
*/
function setupFlashMessages() {
const alerts = document.querySelectorAll('.alert');
alerts.forEach(function(alert) {
setTimeout(function() {
const bsAlert = new bootstrap.Alert(alert);
bsAlert.close();
}, 5000);
});
}
/**
* Setup theme toggle functionality
*/
function setupThemeToggle() {
const themeToggle = document.getElementById('theme-toggle');
if (!themeToggle) return;
const currentTheme = localStorage.getItem('theme') || 'light';
applyTheme(currentTheme);
themeToggle.addEventListener('click', function() {
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
applyTheme(newTheme);
localStorage.setItem('theme', newTheme);
});
}
/**
* Apply theme to document
*/
function applyTheme(theme) {
const html = document.documentElement;
if (theme === 'dark') {
html.setAttribute('data-bs-theme', 'dark');
} else {
html.removeAttribute('data-bs-theme');
}
}
/**
* Display a toast notification
*/
function showToast(message, type = 'info') {
const toastHtml = `
<div class="toast align-items-center text-white bg-${type} border-0" role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex">
<div class="toast-body">
${message}
</div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
`;
const toastContainer = document.querySelector('.toast-container') || createToastContainer();
toastContainer.insertAdjacentHTML('beforeend', toastHtml);
const toastElement = toastContainer.lastElementChild;
const toast = new bootstrap.Toast(toastElement);
toast.show();
toastElement.addEventListener('hidden.bs.toast', function() {
toastElement.remove();
});
}
/**
* Create toast container if it doesn't exist
*/
function createToastContainer() {
const container = document.createElement('div');
container.className = 'toast-container position-fixed bottom-0 end-0 p-3';
document.body.appendChild(container);
return container;
}
/**
* Debounce function for input handlers
*/
function debounce(func, wait) {
let timeout;
return function executedFunction(...args) {
const later = () => {
clearTimeout(timeout);
func(...args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
}
/**
* Throttle function for scroll/resize handlers
*/
function throttle(func, limit) {
let inThrottle;
return function(...args) {
if (!inThrottle) {
func.apply(this, args);
inThrottle = true;
setTimeout(() => inThrottle = false, limit);
}
};
}

94
app/static/js/theme.js Normal file
View File

@@ -0,0 +1,94 @@
/**
* Theme Toggle - Light/Dark Mode
* Persists user preference in localStorage
*/
class ThemeToggle {
constructor() {
this.STORAGE_KEY = 'quality-app-theme';
this.DARK_THEME = 'dark';
this.LIGHT_THEME = 'light';
this.init();
}
init() {
// Load saved theme or default to light
const savedTheme = localStorage.getItem(this.STORAGE_KEY) || this.LIGHT_THEME;
this.setTheme(savedTheme);
// Setup toggle button listener
this.setupToggleButton();
console.log('Theme initialized:', savedTheme);
}
setTheme(theme) {
const isDark = theme === this.DARK_THEME;
if (isDark) {
document.body.setAttribute('data-theme', 'dark');
document.documentElement.setAttribute('data-theme', 'dark');
localStorage.setItem(this.STORAGE_KEY, this.DARK_THEME);
console.log('Dark theme set');
} else {
document.body.setAttribute('data-theme', 'light');
document.documentElement.setAttribute('data-theme', 'light');
localStorage.setItem(this.STORAGE_KEY, this.LIGHT_THEME);
console.log('Light theme set');
}
// Update toggle button icon
this.updateToggleIcon(isDark);
}
getCurrentTheme() {
return document.body.getAttribute('data-theme') || this.LIGHT_THEME;
}
toggleTheme() {
const currentTheme = this.getCurrentTheme();
const newTheme = currentTheme === this.DARK_THEME ? this.LIGHT_THEME : this.DARK_THEME;
console.log('Toggling from', currentTheme, 'to', newTheme);
this.setTheme(newTheme);
}
setupToggleButton() {
const toggleBtn = document.getElementById('themeToggleBtn');
if (toggleBtn) {
toggleBtn.addEventListener('click', (e) => {
e.preventDefault();
this.toggleTheme();
});
console.log('Theme toggle button setup complete');
} else {
console.error('Theme toggle button not found');
}
}
updateToggleIcon(isDark) {
const toggleBtn = document.getElementById('themeToggleBtn');
if (toggleBtn) {
const icon = toggleBtn.querySelector('i');
if (icon) {
if (isDark) {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
toggleBtn.setAttribute('title', 'Switch to Light Mode');
} else {
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
toggleBtn.setAttribute('title', 'Switch to Dark Mode');
}
}
}
}
}
// Initialize theme toggle when DOM is loaded
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
new ThemeToggle();
});
} else {
new ThemeToggle();
}