bugfix
All checks were successful
Build & Push Docker Image / docker (push) Successful in 1m53s

This commit is contained in:
Ahmed Darrazi 2025-12-19 15:55:45 +01:00
parent 1b8be73219
commit a09c33a762
3 changed files with 75 additions and 75 deletions

View File

@ -19,21 +19,21 @@ class CertificateController extends Controller
// If no active template exists, use default template data // If no active template exists, use default template data
if (!$activeTemplate) { if (!$activeTemplate) {
$activeTemplate = [ $activeTemplate = [
'id' => 0, 'id' => 0,
'name' => 'Default Template', 'name' => 'Standardvorlage',
'logo_path' => null, 'logo_path' => null,
'template_data' => [ 'template_data' => [
'primaryColor' => '#3730a3', 'primaryColor' => '#3730a3',
'secondaryColor' => '#4b5563', 'secondaryColor' => '#4b5563',
'backgroundColor' => '#dbeafe', 'backgroundColor' => '#dbeafe',
'borderColor' => '#f59e0b', 'borderColor' => '#f59e0b',
'titleText' => 'Certificate of Completion', 'titleText' => 'Zertifikat über den Abschluss',
'descriptionText' => 'This certificate is proudly presented to', 'descriptionText' => 'Dieses Zertifikat wird feierlich überreicht an',
'completionText' => 'for successfully completing the course', 'completionText' => 'für den erfolgreichen Abschluss des Kurses',
'footerText' => 'Authorized Certificate', 'footerText' => 'Offizielles Zertifikat',
'fontFamily' => 'serif', 'fontFamily' => 'serif',
], ],
'is_active' => false, 'is_active' => false,
]; ];
} }

View File

