Projektarbeit-MYP/backend/app/templates/guest_request.html

813 lines
36 KiB
HTML

{% extends "base.html" %}
{% block title %}Gastanfrage - Mercedes-Benz MYP Platform{% endblock %}
{% block head %}
{{ super() }}
<meta name="csrf-token" content="{{ csrf_token() if csrf_token else '' }}">
{% endblock %}
{% block extra_css %}
<style>
/* Mercedes-Benz Corporate Design */
.text-mercedes-black { color: #000000; }
.text-mercedes-gray { color: #6b7280; }
.text-mercedes-silver { color: #9ca3af; }
.text-mercedes-blue { color: #0073ce; }
.text-mercedes-green { color: #008c32; }
.text-mercedes-red { color: #dc2626; }
.bg-mercedes-black { background-color: #000000; }
.bg-mercedes-silver { background-color: #e5e7eb; }
.bg-mercedes-blue { background-color: #0073ce; }
.bg-mercedes-green { background-color: #008c32; }
.border-mercedes-silver { border-color: #d1d5db; }
.border-mercedes-blue { border-color: #0073ce; }
.hover\:border-mercedes-blue:hover { border-color: #0073ce; }
.focus\:ring-mercedes-blue:focus {
--tw-ring-color: #0073ce;
--tw-ring-opacity: 0.5;
}
.focus\:border-mercedes-blue:focus { border-color: #0073ce; }
/* Enhanced Page Header */
.guest-header {
background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
border: 1px solid #e2e8f0;
box-shadow:
0 10px 25px -5px rgba(0, 0, 0, 0.1),
0 4px 6px -2px rgba(0, 0, 0, 0.05);
position: relative;
overflow: hidden;
}
.dark .guest-header {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #334155;
}
.guest-header::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(0, 115, 206, 0.1), transparent);
transition: left 0.5s;
}
.guest-header:hover::before {
left: 100%;
}
/* Enhanced Form Container */
.guest-form-container {
background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
border: 1px solid #e2e8f0;
box-shadow:
0 20px 40px -12px rgba(0, 0, 0, 0.1),
0 8px 16px -4px rgba(0, 0, 0, 0.05);
border-radius: 16px;
position: relative;
overflow: hidden;
}
.dark .guest-form-container {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #334155;
}
/* Enhanced Form Inputs */
.mercedes-form-input {
transition: all 0.2s ease;
border: 1px solid #d1d5db;
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(10px);
border-radius: 8px;
}
.mercedes-form-input:focus {
border-color: #0073ce;
box-shadow:
0 0 0 3px rgba(0, 115, 206, 0.1),
0 4px 6px -1px rgba(0, 0, 0, 0.1);
transform: translateY(-1px);
background: rgba(255, 255, 255, 1);
}
.dark .mercedes-form-input {
background: rgba(30, 41, 59, 0.8);
border-color: #475569;
color: #f8fafc;
}
.dark .mercedes-form-input:focus {
border-color: #0ea5e9;
box-shadow:
0 0 0 3px rgba(14, 165, 233, 0.1),
0 4px 6px -1px rgba(0, 0, 0, 0.3);
background: rgba(30, 41, 59, 1);
}
/* Enhanced File Upload Area */
.upload-area {
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
border: 2px dashed #cbd5e1;
border-radius: 12px;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.dark .upload-area {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #475569;
}
.upload-area:hover {
border-color: #0073ce;
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
transform: scale(1.02);
}
.dark .upload-area:hover {
background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}
.upload-area.drag-over {
border-color: #0073ce;
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
transform: scale(1.05);
box-shadow: 0 8px 25px rgba(0, 115, 206, 0.15);
}
.dark .upload-area.drag-over {
background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}
/* Form Validation States */
.input-error {
border-color: #dc2626 !important;
box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
animation: shake 0.5s ease-in-out;
}
.input-success {
border-color: #16a34a !important;
box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1) !important;
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-5px); }
75% { transform: translateX(5px); }
}
/* Enhanced Info Banner */
.info-banner {
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
border: 1px solid #bfdbfe;
border-radius: 12px;
position: relative;
overflow: hidden;
}
.dark .info-banner {
background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
border-color: #3b82f6;
}
.info-banner::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 4px;
height: 100%;
background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}
/* Enhanced Buttons */
.btn-primary {
background: linear-gradient(135deg, #0073ce 0%, #1e40af 100%);
border: none;
color: white;
padding: 0.75rem 2rem;
border-radius: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
display: inline-flex;
align-items: center;
text-decoration: none;
box-shadow: 0 4px 14px 0 rgba(0, 115, 206, 0.39);
}
.btn-primary::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s;
}
.btn-primary:hover::before {
left: 100%;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px 0 rgba(0, 115, 206, 0.5);
}
.btn-secondary {
background: transparent;
border: 2px solid #0073ce;
color: #0073ce;
padding: 0.75rem 2rem;
border-radius: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
text-decoration: none;
}
.btn-secondary:hover {
background: #0073ce;
color: white;
transform: translateY(-2px);
}
.dark .btn-secondary {
border-color: #60a5fa;
color: #60a5fa;
}
.dark .btn-secondary:hover {
background: #60a5fa;
color: #1e293b;
}
/* Progress Indicators */
.progress-step {
background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
border: 2px solid #d1d5db;
border-radius: 50%;
width: 2rem;
height: 2rem;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
transition: all 0.3s ease;
}
.progress-step.active {
background: linear-gradient(135deg, #0073ce 0%, #1e40af 100%);
color: white;
border-color: #0073ce;
transform: scale(1.1);
}
.progress-step.completed {
background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
color: white;
border-color: #16a34a;
}
/* Loading States */
.loading-skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: loading 2s infinite;
}
.dark .loading-skeleton {
background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
background-size: 200% 100%;
}
@keyframes loading {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* File Preview */
.file-preview {
background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
border: 1px solid #bbf7d0;
border-radius: 8px;
padding: 1rem;
animation: slideIn 0.3s ease-out;
}
.dark .file-preview {
background: linear-gradient(135deg, #14532d 0%, #166534 100%);
border-color: #16a34a;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Responsive Design */
@media (max-width: 768px) {
.guest-form-container {
margin: 1rem;
padding: 1.5rem !important;
}
.btn-primary,
.btn-secondary {
width: 100%;
justify-content: center;
}
.upload-area {
height: 120px;
}
}
/* Success Animation */
.success-checkmark {
animation: checkmark 0.6s ease-in-out;
}
@keyframes checkmark {
0% {
transform: scale(0);
opacity: 0;
}
50% {
transform: scale(1.2);
opacity: 1;
}
100% {
transform: scale(1);
opacity: 1;
}
}
/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Focus States */
.btn-primary:focus,
.btn-secondary:focus {
outline: 2px solid #0073ce;
outline-offset: 2px;
}
/* Custom Scrollbar */
.custom-scroll::-webkit-scrollbar {
width: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
background: #f1f5f9;
border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb {
background: #0073ce;
border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
background: #1e40af;
}
</style>
{% endblock %}
{% block content %}
<div class="space-y-8">
<!-- Enhanced Page Header -->
<div class="guest-header p-6 rounded-xl relative">
<div class="relative z-10">
<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-16 h-16 flex-shrink-0 bg-mercedes-blue text-white rounded-xl flex items-center justify-center">
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
</div>
<div>
<h1 class="text-4xl font-bold text-mercedes-black dark:text-white tracking-tight">Gastanfrage</h1>
<p class="text-mercedes-gray dark:text-slate-400 mt-1 text-lg">Stellen Sie Ihre 3D-Druckauftrag Anfrage</p>
<div class="flex items-center mt-2 text-sm text-mercedes-blue">
<svg class="w-4 h-4 mr-1" 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>
Bearbeitungszeit: 24-48 Stunden
</div>
</div>
</div>
<div class="flex flex-wrap gap-3">
<a href="{{ url_for('guest.guest_requests_overview') if url_for else '/guest/requests' }}"
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="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>
<span>Anträge Übersicht</span>
</a>
<a href="{{ url_for('index') if url_for else '/' }}"
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>
</div>
<!-- Progress Indicator -->
<div class="guest-form-container p-6">
<div class="mb-8">
<div class="flex items-center justify-between max-w-md mx-auto">
<div class="flex items-center">
<div class="progress-step active">1</div>
<span class="ml-2 text-sm font-medium text-mercedes-black dark:text-white">Antrag stellen</span>
</div>
<div class="flex-1 h-1 bg-gray-200 dark:bg-gray-700 mx-4 rounded-full">
<div class="h-1 bg-mercedes-blue rounded-full" style="width: 33%"></div>
</div>
<div class="flex items-center">
<div class="progress-step">2</div>
<span class="ml-2 text-sm font-medium text-mercedes-gray dark:text-slate-400">Prüfung</span>
</div>
<div class="flex-1 h-1 bg-gray-200 dark:bg-gray-700 mx-4 rounded-full"></div>
<div class="flex items-center">
<div class="progress-step">3</div>
<span class="ml-2 text-sm font-medium text-mercedes-gray dark:text-slate-400">Genehmigung</span>
</div>
</div>
</div>
</div>
<!-- Enhanced Info Banner -->
<div class="info-banner p-6 relative">
<div class="flex items-start gap-4 relative z-10">
<div class="w-12 h-12 bg-blue-500 text-white rounded-xl flex items-center justify-center flex-shrink-0">
<svg class="h-6 w-6" 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"/>
</svg>
</div>
<div class="flex-1">
<h3 class="text-xl font-bold text-blue-900 dark:text-blue-100 mb-3">
Mercedes-Benz Qualitätsstandards
</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-blue-800 dark:text-blue-200">
<div class="flex items-center">
<svg class="w-5 h-5 mr-2 text-green-600" 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>
<span>Sorgfältige Qualitätsprüfung aller Anträge</span>
</div>
<div class="flex items-center">
<svg class="w-5 h-5 mr-2 text-green-600" 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>
<span>Bearbeitungszeit: 24-48 Stunden</span>
</div>
<div class="flex items-center">
<svg class="w-5 h-5 mr-2 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 2.26a2 2 0 001.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
</svg>
<span>E-Mail-Benachrichtigung über Status</span>
</div>
<div class="flex items-center">
<svg class="w-5 h-5 mr-2 text-green-600" 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>
<span>Automatischer Druckstart nach Genehmigung</span>
</div>
</div>
</div>
</div>
</div>
<!-- Enhanced Form Container -->
<div class="guest-form-container p-8">
<div class="mb-8">
<h2 class="text-2xl font-bold text-mercedes-black dark:text-white mb-3">
Druckantrag einreichen
</h2>
<p class="text-mercedes-gray dark:text-slate-400 text-lg">
Füllen Sie alle erforderlichen Felder aus, um Ihren Druckantrag zu stellen.
<strong>Alle Angaben werden vertraulich behandelt.</strong>
</p>
</div>
<form id="guestRequestForm" method="POST" enctype="multipart/form-data" class="space-y-8">
{{ form.hidden_tag() if form }}
<!-- Personal Information Section -->
<div class="bg-gray-50 dark:bg-slate-800/50 rounded-xl p-6">
<h3 class="text-lg font-semibold text-mercedes-black dark:text-white mb-4 flex items-center">
<svg class="w-5 h-5 mr-2 text-mercedes-blue" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
Persönliche Angaben
</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Name -->
<div>
<label for="{{ form.name.id if form else 'name' }}" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
Vollständiger Name *
</label>
{% if form %}
{{ form.name(class="mercedes-form-input block w-full px-4 py-3", placeholder="z.B. Max Mustermann", required="required") }}
{% else %}
<input type="text" id="name" name="name" required
class="mercedes-form-input block w-full px-4 py-3"
placeholder="z.B. Max Mustermann">
{% endif %}
{% if form and form.name.errors %}
<div class="mt-2 text-sm text-mercedes-red">
{% for error in form.name.errors %}
<p class="flex items-center">
<svg class="w-4 h-4 mr-1" 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>
{{ error }}
</p>
{% endfor %}
</div>
{% endif %}
</div>
<!-- E-Mail -->
<div>
<label for="{{ form.email.id if form else 'email' }}" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
E-Mail-Adresse *
</label>
{% if form %}
{{ form.email(class="mercedes-form-input block w-full px-4 py-3", placeholder="ihre.email@example.com", required="required") }}
{% else %}
<input type="email" id="email" name="email" required
class="mercedes-form-input block w-full px-4 py-3"
placeholder="ihre.email@example.com">
{% endif %}
<p class="mt-1 text-xs text-mercedes-gray dark:text-slate-400">
Sie erhalten Status-Updates an diese E-Mail-Adresse
</p>
{% if form and form.email.errors %}
<div class="mt-2 text-sm text-mercedes-red">
{% for error in form.email.errors %}
<p class="flex items-center">
<svg class="w-4 h-4 mr-1" 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>
{{ error }}
</p>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<!-- Project Details Section -->
<div class="bg-gray-50 dark:bg-slate-800/50 rounded-xl p-6">
<h3 class="text-lg font-semibold text-mercedes-black dark:text-white mb-4 flex items-center">
<svg class="w-5 h-5 mr-2 text-mercedes-blue" 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>
Projekt-Details
</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Drucker -->
<div>
<label for="{{ form.printer_id.id if form else 'printer_id' }}" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
Gewünschter Drucker *
</label>
{% if form %}
{{ form.printer_id(class="mercedes-form-input block w-full px-4 py-3", required="required") }}
{% else %}
<select id="printer_id" name="printer_id" required class="mercedes-form-input block w-full px-4 py-3">
<option value="">Drucker auswählen...</option>
<option value="1">Prusa i3 MK3S+ (PLA/PETG)</option>
<option value="2">Ultimaker S3 (PLA/ABS/PETG)</option>
<option value="3">Formlabs Form 3 (Resin)</option>
</select>
{% endif %}
<p class="mt-1 text-xs text-mercedes-gray dark:text-slate-400">
Wählen Sie den für Ihr Material geeigneten Drucker
</p>
{% if form and form.printer_id.errors %}
<div class="mt-2 text-sm text-mercedes-red">
{% for error in form.printer_id.errors %}
<p class="flex items-center">
<svg class="w-4 h-4 mr-1" 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>
{{ error }}
</p>
{% endfor %}
</div>
{% endif %}
</div>
<!-- Geschätzte Dauer -->
<div>
<label for="{{ form.duration_min.id if form else 'duration_min' }}" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
Geschätzte Druckdauer *
</label>
<div class="relative">
{% if form %}
{{ form.duration_min(class="mercedes-form-input block w-full px-4 py-3 pr-20", placeholder="z.B. 120", required="required") }}
{% else %}
<input type="number" id="duration_min" name="duration_min" min="1" required
class="mercedes-form-input block w-full px-4 py-3 pr-20"
placeholder="z.B. 120">
{% endif %}
<div class="absolute inset-y-0 right-0 flex items-center pr-4 pointer-events-none">
<span class="text-mercedes-gray dark:text-slate-400 text-sm font-medium">Minuten</span>
</div>
</div>
<p class="mt-1 text-xs text-mercedes-gray dark:text-slate-400">
Ungefähre Druckzeit basierend auf der Dateigröße und Komplexität
</p>
{% if form and form.duration_min.errors %}
<div class="mt-2 text-sm text-mercedes-red">
{% for error in form.duration_min.errors %}
<p class="flex items-center">
<svg class="w-4 h-4 mr-1" 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>
{{ error }}
</p>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<!-- Projektbeschreibung -->
<div class="mt-6">
<label for="{{ form.reason.id if form else 'reason' }}" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
Projektbeschreibung *
</label>
{% if form %}
{{ form.reason(class="mercedes-form-input block w-full px-4 py-3 resize-none custom-scroll", rows="5", placeholder="Beschreiben Sie detailliert Ihr Projekt, den geplanten Verwendungszweck, besondere Anforderungen und weitere relevante Informationen...", required="required") }}
{% else %}
<textarea id="reason" name="reason" rows="5" required
class="mercedes-form-input block w-full px-4 py-3 resize-none custom-scroll"
placeholder="Beschreiben Sie detailliert Ihr Projekt, den geplanten Verwendungszweck, besondere Anforderungen und weitere relevante Informationen..."></textarea>
{% endif %}
<p class="mt-1 text-xs text-mercedes-gray dark:text-slate-400">
Mindestens 50 Zeichen. Je detaillierter die Beschreibung, desto besser können wir Ihren Antrag bewerten.
</p>
{% if form and form.reason.errors %}
<div class="mt-2 text-sm text-mercedes-red">
{% for error in form.reason.errors %}
<p class="flex items-center">
<svg class="w-4 h-4 mr-1" 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>
{{ error }}
</p>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<!-- File Upload Section -->
<div class="bg-gray-50 dark:bg-slate-800/50 rounded-xl p-6">
<h3 class="text-lg font-semibold text-mercedes-black dark:text-white mb-4 flex items-center">
<svg class="w-5 h-5 mr-2 text-mercedes-blue" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"/>
</svg>
3D-Datei hochladen
</h3>
<div id="file-upload-container">
<div class="upload-area flex items-center justify-center w-full h-40 cursor-pointer" id="upload-area">
<div class="text-center" id="upload-content">
<svg class="w-12 h-12 mb-4 text-mercedes-silver mx-auto" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"/>
</svg>
<p class="mb-2 text-lg font-semibold text-mercedes-black dark:text-white">
Datei hier ablegen oder <span class="text-mercedes-blue">klicken zum Hochladen</span>
</p>
<p class="text-sm text-mercedes-gray dark:text-slate-400">
STL, OBJ, 3MF, GCODE und andere 3D-Dateien (max. 50MB)
</p>
<div class="mt-4 flex flex-wrap justify-center gap-2 text-xs">
<span class="px-2 py-1 bg-mercedes-blue text-white rounded">STL</span>
<span class="px-2 py-1 bg-mercedes-blue text-white rounded">OBJ</span>
<span class="px-2 py-1 bg-mercedes-blue text-white rounded">3MF</span>
<span class="px-2 py-1 bg-mercedes-blue text-white rounded">GCODE</span>
</div>
</div>
{% if form %}
{{ form.file(class="hidden", id="file-input") }}
{% else %}
<input type="file" id="file-input" name="file" class="hidden" accept=".stl,.obj,.3mf,.gcode,.ply">
{% endif %}
</div>
<!-- File Preview (Hidden by default) -->
<div id="file-preview" class="hidden mt-4"></div>
</div>
{% if form and form.file.errors %}
<div class="mt-4 text-sm text-mercedes-red">
{% for error in form.file.errors %}
<p class="flex items-center">
<svg class="w-4 h-4 mr-1" 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>
{{ error }}
</p>
{% endfor %}
</div>
{% endif %}
</div>
<!-- Submit Section -->
<div class="flex items-center justify-between pt-8 border-t border-mercedes-silver">
<div class="text-sm text-mercedes-gray dark:text-slate-400">
<p class="flex items-center">
<svg class="w-4 h-4 mr-1 text-mercedes-red" 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>
* Pflichtfelder
</p>
<p class="mt-1 text-xs">
Alle Daten werden vertraulich behandelt und entsprechen der DSGVO.
</p>
</div>
<div class="flex space-x-4">
<button type="button" onclick="resetForm()"
class="btn-secondary">
<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="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>
Zurücksetzen
</button>
<button type="submit" id="submit-button"
class="btn-primary" disabled>
<svg class="w-5 h-5 mr-2" id="submit-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"/>
</svg>
<svg class="w-5 h-5 mr-2 animate-spin hidden" id="submit-spinner" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
<span id="submit-text">Antrag einreichen</span>
</button>
</div>
</div>
</form>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// File upload preview
const fileInput = document.getElementById('{{ form.file.id }}');
if (fileInput) {
fileInput.addEventListener('change', function(e) {
const file = e.target.files[0];
if (file) {
const label = fileInput.closest('label');
const textElement = label.querySelector('p');
textElement.innerHTML = `<span class="font-semibold">Datei ausgewählt:</span> ${file.name}`;
}
});
}
});
</script>
{% endblock %}