"feat: Update Raspberry Pi installation scripts and templates for calendar

This commit is contained in:
2025-05-29 16:10:49 +02:00
parent 7ce9294968
commit 147e9ecbde
3 changed files with 437 additions and 621 deletions

View File

@@ -144,16 +144,40 @@ sudo -u "$APP_USER" ./venv/bin/pip install --upgrade pip
# Installiere Python-Abhängigkeiten
log "Installiere Python-Abhängigkeiten..."
if [ -f "requirements.txt" ]; then
sudo -u "$APP_USER" ./venv/bin/pip install -r requirements.txt
# Erstelle korrigierte requirements.txt ohne Verweis auf andere Datei
cat > "$APP_DIR/requirements_fixed.txt" << 'EOF'
# MYP Platform - Python Dependencies
Flask==3.0.0
Flask-Login==0.6.3
Flask-WTF==1.2.1
Flask-Limiter==3.5.0
SQLAlchemy==2.0.41
PyP100
Werkzeug==3.0.1
bcrypt==4.1.2
redis==5.0.1
cryptography==42.0.8
pytest==7.4.3
pytest-cov==4.1.0
gunicorn==21.2.0
psutil==5.9.6
requests==2.31.0
Jinja2==3.1.2
MarkupSafe==2.1.3
itsdangerous==2.1.2
EOF
sudo -u "$APP_USER" ./venv/bin/pip install -r requirements_fixed.txt
else
# Fallback: Installiere grundlegende Pakete
sudo -u "$APP_USER" ./venv/bin/pip install \
flask \
flask-login \
flask-sqlalchemy \
flask-wtf \
flask-limiter \
sqlalchemy \
werkzeug \
requests \
python-dotenv \
gunicorn
fi
@@ -162,17 +186,25 @@ if [ -f "package.json" ]; then
log "Installiere Node.js Abhängigkeiten..."
sudo -u "$APP_USER" npm install
# Baue Frontend-Assets
# Baue Frontend-Assets falls Tailwind vorhanden
if [ -f "tailwind.config.js" ]; then
log "Baue Frontend-Assets..."
sudo -u "$APP_USER" npm run build || true
log "Baue Frontend-Assets mit Tailwind CSS..."
sudo -u "$APP_USER" npm run build:css || true
fi
fi
# Datenbank initialisieren
log "Initialisiere Datenbank..."
if [ -f "init_db.py" ]; then
sudo -u "$APP_USER" ./venv/bin/python init_db.py
if [ -f "models.py" ]; then
# Erstelle einfaches DB-Init-Skript
cat > "$APP_DIR/init_simple_db.py" << 'EOF'
from app import app, db
with app.app_context():
db.create_all()
print("Datenbank wurde initialisiert")
EOF
sudo -u "$APP_USER" ./venv/bin/python init_simple_db.py || true
rm -f "$APP_DIR/init_simple_db.py"
else
sudo -u "$APP_USER" touch database.db
fi

View File