@ -23,10 +23,10 @@ class CertificateTemplateSeeder extends Seeder
'secondaryColor' => '#475569', 'secondaryColor' => '#475569',
'backgroundColor' => '#eff6ff', 'backgroundColor' => '#eff6ff',
'borderColor' => '#2563eb', 'borderColor' => '#2563eb',
'titleText' => 'Certificate of Achievement', 'titleText' => 'Leistungszertifikat',
'descriptionText' => 'This certificate is proudly presented to', 'descriptionText' => 'Dieses Zertifikat wird feierlich überreicht an',
'completionText' => 'for successfully completing the course', 'completionText' => 'für den erfolgreichen Abschluss des Kurses',
'footerText' => 'Authorized and Certified', 'footerText' => 'Offiziell beglaubigt',
'fontFamily' => 'sans-serif', 'fontFamily' => 'sans-serif',
], ],
'is_active' => true, 'is_active' => true,
@ -44,10 +44,10 @@ class CertificateTemplateSeeder extends Seeder
'secondaryColor' => '#1f2937', 'secondaryColor' => '#1f2937',
'backgroundColor' => '#d1fae5', 'backgroundColor' => '#d1fae5',
'borderColor' => '#10b981', 'borderColor' => '#10b981',
'titleText' => 'Certificate of Excellence', 'titleText' => 'Exzellenzzertifikat',
'descriptionText' => 'This is to certify that', 'descriptionText' => 'Hiermit wird bescheinigt, dass',
'completionText' => 'has demonstrated outstanding achievement in', 'completionText' => 'hat herausragende Leistungen in gezeigt',
'footerText' => 'Congratulations on your accomplishment', 'footerText' => 'Herzlichen Glückwunsch zu Ihrer Leistung',
'fontFamily' => 'serif', 'fontFamily' => 'serif',
], ],
'is_active' => false, 'is_active' => false,
@ -65,10 +65,10 @@ class CertificateTemplateSeeder extends Seeder
'secondaryColor' => '#374151', 'secondaryColor' => '#374151',
'backgroundColor' => '#fae8ff', 'backgroundColor' => '#fae8ff',
'borderColor' => '#c026d3', 'borderColor' => '#c026d3',
'titleText' => 'Certificate of Completion', 'titleText' => 'Zertifikat über den Abschluss',
'descriptionText' => 'This prestigious certificate is awarded to', 'descriptionText' => 'Dieses renommierte Zertifikat wird verliehen an',
'completionText' => 'for exceptional dedication and successful completion of', 'completionText' => 'für außergewöhnliches Engagement und erfolgreichen Abschluss von',
'footerText' => 'Excellence in Learning', 'footerText' => 'Exzellenz im Lernen',
'fontFamily' => 'cursive', 'fontFamily' => 'cursive',
], ],
'is_active' => false, 'is_active' => false,
@ -86,10 +86,10 @@ class CertificateTemplateSeeder extends Seeder
'secondaryColor' => '#1f2937', 'secondaryColor' => '#1f2937',
'backgroundColor' => '#fef2f2', 'backgroundColor' => '#fef2f2',
'borderColor' => '#ef4444', 'borderColor' => '#ef4444',
'titleText' => 'Certificate of Examination Excellence', 'titleText' => 'Zertifikat für herausragende Prüfungsleistung',
'descriptionText' => 'This certificate is proudly presented to', 'descriptionText' => 'Dieses Zertifikat wird feierlich überreicht an',
'completionText' => 'for outstanding performance in the examination', 'completionText' => 'für herausragende Leistungen in der Prüfung',
'footerText' => 'Authorized Examination Certificate', 'footerText' => 'Offizielles Prüfungszertifikat',
'fontFamily' => 'sans-serif', 'fontFamily' => 'sans-serif',
], ],
'is_active' => true, 'is_active' => true,
@ -107,10 +107,10 @@ class CertificateTemplateSeeder extends Seeder
'secondaryColor' => '#374151', 'secondaryColor' => '#374151',
'backgroundColor' => '#fff7ed', 'backgroundColor' => '#fff7ed',
'borderColor' => '#f97316', 'borderColor' => '#f97316',
'titleText' => 'Certificate of Assessment Achievement', 'titleText' => 'Zertifikat für Bewertungserfolg',
'descriptionText' => 'This is to certify that', 'descriptionText' => 'Hiermit wird bescheinigt, dass',
'completionText' => 'has successfully passed the assessment with distinction', 'completionText' => 'hat die Bewertung mit Auszeichnung bestanden',
'footerText' => 'Verified Assessment Certificate', 'footerText' => 'Verifiziertes Bewertungszertifikat',
'fontFamily' => 'serif', 'fontFamily' => 'serif',
], ],
'is_active' => false, 'is_active' => false,
@ -128,10 +128,10 @@ class CertificateTemplateSeeder extends Seeder
'secondaryColor' => '#1f2937', 'secondaryColor' => '#1f2937',
'backgroundColor' => '#f0fdfa', 'backgroundColor' => '#f0fdfa',
'borderColor' => '#14b8a6', 'borderColor' => '#14b8a6',
'titleText' => 'Certificate of Test Excellence', 'titleText' => 'Zertifikat für herausragende Testergebnisse',
'descriptionText' => 'This prestigious certificate is awarded to', 'descriptionText' => 'Dieses renommierte Zertifikat wird verliehen an',
'completionText' => 'for exceptional performance in the test', 'completionText' => 'für außergewöhnliche Leistungen im Test',
'footerText' => 'Certified Test Achievement', 'footerText' => 'Zertifikat für herausragende Testergebnisse',
'fontFamily' => 'cursive', 'fontFamily' => 'cursive',
], ],
'is_active' => false, 'is_active' => false,

View File

