This commit is contained in:
parent
1b8be73219
commit
a09c33a762
@ -19,21 +19,21 @@ class CertificateController extends Controller
|
||||
// If no active template exists, use default template data
|
||||
if (!$activeTemplate) {
|
||||
$activeTemplate = [
|
||||
'id' => 0,
|
||||
'name' => 'Default Template',
|
||||
'logo_path' => null,
|
||||
'template_data' => [
|
||||
'primaryColor' => '#3730a3',
|
||||
'secondaryColor' => '#4b5563',
|
||||
'backgroundColor' => '#dbeafe',
|
||||
'borderColor' => '#f59e0b',
|
||||
'titleText' => 'Certificate of Completion',
|
||||
'descriptionText' => 'This certificate is proudly presented to',
|
||||
'completionText' => 'for successfully completing the course',
|
||||
'footerText' => 'Authorized Certificate',
|
||||
'fontFamily' => 'serif',
|
||||
],
|
||||
'is_active' => false,
|
||||
'id' => 0,
|
||||
'name' => 'Standardvorlage',
|
||||
'logo_path' => null,
|
||||
'template_data' => [
|
||||
'primaryColor' => '#3730a3',
|
||||
'secondaryColor' => '#4b5563',
|
||||
'backgroundColor' => '#dbeafe',
|
||||
'borderColor' => '#f59e0b',
|
||||
'titleText' => 'Zertifikat über den Abschluss',
|
||||
'descriptionText' => 'Dieses Zertifikat wird feierlich überreicht an',
|
||||
'completionText' => 'für den erfolgreichen Abschluss des Kurses',
|
||||
'footerText' => 'Offizielles Zertifikat',
|
||||
'fontFamily' => 'serif',
|
||||
],
|
||||
'is_active' => false,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -23,10 +23,10 @@ class CertificateTemplateSeeder extends Seeder
|
||||
'secondaryColor' => '#475569',
|
||||
'backgroundColor' => '#eff6ff',
|
||||
'borderColor' => '#2563eb',
|
||||
'titleText' => 'Certificate of Achievement',
|
||||
'descriptionText' => 'This certificate is proudly presented to',
|
||||
'completionText' => 'for successfully completing the course',
|
||||
'footerText' => 'Authorized and Certified',
|
||||
'titleText' => 'Leistungszertifikat',
|
||||
'descriptionText' => 'Dieses Zertifikat wird feierlich überreicht an',
|
||||
'completionText' => 'für den erfolgreichen Abschluss des Kurses',
|
||||
'footerText' => 'Offiziell beglaubigt',
|
||||
'fontFamily' => 'sans-serif',
|
||||
],
|
||||
'is_active' => true,
|
||||
@ -44,10 +44,10 @@ class CertificateTemplateSeeder extends Seeder
|
||||
'secondaryColor' => '#1f2937',
|
||||
'backgroundColor' => '#d1fae5',
|
||||
'borderColor' => '#10b981',
|
||||
'titleText' => 'Certificate of Excellence',
|
||||
'descriptionText' => 'This is to certify that',
|
||||
'completionText' => 'has demonstrated outstanding achievement in',
|
||||
'footerText' => 'Congratulations on your accomplishment',
|
||||
'titleText' => 'Exzellenzzertifikat',
|
||||
'descriptionText' => 'Hiermit wird bescheinigt, dass',
|
||||
'completionText' => 'hat herausragende Leistungen in gezeigt',
|
||||
'footerText' => 'Herzlichen Glückwunsch zu Ihrer Leistung',
|
||||
'fontFamily' => 'serif',
|
||||
],
|
||||
'is_active' => false,
|
||||
@ -65,10 +65,10 @@ class CertificateTemplateSeeder extends Seeder
|
||||
'secondaryColor' => '#374151',
|
||||
'backgroundColor' => '#fae8ff',
|
||||
'borderColor' => '#c026d3',
|
||||
'titleText' => 'Certificate of Completion',
|
||||
'descriptionText' => 'This prestigious certificate is awarded to',
|
||||
'completionText' => 'for exceptional dedication and successful completion of',
|
||||
'footerText' => 'Excellence in Learning',
|
||||
'titleText' => 'Zertifikat über den Abschluss',
|
||||
'descriptionText' => 'Dieses renommierte Zertifikat wird verliehen an',
|
||||
'completionText' => 'für außergewöhnliches Engagement und erfolgreichen Abschluss von',
|
||||
'footerText' => 'Exzellenz im Lernen',
|
||||
'fontFamily' => 'cursive',
|
||||
],
|
||||
'is_active' => false,
|
||||
@ -86,10 +86,10 @@ class CertificateTemplateSeeder extends Seeder
|
||||
'secondaryColor' => '#1f2937',
|
||||
'backgroundColor' => '#fef2f2',
|
||||
'borderColor' => '#ef4444',
|
||||
'titleText' => 'Certificate of Examination Excellence',
|
||||
'descriptionText' => 'This certificate is proudly presented to',
|
||||
'completionText' => 'for outstanding performance in the examination',
|
||||
'footerText' => 'Authorized Examination Certificate',
|
||||
'titleText' => 'Zertifikat für herausragende Prüfungsleistung',
|
||||
'descriptionText' => 'Dieses Zertifikat wird feierlich überreicht an',
|
||||
'completionText' => 'für herausragende Leistungen in der Prüfung',
|
||||
'footerText' => 'Offizielles Prüfungszertifikat',
|
||||
'fontFamily' => 'sans-serif',
|
||||
],
|
||||
'is_active' => true,
|
||||
@ -107,10 +107,10 @@ class CertificateTemplateSeeder extends Seeder
|
||||
'secondaryColor' => '#374151',
|
||||
'backgroundColor' => '#fff7ed',
|
||||
'borderColor' => '#f97316',
|
||||
'titleText' => 'Certificate of Assessment Achievement',
|
||||
'descriptionText' => 'This is to certify that',
|
||||
'completionText' => 'has successfully passed the assessment with distinction',
|
||||
'footerText' => 'Verified Assessment Certificate',
|
||||
'titleText' => 'Zertifikat für Bewertungserfolg',
|
||||
'descriptionText' => 'Hiermit wird bescheinigt, dass',
|
||||
'completionText' => 'hat die Bewertung mit Auszeichnung bestanden',
|
||||
'footerText' => 'Verifiziertes Bewertungszertifikat',
|
||||
'fontFamily' => 'serif',
|
||||
],
|
||||
'is_active' => false,
|
||||
@ -128,10 +128,10 @@ class CertificateTemplateSeeder extends Seeder
|
||||
'secondaryColor' => '#1f2937',
|
||||
'backgroundColor' => '#f0fdfa',
|
||||
'borderColor' => '#14b8a6',
|
||||
'titleText' => 'Certificate of Test Excellence',
|
||||
'descriptionText' => 'This prestigious certificate is awarded to',
|
||||
'completionText' => 'for exceptional performance in the test',
|
||||
'footerText' => 'Certified Test Achievement',
|
||||
'titleText' => 'Zertifikat für herausragende Testergebnisse',
|
||||
'descriptionText' => 'Dieses renommierte Zertifikat wird verliehen an',
|
||||
'completionText' => 'für außergewöhnliche Leistungen im Test',
|
||||
'footerText' => 'Zertifikat für herausragende Testergebnisse',
|
||||
'fontFamily' => 'cursive',
|
||||
],
|
||||
'is_active' => false,
|
||||
|
||||
@ -53,31 +53,31 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
<div className="space-y-6">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Basic Information</CardTitle>
|
||||
<CardDescription>Set the template name and activation status</CardDescription>
|
||||
<CardTitle>Grundinformationen</CardTitle>
|
||||
<CardDescription>Vorlagenname und Aktivierungsstatus festlegen</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<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)}>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select template type" />
|
||||
<SelectValue placeholder="Vorlagentyp wählen" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="course">Course</SelectItem>
|
||||
<SelectItem value="exam">Exam</SelectItem>
|
||||
<SelectItem value="course">Kurs</SelectItem>
|
||||
<SelectItem value="exam">Prüfung</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
{errors.type && <p className="text-sm text-red-500">{errors.type}</p>}
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="name">Template Name</Label>
|
||||
<Label htmlFor="name">Vorlagenname</Label>
|
||||
<Input
|
||||
id="name"
|
||||
value={data.name}
|
||||
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>}
|
||||
</div>
|
||||
@ -87,11 +87,11 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Logo & Branding</CardTitle>
|
||||
<CardDescription>Upload your institution or course logo</CardDescription>
|
||||
<CardDescription>Logo Ihrer Institution oder des Kurses hochladen</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="logo">Logo Image</Label>
|
||||
<Label htmlFor="logo">Logo-Bild</Label>
|
||||
<div className="space-y-2">
|
||||
{logoPreview && (
|
||||
<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])} />
|
||||
</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} />
|
||||
</div>
|
||||
</CardContent>
|
||||
@ -110,13 +110,13 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Colors</CardTitle>
|
||||
<CardDescription>Customize the certificate color scheme</CardDescription>
|
||||
<CardTitle>Farben</CardTitle>
|
||||
<CardDescription>Farbgestaltung des Zertifikats anpassen</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="primaryColor">Primary Color</Label>
|
||||
<Label htmlFor="primaryColor">Primärfarbe</Label>
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
id="primaryColor"
|
||||
@ -134,7 +134,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="secondaryColor">Secondary Color</Label>
|
||||
<Label htmlFor="secondaryColor">Sekundärfarbe</Label>
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
id="secondaryColor"
|
||||
@ -152,7 +152,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="backgroundColor">Background Color</Label>
|
||||
<Label htmlFor="backgroundColor">Hintergrundfarbe</Label>
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
id="backgroundColor"
|
||||
@ -170,7 +170,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="borderColor">Border Color</Label>
|
||||
<Label htmlFor="borderColor">Rahmenfarbe</Label>
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
id="borderColor"
|
||||
@ -192,12 +192,12 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Typography</CardTitle>
|
||||
<CardDescription>Choose the font style for your certificate</CardDescription>
|
||||
<CardTitle>Typografie</CardTitle>
|
||||
<CardDescription>Schriftstil für das Zertifikat wählen</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="fontFamily">Font Family</Label>
|
||||
<Label htmlFor="fontFamily">Schriftfamilie</Label>
|
||||
<Select
|
||||
value={data.template_data.fontFamily}
|
||||
onValueChange={(value) => setData('template_data', { ...data.template_data, fontFamily: value })}
|
||||
@ -206,10 +206,10 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="serif">Serif (Classic)</SelectItem>
|
||||
<SelectItem value="serif">Serif (Klassisch)</SelectItem>
|
||||
<SelectItem value="sans-serif">Sans Serif (Modern)</SelectItem>
|
||||
<SelectItem value="monospace">Monospace (Technical)</SelectItem>
|
||||
<SelectItem value="cursive">Cursive (Elegant)</SelectItem>
|
||||
<SelectItem value="monospace">Monospace (Technisch)</SelectItem>
|
||||
<SelectItem value="cursive">Kursive (Elegant)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
@ -218,48 +218,48 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Certificate Text</CardTitle>
|
||||
<CardDescription>Customize the text content of your certificate</CardDescription>
|
||||
<CardTitle>Zertifikattext</CardTitle>
|
||||
<CardDescription>Textinhalt des Zertifikats anpassen</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="titleText">Title Text</Label>
|
||||
<Label htmlFor="titleText">Titeltext</Label>
|
||||
<Input
|
||||
id="titleText"
|
||||
value={data.template_data.titleText}
|
||||
onChange={(e) => setData('template_data', { ...data.template_data, titleText: e.target.value })}
|
||||
placeholder="Certificate of Completion"
|
||||
placeholder="Zertifikat über den Abschluss"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="descriptionText">Description Text</Label>
|
||||
<Label htmlFor="descriptionText">Beschreibungstext</Label>
|
||||
<Textarea
|
||||
id="descriptionText"
|
||||
value={data.template_data.descriptionText}
|
||||
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}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="completionText">Completion Text</Label>
|
||||
<Label htmlFor="completionText">Abschlusstext</Label>
|
||||
<Input
|
||||
id="completionText"
|
||||
value={data.template_data.completionText}
|
||||
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 className="space-y-2">
|
||||
<Label htmlFor="footerText">Footer Text</Label>
|
||||
<Label htmlFor="footerText">Fußzeilentext</Label>
|
||||
<Input
|
||||
id="footerText"
|
||||
value={data.template_data.footerText}
|
||||
onChange={(e) => setData('template_data', { ...data.template_data, footerText: e.target.value })}
|
||||
placeholder="Authorized Certificate"
|
||||
placeholder="Offizielles Zertifikat"
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
@ -267,7 +267,7 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
|
||||
<Button onClick={handleSubmit} disabled={processing} className="w-full">
|
||||
<Save className="mr-2 h-4 w-4" />
|
||||
{processing ? 'Saving...' : template ? 'Update Template' : 'Create Template'}
|
||||
{processing ? 'Speichere...' : template ? 'Vorlage aktualisieren' : 'Vorlage erstellen'}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@ -275,8 +275,8 @@ const CertificateBuilderForm = ({ template }: { template?: CertificateTemplate |
|
||||
<div className="lg:sticky lg:top-6">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Live Preview</CardTitle>
|
||||
<CardDescription>See how your certificate will look</CardDescription>
|
||||
<CardTitle>Echtzeit-Vorschau</CardTitle>
|
||||
<CardDescription>So sieht Ihr Zertifikat aus</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<CertificatePreview
|
||||
|
||||
Loading…
Reference in New Issue
Block a user