@@ -10,245 +10,157 @@
{% endblock %}
{% block content %}
<div class="bg-professional">
<!-- Dark Mode Override -->
<style>
.dark .bg-professional {
background: #000000 !important;
}
.dark .professional-hero {
background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%) !important;
border-color: #333333 !important;
}
.dark .professional-container {
background: #111111 !important;
border-color: #333333 !important;
}
.dark .mb-glass {
background: rgba(17, 17, 17, 0.95) !important;
border-color: rgba(255, 255, 255, 0.1) !important;
}
.dark .input-professional {
background: #1a1a1a !important;
border-color: #333333 !important;
color: #ffffff !important;
}
.dark .input-professional:focus {
border-color: #3b82f6 !important;
background: #222222 !important;
}
/* FullCalendar Dark Mode Anpassungen */
.dark .fc {
background: #111111 !important;
color: #ffffff !important;
}
.dark .fc-theme-standard td,
.dark .fc-theme-standard th {
border-color: #333333 !important;
}
.dark .fc-button {
background: #1a1a1a !important;
border-color: #333333 !important;
color: #ffffff !important;
}
.dark .fc-button:hover {
background: #333333 !important;
}
.dark .fc-button-primary:not(:disabled).fc-button-active {
background: #3b82f6 !important;
border-color: #3b82f6 !important;
}
.dark .fc-col-header-cell {
background: #1a1a1a !important;
}
.dark .fc-daygrid-day {
background: #111111 !important;
}
.dark .fc-timegrid-slot {
border-color: #333333 !important;
}
.dark .fc-timegrid-axis {
background: #1a1a1a !important;
}
</style>
<!-- Professional Hero Header -->
<div class="professional-hero hero-pattern animate-fade-in" style="margin: 2rem; margin-bottom: 3rem;">
<div class="absolute inset-0 bg-gradient-to-r from-black/10 to-black/20 dark:from-black/40 dark:to-black/60"></div>
<!-- Status Indicator -->
<div class="absolute top-6 right-6 flex items-center space-x-4 z-10">
<div class="mb-glass rounded-full px-6 py-3 animate-scale-in">
<div class="flex items-center space-x-3">
<div class="status-dot status-online"></div>
<span class="text-sm font-semibold text-professional-primary">Live</span>
</div>
</div>
<div class="mb-glass rounded-full px-6 py-3 animate-scale-in">
<span id="live-time" class="text-sm font-semibold text-professional-primary"></span>
</div>
</div>
<div class="relative max-w-7xl mx-auto px-6 lg:px-8 py-20 z-10">
<div class="text-center animate-slide-up">
<!-- Mercedes-Benz Logo -->
<div class="inline-flex items-center justify-center w-28 h-28 mb-glass rounded-full mb-10 professional-shadow">
<svg class="w-14 h-14 text-professional-primary" viewBox="0 0 80 80" fill="currentColor">
<path d="M58.6,4.5C53,1.6,46.7,0,40,0c-6.7,0-13,1.6-18.6,4.5v0C8.7,11.2,0,24.6,0,40c0,15.4,8.7,28.8,21.5,35.5
C27,78.3,33.3,80,40,80c6.7,0,12.9-1.7,18.5-4.6C71.3,68.8,80,55.4,80,40C80,24.6,71.3,11.2,58.6,4.5z M4,40
c0-13.1,7-24.5,17.5-30.9v0C26.6,6,32.5,4.2,39,4l-4.5,32.7L21.5,46.8v0L8.3,57.1C5.6,52,4,46.2,4,40z M58.6,70.8
C53.1,74.1,46.8,76,40,76c-6.8,0-13.2-1.9-18.6-5.2c-4.9-2.9-8.9-6.9-11.9-11.7l11.9-4.9v0L40,46.6l18.6,7.5v0l12,4.9
C67.6,63.9,63.4,67.9,58.6,70.8z M58.6,46.8L58.6,46.8l-12.9-10L41.1,4c6.3,0.2,12.3,2,17.4,5.1v0C69,15.4,76,26.9,76,40
c0,6.2-1.5,12-4.3,17.1L58.6,46.8z"/>
<div class="space-y-8">
<!-- Page Header -->
<div class="dashboard-card p-6">
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-6">
<div class="flex items-center gap-4">
<div class="w-12 h-12 flex-shrink-0">
<svg class="w-full h-full text-slate-900 dark:text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
</div>
<div>
<h1 class="text-3xl font-bold text-slate-900 dark:text-white tracking-tight">Schichtplan</h1>
<p class="text-slate-500 dark:text-slate-400 mt-1">Planung und Überwachung Ihrer 3D-Druckprozesse</p>
</div>
</div>
<div class="flex flex-wrap gap-3">
{% if can_edit %}
<button onclick="openCreateEventModal()"
class="btn-primary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
</svg>
<span>Neuen Job planen</span>
</button>
{% endif %}
<button onclick="refreshCalendar()"
class="btn-secondary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
</svg>
<span>Aktualisieren</span>
</button>
<button onclick="exportCalendar()"
class="btn-secondary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
<span>Exportieren</span>
</button>
</div>
</div>
</div>
<!-- Filter Section -->
<div class="dashboard-card p-6">
<div class="flex flex-col lg:flex-row lg:items-end lg:justify-between gap-6">
<div class="flex flex-col sm:flex-row sm:items-end gap-6">
<!-- Drucker Filter -->
<div class="group">
<label for="printerFilter" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Drucker auswählen
</label>
<select id="printerFilter"
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option value="">Alle Produktionseinheiten</option>
{% for printer in printers %}
<option value="{{ printer.id }}">{{ printer.name }} {% if printer.location %}({{ printer.location }}){% endif %}</option>
{% endfor %}
</select>
</div>
<h1 class="title-professional text-6xl md:text-7xl font-bold mb-8 tracking-tight">
Intelligenter Schichtplan
</h1>
<p class="subtitle-professional text-2xl md:text-3xl max-w-5xl mx-auto leading-relaxed mb-12">
Fortschrittliche Planung und Überwachung Ihrer 3D-Druckprozesse mit Mercedes-Benz Präzision
</p>
<!-- Action Buttons -->
<div class="flex flex-wrap justify-center gap-6">
{% if can_edit %}
<button onclick="openCreateEventModal()"
class="btn-professional group px-8 py-4">
<svg class="w-6 h-6 mr-3 group-hover:rotate-90 transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
</svg>
<span>Neuen Job planen</span>
</button>
{% endif %}
<button onclick="refreshCalendar()"
class="btn-professional group px-8 py-4">
<svg class="w-6 h-6 mr-3 group-hover:rotate-180 transition-transform duration-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
</svg>
<span>Aktualisieren</span>
</button>
<button onclick="exportCalendar()"
class="btn-professional group px-8 py-4">
<svg class="w-6 h-6 mr-3 group-hover:scale-110 transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
<span>Exportieren</span>
</button>
<!-- Status Filter -->
<div class="group">
<label for="statusFilter" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Status-Filter
</label>
<select id="statusFilter"
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option value="">Alle Status</option>
<option value="running">Aktiv</option>
<option value="queued">Warteschlange</option>
<option value="completed">Abgeschlossen</option>
<option value="cancelled">Abgebrochen</option>
</select>
</div>
</div>
<!-- Quick Stats -->
<div class="flex flex-wrap gap-4">
<div class="dashboard-card p-4 min-w-0">
<div class="flex justify-between">
<div>
<h3 class="stat-label">Aktiv</h3>
<div class="stat-value text-green-600 dark:text-green-400" id="active-jobs">0</div>
</div>
<div class="mb-stat-icon text-green-600 dark:text-green-400">
<div class="w-3 h-3 bg-green-500 rounded-full"></div>
</div>
</div>
</div>
<div class="dashboard-card p-4 min-w-0">
<div class="flex justify-between">
<div>
<h3 class="stat-label">Wartend</h3>
<div class="stat-value text-blue-600 dark:text-blue-400" id="queued-jobs">0</div>
</div>
<div class="mb-stat-icon text-blue-600 dark:text-blue-400">
<div class="w-3 h-3 bg-blue-500 rounded-full"></div>
</div>
</div>
</div>
<div class="dashboard-card p-4 min-w-0">
<div class="flex justify-between">
<div>
<h3 class="stat-label">Heute</h3>
<div class="stat-value text-orange-600 dark:text-orange-400" id="total-time">0h</div>
</div>
<div class="mb-stat-icon text-orange-600 dark:text-orange-400">
<div class="w-3 h-3 bg-orange-500 rounded-full"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="max-w-7xl mx-auto px-6 lg:px-8 -mt-12 relative z-10" style="margin-bottom: 4rem;">
<!-- Filter Section -->
<div class="professional-container animate-slide-up" style="padding: 3rem; border-radius: 2rem; margin-bottom: 3rem;">
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between space-y-8 lg:space-y-0">
<div class="flex flex-col sm:flex-row sm:items-center sm:space-x-8 space-y-6 sm:space-y-0">
<!-- Drucker Filter -->
<div class="group">
<label for="printerFilter" class="block text-base font-bold text-professional-primary mb-4">
Drucker auswählen
</label>
<div class="relative">
<select id="printerFilter"
class="input-professional appearance-none pr-12 cursor-pointer w-full text-base py-4 px-5" style="border-radius: 1rem;">
<option value="">Alle Produktionseinheiten</option>
{% for printer in printers %}
<option value="{{ printer.id }}">{{ printer.name }} {% if printer.location %}({{ printer.location }}){% endif %}</option>
{% endfor %}
</select>
<div class="absolute inset-y-0 right-0 flex items-center pr-5 pointer-events-none">
<svg class="h-6 w-6 text-professional-muted group-hover:text-professional-primary transition-colors duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
</div>
<!-- Status Filter -->
<div class="group">
<label for="statusFilter" class="block text-base font-bold text-professional-primary mb-4">
Status-Filter
</label>
<div class="relative">
<select id="statusFilter"
class="input-professional appearance-none pr-12 cursor-pointer w-full text-base py-4 px-5" style="border-radius: 1rem;">
<option value="">Alle Status</option>
<option value="running">Aktiv</option>
<option value="queued">Warteschlange</option>
<option value="completed">Abgeschlossen</option>
<option value="cancelled">Abgebrochen</option>
</select>
<div class="absolute inset-y-0 right-0 flex items-center pr-5 pointer-events-none">
<svg class="h-6 w-6 text-professional-muted group-hover:text-professional-primary transition-colors duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
</div>
</div>
<!-- Quick Stats -->
<div class="flex flex-wrap gap-6">
<div class="status-professional status-approved" style="min-width: 160px; padding: 1.5rem;">
<div class="status-dot status-online"></div>
<span id="active-jobs" class="text-lg font-bold">0 Aktiv</span>
</div>
<div class="status-professional" style="background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); color: var(--mb-primary); min-width: 160px; padding: 1.5rem;">
<div class="w-4 h-4 bg-blue-500 rounded-full"></div>
<span id="queued-jobs" class="text-lg font-bold">0 Wartend</span>
</div>
<div class="status-professional" style="background: rgba(251, 146, 60, 0.1); border-color: rgba(251, 146, 60, 0.3); color: #ea580c; min-width: 160px; padding: 1.5rem;">
<div class="w-4 h-4 bg-orange-500 rounded-full"></div>
<span id="total-time" class="text-lg font-bold">0h Heute</span>
</div>
<!-- Calendar Container -->
<div class="dashboard-card p-6">
<div id="calendar"></div>
</div>
<!-- Legend Section -->
<div class="dashboard-card p-6">
<h3 class="section-title mb-6">Status-Legende</h3>
<div class="grid grid-cols-2 md:grid-cols-4 gap-6">
<div class="flex items-center gap-3 p-3 rounded-lg bg-gray-50 dark:bg-slate-700/30">
<div class="w-6 h-6 bg-gradient-to-br from-green-400 to-green-600 rounded-lg"></div>
<div>
<div class="text-sm font-medium text-slate-900 dark:text-white">Produktiv</div>
<div class="text-xs text-slate-500 dark:text-slate-400">Druckvorgang läuft</div>
</div>
</div>
</div>
<!-- Calendar Container -->
<div class="professional-container animate-slide-up" style="padding: 3rem; border-radius: 2rem; margin-bottom: 3rem;">
<div id="calendar"></div>
</div>
<!-- Legend Section -->
<div class="professional-container animate-slide-up" style="padding: 3rem; border-radius: 2rem;">
<div class="text-center mb-6">
<h3 class="text-xl font-bold text-professional-primary mb-2">
Status-Legende
</h3>
<p class="text-professional-muted">Übersicht der verschiedenen Produktions-Status</p>
<div class="flex items-center gap-3 p-3 rounded-lg bg-gray-50 dark:bg-slate-700/30">
<div class="w-6 h-6 bg-gradient-to-br from-blue-400 to-blue-600 rounded-lg"></div>
<div>
<div class="text-sm font-medium text-slate-900 dark:text-white">Warteschlange</div>
<div class="text-xs text-slate-500 dark:text-slate-400">Wartet auf Start</div>
</div>
</div>
<div class="grid grid-cols-2 md:grid-cols-4 gap-6">
<div class="group flex flex-col items-center space-y-3 p-4 rounded-2xl hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-all duration-300">
<div class="w-8 h-8 bg-gradient-to-br from-green-400 to-green-600 rounded-2xl shadow-lg group-hover:scale-110 transition-transform duration-300"></div>
<div class="text-center">
<div class="text-sm font-semibold text-professional-primary">Produktiv</div>
<div class="text-xs text-professional-muted">Druckvorgang läuft</div>
</div>
<div class="flex items-center gap-3 p-3 rounded-lg bg-gray-50 dark:bg-slate-700/30">
<div class="w-6 h-6 bg-gradient-to-br from-emerald-400 to-emerald-600 rounded-lg"></div>
<div>
<div class="text-sm font-medium text-slate-900 dark:text-white">Abgeschlossen</div>
<div class="text-xs text-slate-500 dark:text-slate-400">Erfolgreich gedruckt</div>
</div>
<div class="group flex flex-col items-center space-y-3 p-4 rounded-2xl hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-all duration-300">
<div class="w-8 h-8 bg-gradient-to-br from-blue-400 to-blue-600 rounded-2xl shadow-lg group-hover:scale-110 transition-transform duration-300"></div>
<div class="text-center">
<div class="text-sm font-semibold text-professional-primary">Warteschlange</div>
<div class="text-xs text-professional-muted">Wartet auf Start</div>
</div>
</div>
<div class="group flex flex-col items-center space-y-3 p-4 rounded-2xl hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-all duration-300">
<div class="w-8 h-8 bg-gradient-to-br from-emerald-400 to-emerald-600 rounded-2xl shadow-lg group-hover:scale-110 transition-transform duration-300"></div>
<div class="text-center">
<div class="text-sm font-semibold text-professional-primary">Abgeschlossen</div>
<div class="text-xs text-professional-muted">Erfolgreich gedruckt</div>
</div>
</div>
<div class="group flex flex-col items-center space-y-3 p-4 rounded-2xl hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-all duration-300">
<div class="w-8 h-8 bg-gradient-to-br from-red-400 to-red-600 rounded-2xl shadow-lg group-hover:scale-110 transition-transform duration-300"></div>
<div class="text-center">
<div class="text-sm font-semibold text-professional-primary">Abgebrochen</div>
<div class="text-xs text-professional-muted">Fehler aufgetreten</div>
</div>
</div>
<div class="flex items-center gap-3 p-3 rounded-lg bg-gray-50 dark:bg-slate-700/30">
<div class="w-6 h-6 bg-gradient-to-br from-red-400 to-red-600 rounded-lg"></div>
<div>
<div class="text-sm font-medium text-slate-900 dark:text-white">Abgebrochen</div>
<div class="text-xs text-slate-500 dark:text-slate-400">Fehler aufgetreten</div>
</div>
</div>
</div>
@@ -256,19 +168,19 @@
</div>
{% if can_edit %}
<!-- Premium Event Modal -->
<!-- Event Modal -->
<div id="eventModal" class="fixed inset-0 bg-black/60 backdrop-blur-sm hidden z-50">
<div class="flex items-center justify-center min-h-screen p-4">
<div class="professional-container max-w-2xl w-full p-8 transform transition-all duration-500 scale-95 opacity-0" id="modalContent">
<div class="flex justify-between items-center mb-8">
<div class="dashboard-card max-w-2xl w-full p-8 transform transition-all duration-300 scale-95 opacity-0" id="modalContent">
<div class="flex justify-between items-center mb-6">
<div>
<h3 id="modalTitle" class="text-2xl font-bold text-professional-primary mb-2">
<h3 id="modalTitle" class="text-xl font-bold text-slate-900 dark:text-white mb-2">
Neuen Produktionsauftrag erstellen
</h3>
<p class="text-professional-muted">Planen Sie Ihren nächsten 3D-Druckauftrag mit Präzision</p>
<p class="text-slate-500 dark:text-slate-400">Planen Sie Ihren nächsten 3D-Druckauftrag</p>
</div>
<button onclick="closeEventModal()" class="p-2 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-xl transition-colors duration-200">
<svg class="w-6 h-6 text-professional-muted hover:text-professional-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<button onclick="closeEventModal()" class="p-2 hover:bg-gray-100 dark:hover:bg-slate-700 rounded-lg transition-colors">
<svg class="w-6 h-6 text-slate-500 dark:text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
@@ -280,96 +192,82 @@
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Titel -->
<div class="md:col-span-2">
<label for="eventTitle" class="block text-sm font-semibold text-professional-primary mb-3">
Auftrags-Bezeichnung
<label for="eventTitle" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Auftrags-Bezeichnung <span class="text-red-500">*</span>
</label>
<input type="text" id="eventTitle" name="title" required
class="input-professional"
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
placeholder="z.B. Prototyp Mercedes C-Klasse Bauteil">
</div>
<!-- Beschreibung -->
<div class="md:col-span-2">
<label for="eventDescription" class="block text-sm font-semibold text-professional-primary mb-3">
<label for="eventDescription" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Detaillierte Beschreibung
</label>
<textarea id="eventDescription" name="description" rows="3"
class="input-professional resize-none"
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500 resize-none"
placeholder="Beschreiben Sie den Druckauftrag und besondere Anforderungen..."></textarea>
</div>
<!-- Drucker -->
<div>
<label for="eventPrinter" class="block text-sm font-semibold text-professional-primary mb-3">
Produktionseinheit
<label for="eventPrinter" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Produktionseinheit <span class="text-red-500">*</span>
</label>
<div class="relative">
<select id="eventPrinter" name="printerId" required
class="input-professional appearance-none pr-12 cursor-pointer">
<option value="">Drucker auswählen</option>
{% for printer in printers %}
<option value="{{ printer.id }}">{{ printer.name }} {% if printer.location %}({{ printer.location }}){% endif %}</option>
{% endfor %}
</select>
<div class="absolute inset-y-0 right-0 flex items-center pr-4 pointer-events-none">
<svg class="h-5 w-5 text-professional-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
<select id="eventPrinter" name="printerId" required
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option value="">Drucker auswählen</option>
{% for printer in printers %}
<option value="{{ printer.id }}">{{ printer.name }} {% if printer.location %}({{ printer.location }}){% endif %}</option>
{% endfor %}
</select>
</div>
<!-- Priorität -->
<div>
<label for="eventPriority" class="block text-sm font-semibold text-professional-primary mb-3">
<label for="eventPriority" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Prioritätsstufe
</label>
<div class="relative">
<select id="eventPriority" name="priority"
class="input-professional appearance-none pr-12 cursor-pointer">
<option value="normal">Standard</option>
<option value="high">Hoch</option>
<option value="urgent">Dringend</option>
</select>
<div class="absolute inset-y-0 right-0 flex items-center pr-4 pointer-events-none">
<svg class="h-5 w-5 text-professional-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
<select id="eventPriority" name="priority"
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option value="normal">Standard</option>
<option value="high">Hoch</option>
<option value="urgent">Dringend</option>
</select>
</div>
<!-- Start-Zeit -->
<div>
<label for="eventStart" class="block text-sm font-semibold text-professional-primary mb-3">
Produktionsstart
<label for="eventStart" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Produktionsstart <span class="text-red-500">*</span>
</label>
<input type="datetime-local" id="eventStart" name="start" required
class="input-professional">
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- End-Zeit -->
<div>
<label for="eventEnd" class="block text-sm font-semibold text-professional-primary mb-3">
Produktionsende
<label for="eventEnd" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Produktionsende <span class="text-red-500">*</span>
</label>
<input type="datetime-local" id="eventEnd" name="end" required
class="input-professional">
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
</div>
<!-- Premium Buttons -->
<div class="flex items-center justify-end space-x-4 pt-8 border-t border-slate-200 dark:border-slate-600">
<!-- Buttons -->
<div class="flex items-center justify-end gap-3 pt-6 border-t border-gray-200 dark:border-slate-600">
<button type="button" onclick="closeEventModal()"
class="btn-secondary-professional">
class="btn-secondary">
Abbrechen
</button>
<button type="submit"
class="btn-professional">
class="btn-primary">
Auftrag speichern
</button>
<button type="button" id="deleteEventBtn" onclick="deleteEvent()" style="display: none;"
class="btn-professional bg-red-600 hover:bg-red-700">
class="px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors">
Löschen
</button>
</div>
@@ -389,14 +287,6 @@ document.addEventListener('DOMContentLoaded', function() {
const statusFilter = document.getElementById('statusFilter');
const canEdit = document.getElementById('canEditFlag').value === 'true';
// Live Time Update
function updateLiveTime() {
const now = new Date();
document.getElementById('live-time').textContent = now.toLocaleTimeString('de-DE');
}
updateLiveTime();
setInterval(updateLiveTime, 1000);
// Modal Animation
const modal = document.getElementById('eventModal');
const modalContent = document.getElementById('modalContent');
@@ -438,14 +328,12 @@ document.addEventListener('DOMContentLoaded', function() {
selectable: canEdit,
selectMirror: true,
eventDidMount: function(info) {
// Premium Event Styling
const event = info.event;
const element = info.el;
element.style.borderRadius = '12px';
element.style.borderRadius = '8px';
element.style.border = 'none';
element.style.boxShadow = '0 4px 12px rgba(0,0,0,0.15)';
element.style.backdropFilter = 'blur(8px)';
element.style.boxShadow = '0 2px 8px rgba(0,0,0,0.1)';
},
select: function(info) {
if (canEdit) {
@@ -456,7 +344,6 @@ document.addEventListener('DOMContentLoaded', function() {
},
eventClick: function(info) {
if (canEdit) {
// Edit existing event
openCreateEventModal();
document.getElementById('modalTitle').textContent = 'Produktionsauftrag bearbeiten';
document.getElementById('eventId').value = info.event.id;
@@ -517,14 +404,12 @@ document.addEventListener('DOMContentLoaded', function() {
};
window.exportCalendar = function() {
// Export-Funktionalität implementieren
alert('Export-Funktion wird implementiert...');
};
window.deleteEvent = function() {
const eventId = document.getElementById('eventId').value;
if (eventId && confirm('Möchten Sie diesen Produktionsauftrag wirklich löschen?')) {
// Delete-Funktionalität implementieren
closeEventModal();
}
};

View File

@@ -7,356 +7,248 @@
{% endblock %}
{% block content %}
<div class="bg-professional" style="background: #f8fafc !important;">
<!-- Dark Mode Override -->
<style>
.dark .bg-professional {
background: #000000 !important;
}
.dark .professional-hero {
background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%) !important;
border-color: #333333 !important;
}
.dark .professional-container {
background: #111111 !important;
border-color: #333333 !important;
}
.dark .mb-glass {
background: rgba(17, 17, 17, 0.95) !important;
border-color: rgba(255, 255, 255, 0.1) !important;
}
.dark .card-professional {
background: rgba(17, 17, 17, 0.95) !important;
border-color: rgba(255, 255, 255, 0.1) !important;
}
.dark .stat-card {
background: rgba(17, 17, 17, 0.95) !important;
border-color: rgba(255, 255, 255, 0.1) !important;
}
.dark .censored-text {
color: #888888 !important;
}
</style>
<!-- Professional Hero Header -->
<div class="professional-hero hero-pattern animate-fade-in" style="margin: 2rem; margin-bottom: 3rem;">
<div class="absolute inset-0 bg-gradient-to-r from-black/10 to-black/20 dark:from-black/40 dark:to-black/60"></div>
<!-- Status Indicator -->
<div class="absolute top-6 right-6 flex items-center space-x-4 z-10">
<div class="mb-glass rounded-full px-6 py-3 animate-scale-in">
<div class="flex items-center space-x-3">
<div class="status-dot status-online"></div>
<span class="text-sm font-semibold text-professional-primary">Live Übersicht</span>
</div>
</div>
<div class="mb-glass rounded-full px-6 py-3 animate-scale-in">
<span id="live-time" class="text-sm font-semibold text-professional-primary"></span>
</div>
</div>
<div class="relative max-w-7xl mx-auto px-6 lg:px-8 py-20 z-10">
<div class="text-center animate-slide-up">
<!-- Mercedes-Benz Logo -->
<div class="inline-flex items-center justify-center w-28 h-28 mb-glass rounded-full mb-10 professional-shadow">
<svg class="w-14 h-14 text-professional-primary" viewBox="0 0 80 80" fill="currentColor">
<path d="M58.6,4.5C53,1.6,46.7,0,40,0c-6.7,0-13,1.6-18.6,4.5v0C8.7,11.2,0,24.6,0,40c0,15.4,8.7,28.8,21.5,35.5
C27,78.3,33.3,80,40,80c6.7,0,12.9-1.7,18.5-4.6C71.3,68.8,80,55.4,80,40C80,24.6,71.3,11.2,58.6,4.5z M4,40
c0-13.1,7-24.5,17.5-30.9v0C26.6,6,32.5,4.2,39,4l-4.5,32.7L21.5,46.8v0L8.3,57.1C5.6,52,4,46.2,4,40z M58.6,70.8
C53.1,74.1,46.8,76,40,76c-6.8,0-13.2-1.9-18.6-5.2c-4.9-2.9-8.9-6.9-11.9-11.7l11.9-4.9v0L40,46.6l18.6,7.5v0l12,4.9
C67.6,63.9,63.4,67.9,58.6,70.8z M58.6,46.8L58.6,46.8l-12.9-10L41.1,4c6.3,0.2,12.3,2,17.4,5.1v0C69,15.4,76,26.9,76,40
c0,6.2-1.5,12-4.3,17.1L58.6,46.8z"/>
<div class="space-y-8">
<!-- Page Header -->
<div class="dashboard-card p-6">
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-6">
<div class="flex items-center gap-4">
<div class="w-12 h-12 flex-shrink-0">
<svg class="w-full h-full text-slate-900 dark:text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<h1 class="title-professional text-6xl md:text-7xl font-bold mb-8 tracking-tight">
Anträge Übersicht
</h1>
<p class="subtitle-professional text-2xl md:text-3xl max-w-5xl mx-auto leading-relaxed mb-12">
Transparente Übersicht aller eingereichten Druckanträge mit Datenschutz-konformer Darstellung
<div>
<h1 class="text-3xl font-bold text-slate-900 dark:text-white tracking-tight">Anträge Übersicht</h1>
<p class="text-slate-500 dark:text-slate-400 mt-1">Transparente Übersicht aller eingereichten Druckanträge</p>
</div>
</div>
<div class="flex flex-wrap gap-3">
<a href="{{ url_for('guest.guest_request_form') }}"
class="btn-primary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
<span>Neuen Antrag stellen</span>
</a>
<button onclick="location.reload()"
class="btn-secondary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
</svg>
<span>Aktualisieren</span>
</button>
<a href="{{ url_for('index') }}"
class="btn-secondary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
</svg>
<span>Startseite</span>
</a>
</div>
</div>
</div>
<!-- Info Banner -->
<div class="dashboard-card p-6">
<div class="flex items-start gap-4">
<div class="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-xl flex items-center justify-center flex-shrink-0">
<svg class="h-6 w-6 text-blue-600 dark:text-blue-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"></path>
</svg>
</div>
<div class="flex-1">
<h3 class="text-lg font-semibold text-slate-900 dark:text-white mb-2">
Datenschutz & Transparenz
</h3>
<p class="text-slate-600 dark:text-slate-400 mb-4">
Diese Übersicht zeigt alle eingereichten Druckanträge in anonymisierter Form. Persönliche Daten sind durch "***" zensiert, um die Privatsphäre zu schützen und gleichzeitig Transparenz über den Bearbeitungsstand zu gewährleisten.
</p>
<!-- Action Buttons -->
<div class="flex flex-wrap justify-center gap-6">
<a href="{{ url_for('guest.guest_request_form') }}"
class="btn-professional group px-8 py-4">
<svg class="w-6 h-6 mr-3 group-hover:scale-110 transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
</svg>
<span>Neuen Antrag stellen</span>
</a>
<button onclick="location.reload()"
class="btn-professional group px-8 py-4">
<svg class="w-6 h-6 mr-3 group-hover:rotate-180 transition-transform duration-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
</svg>
<span>Aktualisieren</span>
</button>
<a href="{{ url_for('index') }}"
class="btn-professional group px-8 py-4">
<svg class="w-6 h-6 mr-3 group-hover:scale-110 transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path>
</svg>
<span>Zur Startseite</span>
</a>
<div class="flex flex-wrap gap-2">
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400">
Datenkonform
</span>
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400">
Anonymisiert
</span>
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400">
Transparent
</span>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div class="max-w-7xl mx-auto px-6 lg:px-8 -mt-12 relative z-10" style="margin-bottom: 4rem;">
<!-- Statistics Cards -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
{% set total_requests = requests|length %}
{% set pending_requests = requests|selectattr("status", "equalto", "pending")|list|length %}
{% set approved_requests = requests|selectattr("status", "equalto", "approved")|list|length %}
{% set denied_requests = requests|selectattr("status", "equalto", "denied")|list|length %}
<!-- Info Banner -->
<div class="professional-container animate-slide-up" style="padding: 3rem; border-radius: 2rem; margin-bottom: 3rem;">
<div class="flex-shrink-0 mb-8">
<div class="flex items-center space-x-6">
<div class="w-16 h-16 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-3xl flex items-center justify-center">
<svg class="h-8 w-8 text-white" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"></path>
</svg>
</div>
<div>
<h3 class="text-2xl font-bold text-professional-primary mb-4">
Mercedes-Benz Datenschutz & Transparenz
</h3>
<p class="text-professional-secondary text-lg leading-relaxed">
Diese Übersicht zeigt alle eingereichten Druckanträge in anonymisierter Form. Persönliche Daten sind durch "***" zensiert, um die Privatsphäre zu schützen und gleichzeitig Transparenz über den Bearbeitungsstand zu gewährleisten.
</p>
</div>
<div class="dashboard-card p-6">
<div class="flex justify-between">
<div>
<h3 class="stat-label">Gesamt</h3>
<div class="stat-value">{{ total_requests }}</div>
</div>
</div>
<div class="flex flex-wrap gap-6">
<div class="status-professional" style="background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); color: var(--mb-primary); padding: 1.5rem; min-width: 160px;">
<div class="w-4 h-4 bg-blue-500 rounded-full mb-3"></div>
<span class="text-lg font-bold">Datenkonform</span>
</div>
<div class="status-professional status-approved" style="padding: 1.5rem; min-width: 160px;">
<div class="status-dot status-online mb-3"></div>
<span class="text-lg font-bold">Anonymisiert</span>
</div>
<div class="status-professional" style="background: rgba(147, 51, 234, 0.1); border-color: rgba(147, 51, 234, 0.3); color: #7c3aed; padding: 1.5rem; min-width: 160px;">
<div class="w-4 h-4 bg-purple-500 rounded-full mb-3"></div>
<span class="text-lg font-bold">Transparent</span>
</div>
</div>
</div>
<!-- Statistics Cards -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8 animate-slide-up">
{% set total_requests = requests|length %}
{% set pending_requests = requests|selectattr("status", "equalto", "pending")|list|length %}
{% set approved_requests = requests|selectattr("status", "equalto", "approved")|list|length %}
{% set denied_requests = requests|selectattr("status", "equalto", "denied")|list|length %}
<div class="stat-card professional-container" style="padding: 2rem; border-radius: 2rem; text-center;">
<div class="w-12 h-12 bg-gradient-to-br from-slate-400 to-slate-600 rounded-2xl mx-auto mb-6 flex items-center justify-center">
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<div class="mb-stat-icon text-slate-600 dark:text-slate-400">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<div class="text-4xl font-bold text-professional-primary mb-3">{{ total_requests }}</div>
<div class="text-xl font-semibold text-professional-secondary">Gesamt</div>
</div>
<div class="stat-card professional-container" style="padding: 2rem; border-radius: 2rem; text-center;">
<div class="w-12 h-12 bg-gradient-to-br from-yellow-400 to-orange-500 rounded-2xl mx-auto mb-6 flex items-center justify-center">
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
</div>
<div class="dashboard-card p-6">
<div class="flex justify-between">
<div>
<h3 class="stat-label">Prüfung</h3>
<div class="stat-value text-yellow-600 dark:text-yellow-400">{{ pending_requests }}</div>
</div>
<div class="mb-stat-icon text-yellow-600 dark:text-yellow-400">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
<div class="text-4xl font-bold text-yellow-600 dark:text-yellow-400 mb-3">{{ pending_requests }}</div>
<div class="text-xl font-semibold text-professional-secondary">Prüfung</div>
</div>
<div class="stat-card professional-container" style="padding: 2rem; border-radius: 2rem; text-center;">
<div class="w-12 h-12 bg-gradient-to-br from-green-400 to-emerald-500 rounded-2xl mx-auto mb-6 flex items-center justify-center">
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
</div>
<div class="dashboard-card p-6">
<div class="flex justify-between">
<div>
<h3 class="stat-label">Genehmigt</h3>
<div class="stat-value text-green-600 dark:text-green-400">{{ approved_requests }}</div>
</div>
<div class="mb-stat-icon text-green-600 dark:text-green-400">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
</svg>
</div>
<div class="text-4xl font-bold text-green-600 dark:text-green-400 mb-3">{{ approved_requests }}</div>
<div class="text-xl font-semibold text-professional-secondary">Genehmigt</div>
</div>
<div class="stat-card professional-container" style="padding: 2rem; border-radius: 2rem; text-center;">
<div class="w-12 h-12 bg-gradient-to-br from-red-400 to-red-600 rounded-2xl mx-auto mb-6 flex items-center justify-center">
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
</div>
<div class="dashboard-card p-6">
<div class="flex justify-between">
<div>
<h3 class="stat-label">Abgelehnt</h3>
<div class="stat-value text-red-600 dark:text-red-400">{{ denied_requests }}</div>
</div>
<div class="mb-stat-icon text-red-600 dark:text-red-400">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</div>
<div class="text-4xl font-bold text-red-600 dark:text-red-400 mb-3">{{ denied_requests }}</div>
<div class="text-xl font-semibold text-professional-secondary">Abgelehnt</div>
</div>
</div>
<!-- Requests List -->
{% if error %}
<div class="professional-container animate-slide-up" style="padding: 3rem; border-radius: 2rem; text-center;">
<div class="text-red-500 dark:text-red-400 mb-8">
<div class="w-20 h-20 bg-gradient-to-br from-red-400 to-red-600 rounded-3xl mx-auto mb-6 flex items-center justify-center">
<svg class="w-10 h-10 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
</div>
<h3 class="text-2xl font-bold text-professional-primary mb-4">Fehler beim Laden</h3>
<p class="text-professional-muted text-lg">{{ error }}</p>
</div>
{% elif requests|length == 0 %}
<div class="professional-container animate-slide-up" style="padding: 3rem; border-radius: 2rem; text-center;">
<div class="text-professional-muted mb-8">
<div class="w-20 h-20 bg-gradient-to-br from-slate-400 to-slate-600 rounded-3xl mx-auto mb-6 flex items-center justify-center">
<svg class="w-10 h-10 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
</div>
<h3 class="text-2xl font-bold text-professional-primary mb-4">Keine Druckanträge</h3>
<p class="text-professional-muted mb-8 text-lg">
Derzeit sind keine Druckanträge vorhanden.
</p>
<a href="{{ url_for('guest.guest_request_form') }}"
class="btn-professional group px-8 py-4">
<svg class="w-6 h-6 mr-3 group-hover:scale-110 transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
Ersten Antrag stellen
</a>
</div>
{% else %}
<div class="space-y-6 animate-slide-up">
{% for request in requests %}
<div class="card-professional professional-container" style="padding: 3rem; border-radius: 2rem; border-left: 6px solid {% if request.status == 'pending' %}#f59e0b{% elif request.status == 'approved' %}#10b981{% elif request.status == 'denied' %}#ef4444{% endif %};">
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between space-y-6 lg:space-y-0">
<!-- Left Section: Request Info -->
<div class="flex-1">
<div class="flex items-center space-x-6 mb-6">
<div class="text-2xl font-bold text-professional-primary">
#{{ request.id }}
</div>
<div class="status-professional {% if request.status == 'pending' %}status-pending{% elif request.status == 'approved' %}status-approved{% elif request.status == 'denied' %}status-denied{% endif %}" style="padding: 1rem 1.5rem;">
{% if request.status == 'pending' %}
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
Wird geprüft
{% elif request.status == 'approved' %}
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
</svg>
Genehmigt
{% elif request.status == 'denied' %}
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
Abgelehnt
{% endif %}
</div>
{% if request.job_status %}
<div class="status-professional" style="background: rgba(147, 51, 234, 0.1); border-color: rgba(147, 51, 234, 0.3); color: #7c3aed; padding: 1rem 1.5rem;">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"/>
</svg>
Druckstatus: {{ request.job_status|title }}
</div>
{% endif %}
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 text-base mb-6">
<div class="mb-glass p-4 rounded-xl">
<div class="text-professional-muted font-bold mb-2">Antragsteller</div>
<div class="censored-text font-mono text-professional-secondary text-lg">{{ request.name }}</div>
</div>
<div class="mb-glass p-4 rounded-xl">
<div class="text-professional-muted font-bold mb-2">E-Mail</div>
<div class="censored-text font-mono text-professional-secondary text-lg">{{ request.email }}</div>
</div>
<div class="mb-glass p-4 rounded-xl">
<div class="text-professional-muted font-bold mb-2">Drucker</div>
<div class="text-professional-secondary text-lg">{{ request.printer_name if request.printer_name else 'Automatisch' }}</div>
</div>
<div class="mb-glass p-4 rounded-xl">
<div class="text-professional-muted font-bold mb-2">Dauer</div>
<div class="text-professional-secondary text-lg">{{ request.duration_min }} Min</div>
</div>
</div>
{% if request.reason %}
<div class="mb-glass p-4 rounded-xl">
<div class="text-professional-muted font-bold mb-3">Projektbeschreibung</div>
<div class="censored-text font-mono text-professional-secondary text-base">{{ request.reason }}</div>
</div>
{% endif %}
</div>
<!-- Right Section: Timestamp and Actions -->
<div class="lg:text-right">
<div class="mb-glass p-6 rounded-xl text-center lg:text-right">
<div class="text-lg font-bold text-professional-primary mb-2">
{{ request.created_at.strftime('%d.%m.%Y') }}
</div>
<div class="text-base text-professional-secondary">
{{ request.created_at.strftime('%H:%M') }} Uhr
</div>
{% if request.status == 'approved' %}
<div class="mt-6">
<div class="status-professional status-approved" style="padding: 1rem 1.5rem;">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
Startbereit
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
<!-- Action Buttons -->
<div class="mt-16 text-center animate-slide-up">
<div class="flex flex-col sm:flex-row items-center justify-center space-y-6 sm:space-y-0 sm:space-x-8">
<a href="{{ url_for('guest.guest_request_form') }}"
class="btn-professional group px-10 py-5 text-lg">
<svg class="w-6 h-6 mr-4 group-hover:scale-110 transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
Neuen Antrag stellen
</a>
<a href="{{ url_for('index') }}"
class="btn-secondary-professional px-10 py-5 text-lg">
<svg class="w-6 h-6 mr-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
</svg>
← Zur Startseite
</a>
</div>
</div>
</div>
<!-- Requests List -->
{% if error %}
<div class="dashboard-card p-8 text-center">
<div class="text-red-500 dark:text-red-400 mb-4">
<svg class="w-12 h-12 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
<h3 class="text-lg font-semibold text-slate-900 dark:text-white mb-2">Fehler beim Laden</h3>
<p class="text-slate-500 dark:text-slate-400">{{ error }}</p>
</div>
{% elif requests|length == 0 %}
<div class="dashboard-card p-8 text-center">
<div class="text-slate-400 dark:text-slate-500 mb-4">
<svg class="w-12 h-12 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<h3 class="text-lg font-semibold text-slate-900 dark:text-white mb-2">Keine Druckanträge</h3>
<p class="text-slate-500 dark:text-slate-400 mb-4">
Derzeit sind keine Druckanträge vorhanden.
</p>
<a href="{{ url_for('guest.guest_request_form') }}"
class="btn-primary">
Ersten Antrag stellen
</a>
</div>
{% else %}
<div class="space-y-4">
{% for request in requests %}
<div class="dashboard-card p-6 border-l-4 {% if request.status == 'pending' %}border-yellow-400{% elif request.status == 'approved' %}border-green-400{% elif request.status == 'denied' %}border-red-400{% endif %}">
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4">
<!-- Left Section: Request Info -->
<div class="flex-1">
<div class="flex items-center gap-4 mb-4">
<span class="text-lg font-bold text-slate-900 dark:text-white">
#{{ request.id }}
</span>
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium {% if request.status == 'pending' %}bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400{% elif request.status == 'approved' %}bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400{% elif request.status == 'denied' %}bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400{% endif %}">
{% if request.status == 'pending' %}
Wird geprüft
{% elif request.status == 'approved' %}
Genehmigt
{% elif request.status == 'denied' %}
Abgelehnt
{% endif %}
</span>
{% if request.job_status %}
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400">
Druckstatus: {{ request.job_status|title }}
</span>
{% endif %}
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 text-sm">
<div class="bg-gray-50 dark:bg-slate-700/30 p-3 rounded-lg">
<div class="text-slate-500 dark:text-slate-400 font-medium mb-1">Antragsteller</div>
<div class="font-mono text-slate-600 dark:text-slate-300">{{ request.name }}</div>
</div>
<div class="bg-gray-50 dark:bg-slate-700/30 p-3 rounded-lg">
<div class="text-slate-500 dark:text-slate-400 font-medium mb-1">E-Mail</div>
<div class="font-mono text-slate-600 dark:text-slate-300">{{ request.email }}</div>
</div>
<div class="bg-gray-50 dark:bg-slate-700/30 p-3 rounded-lg">
<div class="text-slate-500 dark:text-slate-400 font-medium mb-1">Drucker</div>
<div class="text-slate-600 dark:text-slate-300">{{ request.printer_name if request.printer_name else 'Automatisch' }}</div>
</div>
<div class="bg-gray-50 dark:bg-slate-700/30 p-3 rounded-lg">
<div class="text-slate-500 dark:text-slate-400 font-medium mb-1">Dauer</div>
<div class="text-slate-600 dark:text-slate-300">{{ request.duration_min }} Min</div>
</div>
</div>
{% if request.reason %}
<div class="mt-4 bg-gray-50 dark:bg-slate-700/30 p-3 rounded-lg">
<div class="text-slate-500 dark:text-slate-400 font-medium mb-2">Projektbeschreibung</div>
<div class="font-mono text-sm text-slate-600 dark:text-slate-300">{{ request.reason }}</div>
</div>
{% endif %}
</div>
<!-- Right Section: Timestamp and Actions -->
<div class="lg:text-right">
<div class="bg-gray-50 dark:bg-slate-700/30 p-4 rounded-lg text-center lg:text-right">
<div class="text-sm font-medium text-slate-900 dark:text-white mb-1">
{{ request.created_at.strftime('%d.%m.%Y') }}
</div>
<div class="text-xs text-slate-500 dark:text-slate-400">
{{ request.created_at.strftime('%H:%M') }} Uhr
</div>
{% if request.status == 'approved' %}
<div class="mt-3">
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400">
Startbereit
</span>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
</div>
<!-- Auto-Refresh Script -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Live Time Update
function updateLiveTime() {
const now = new Date();
document.getElementById('live-time').textContent = now.toLocaleTimeString('de-DE');
}
updateLiveTime();
setInterval(updateLiveTime, 1000);
// Auto-Refresh alle 30 Sekunden
setInterval(function() {
// Nur refreshen wenn Seite sichtbar ist
if (!document.hidden) {
window.location.reload();
}
}, 30000);
// Live-Zeitanzeige im Browser-Tab
function updateTabTitle() {
const now = new Date();
@@ -366,6 +258,13 @@ document.addEventListener('DOMContentLoaded', function() {
updateTabTitle();
setInterval(updateTabTitle, 1000);
// Auto-Refresh alle 30 Sekunden
setInterval(function() {
if (!document.hidden) {
window.location.reload();
}
}, 30000);
});
</script>
{% endblock %}