@ -53,31 +53,31 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<div className="space-y-6"> <div className="space-y-6">
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>Basic Information</CardTitle> <CardTitle>Grundinformationen</CardTitle>
<CardDescription>Set the template name and activation status</CardDescription> <CardDescription>Vorlagenname und Aktivierungsstatus festlegen</CardDescription>
</CardHeader> </CardHeader>
<CardContent className="space-y-4"> <CardContent className="space-y-4">
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="type">Template Type</Label> <Label htmlFor="type">Vorlagentyp</Label>
<Select value={data.type} onValueChange={(value) => setData('type', value as any)}> <Select value={data.type} onValueChange={(value) => setData('type', value as any)}>
<SelectTrigger> <SelectTrigger>
<SelectValue placeholder="Select template type" /> <SelectValue placeholder="Vorlagentyp wählen" />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="course">Course</SelectItem> <SelectItem value="course">Kurs</SelectItem>
<SelectItem value="exam">Exam</SelectItem> <SelectItem value="exam">Prüfung</SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>
{errors.type && <p className="text-sm text-red-500">{errors.type}</p>} {errors.type && <p className="text-sm text-red-500">{errors.type}</p>}
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="name">Template Name</Label> <Label htmlFor="name">Vorlagenname</Label>
<Input <Input
id="name" id="name"
value={data.name} value={data.name}
onChange={(e) => setData('name', e.target.value)} onChange={(e) => setData('name', e.target.value)}
placeholder="e.g., Modern Blue Certificate" placeholder="z. B. Modernes blaues Zertifikat"
/> />
{errors.name && <p className="text-sm text-red-500">{errors.name}</p>} {errors.name && <p className="text-sm text-red-500">{errors.name}</p>}
</div> </div>
@ -87,11 +87,11 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>Logo & Branding</CardTitle> <CardTitle>Logo & Branding</CardTitle>
<CardDescription>Upload your institution or course logo</CardDescription> <CardDescription>Logo Ihrer Institution oder des Kurses hochladen</CardDescription>
</CardHeader> </CardHeader>
<CardContent className="space-y-4"> <CardContent className="space-y-4">
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="logo">Logo Image</Label> <Label htmlFor="logo">Logo-Bild</Label>
<div className="space-y-2"> <div className="space-y-2">
{logoPreview && ( {logoPreview && (
<div className="h-20 w-20 overflow-hidden rounded border"> <div className="h-20 w-20 overflow-hidden rounded border">
@ -102,7 +102,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<Input id="logo" type="file" accept="image/*" onChange={(e) => onLogoChange('logo', e.target.files?.[0])} /> <Input id="logo" type="file" accept="image/*" onChange={(e) => onLogoChange('logo', e.target.files?.[0])} />
</div> </div>
</div> </div>
<p className="text-muted-foreground text-xs">Recommended: PNG or SVG, max 1MB</p> <p className="text-muted-foreground text-xs">Empfohlen: PNG oder SVG, max. 1MB</p>
<InputError message={errors.logo} /> <InputError message={errors.logo} />
</div> </div>
</CardContent> </CardContent>
@ -110,13 +110,13 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>Colors</CardTitle> <CardTitle>Farben</CardTitle>
<CardDescription>Customize the certificate color scheme</CardDescription> <CardDescription>Farbgestaltung des Zertifikats anpassen</CardDescription>
</CardHeader> </CardHeader>
<CardContent className="space-y-4"> <CardContent className="space-y-4">
<div className="grid grid-cols-2 gap-4"> <div className="grid grid-cols-2 gap-4">
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="primaryColor">Primary Color</Label> <Label htmlFor="primaryColor">Primärfarbe</Label>
<div className="flex gap-2"> <div className="flex gap-2">
<Input <Input
id="primaryColor" id="primaryColor"
@ -134,7 +134,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="secondaryColor">Secondary Color</Label> <Label htmlFor="secondaryColor">Sekundärfarbe</Label>
<div className="flex gap-2"> <div className="flex gap-2">
<Input <Input
id="secondaryColor" id="secondaryColor"
@ -152,7 +152,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="backgroundColor">Background Color</Label> <Label htmlFor="backgroundColor">Hintergrundfarbe</Label>
<div className="flex gap-2"> <div className="flex gap-2">
<Input <Input
id="backgroundColor" id="backgroundColor"
@ -170,7 +170,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="borderColor">Border Color</Label> <Label htmlFor="borderColor">Rahmenfarbe</Label>
<div className="flex gap-2"> <div className="flex gap-2">
<Input <Input
id="borderColor" id="borderColor"
@ -192,12 +192,12 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>Typography</CardTitle> <CardTitle>Typografie</CardTitle>
<CardDescription>Choose the font style for your certificate</CardDescription> <CardDescription>Schriftstil für das Zertifikat wählen</CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="fontFamily">Font Family</Label> <Label htmlFor="fontFamily">Schriftfamilie</Label>
<Select <Select
value={data.template_data.fontFamily} value={data.template_data.fontFamily}
onValueChange={(value) => setData('template_data', { ...data.template_data, fontFamily: value })} onValueChange={(value) => setData('template_data', { ...data.template_data, fontFamily: value })}
@ -206,10 +206,10 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="serif">Serif (Classic)</SelectItem> <SelectItem value="serif">Serif (Klassisch)</SelectItem>
<SelectItem value="sans-serif">Sans Serif (Modern)</SelectItem> <SelectItem value="sans-serif">Sans Serif (Modern)</SelectItem>
<SelectItem value="monospace">Monospace (Technical)</SelectItem> <SelectItem value="monospace">Monospace (Technisch)</SelectItem>
<SelectItem value="cursive">Cursive (Elegant)</SelectItem> <SelectItem value="cursive">Kursive (Elegant)</SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>
</div> </div>
@ -218,48 +218,48 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>Certificate Text</CardTitle> <CardTitle>Zertifikattext</CardTitle>
<CardDescription>Customize the text content of your certificate</CardDescription> <CardDescription>Textinhalt des Zertifikats anpassen</CardDescription>
</CardHeader> </CardHeader>
<CardContent className="space-y-4"> <CardContent className="space-y-4">
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="titleText">Title Text</Label> <Label htmlFor="titleText">Titeltext</Label>
<Input <Input
id="titleText" id="titleText"
value={data.template_data.titleText} value={data.template_data.titleText}
onChange={(e) => setData('template_data', { ...data.template_data, titleText: e.target.value })} onChange={(e) => setData('template_data', { ...data.template_data, titleText: e.target.value })}
placeholder="Certificate of Completion" placeholder="Zertifikat über den Abschluss"
/> />
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="descriptionText">Description Text</Label> <Label htmlFor="descriptionText">Beschreibungstext</Label>
<Textarea <Textarea
id="descriptionText" id="descriptionText"
value={data.template_data.descriptionText} value={data.template_data.descriptionText}
onChange={(e) => setData('template_data', { ...data.template_data, descriptionText: e.target.value })} onChange={(e) => setData('template_data', { ...data.template_data, descriptionText: e.target.value })}
placeholder="This certificate is proudly presented to" placeholder="Dieses Zertifikat wird feierlich überreicht an"
rows={3} rows={3}
/> />
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="completionText">Completion Text</Label> <Label htmlFor="completionText">Abschlusstext</Label>
<Input <Input
id="completionText" id="completionText"
value={data.template_data.completionText} value={data.template_data.completionText}
onChange={(e) => setData('template_data', { ...data.template_data, completionText: e.target.value })} onChange={(e) => setData('template_data', { ...data.template_data, completionText: e.target.value })}
placeholder="for successfully completing the course" placeholder="für den erfolgreichen Abschluss des Kurses"
/> />
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="footerText">Footer Text</Label> <Label htmlFor="footerText">Fußzeilentext</Label>
<Input <Input
id="footerText" id="footerText"
value={data.template_data.footerText} value={data.template_data.footerText}
onChange={(e) => setData('template_data', { ...data.template_data, footerText: e.target.value })} onChange={(e) => setData('template_data', { ...data.template_data, footerText: e.target.value })}
placeholder="Authorized Certificate" placeholder="Offizielles Zertifikat"
/> />
</div> </div>
</CardContent> </CardContent>
@ -267,7 +267,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<Button onClick={handleSubmit} disabled={processing} className="w-full"> <Button onClick={handleSubmit} disabled={processing} className="w-full">
<Save className="mr-2 h-4 w-4" /> <Save className="mr-2 h-4 w-4" />
{processing ? 'Saving...' : template ? 'Update Template' : 'Create Template'} {processing ? 'Speichere...' : template ? 'Vorlage aktualisieren' : 'Vorlage erstellen'}
</Button> </Button>
</div> </div>
@ -275,8 +275,8 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
<div className="lg:sticky lg:top-6"> <div className="lg:sticky lg:top-6">
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>Live Preview</CardTitle> <CardTitle>Echtzeit-Vorschau</CardTitle>
<CardDescription>See how your certificate will look</CardDescription> <CardDescription>So sieht Ihr Zertifikat aus</CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<CertificatePreview <CertificatePreview