add success page
This commit is contained in:
parent
74ff5a23e0
commit
b50b2e0a62
3
.ddev/commands/host/cf
Executable file
3
.ddev/commands/host/cf
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cloudflared tunnel --url "https://127.0.0.1/$DDEV_HOST_HTTPS_PORT" --http-host-header "$DDEV_SITENAME.$DDEV_TLD"
|
@ -3,8 +3,8 @@
|
|||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\DataObjects\TicketFormData;
|
use App\DataObjects\TicketFormData;
|
||||||
|
use App\Service\EventService;
|
||||||
use App\Service\TicketService;
|
use App\Service\TicketService;
|
||||||
use Stripe\Stripe;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@ -16,6 +16,7 @@ final class TicketController extends AbstractController
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private TicketService $service,
|
private TicketService $service,
|
||||||
private SerializerInterface $serializer,
|
private SerializerInterface $serializer,
|
||||||
|
private EventService $eventService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,4 +61,15 @@ final class TicketController extends AbstractController
|
|||||||
|
|
||||||
return $this->redirectToRoute('app_ticket');
|
return $this->redirectToRoute('app_ticket');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/calendar', name: 'app_calendar')]
|
||||||
|
public function calendar(Request $request): Response
|
||||||
|
{
|
||||||
|
$userAgent = $request->headers->get('User-Agent');
|
||||||
|
$isApple = str_contains($userAgent, 'Mac') || str_contains($userAgent, 'iPhone') || str_contains($userAgent, 'iPad');
|
||||||
|
|
||||||
|
return $isApple
|
||||||
|
? $this->eventService->generateIcs()
|
||||||
|
: $this->eventService->generateGoogleRedirect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
50
src/Service/EventService.php
Normal file
50
src/Service/EventService.php
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Service;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
class EventService
|
||||||
|
{
|
||||||
|
private const EVENT_DATA = [
|
||||||
|
'title' => 'FWS Abiball',
|
||||||
|
'description' => 'Der Abiball der Freien Waldorfschule Bremen Osterholz und Touler Straße',
|
||||||
|
'location' => 'Graubünder Straße 2, 28209 Bremen',
|
||||||
|
'start' => '20240615T180000',
|
||||||
|
'end' => '20240615T220000',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function generateIcs(): Response
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'BEGIN:VCALENDAR',
|
||||||
|
'VERSION:2.0',
|
||||||
|
'BEGIN:VEVENT',
|
||||||
|
'DTSTART:' . self::EVENT_DATA['start'],
|
||||||
|
'DTEND:' . self::EVENT_DATA['end'],
|
||||||
|
'SUMMARY:' . self::EVENT_DATA['title'],
|
||||||
|
'DESCRIPTION:' . self::EVENT_DATA['description'],
|
||||||
|
'LOCATION:' . self::EVENT_DATA['location'],
|
||||||
|
'END:VEVENT',
|
||||||
|
'END:VCALENDAR'
|
||||||
|
];
|
||||||
|
|
||||||
|
return new Response(implode("\r\n", $data), headers: [
|
||||||
|
'Content-Type' => 'text/calendar; charset=utf-8',
|
||||||
|
'Content-Disposition' => 'attachment; filename="event.ics"'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function generateGoogleRedirect(): Response
|
||||||
|
{
|
||||||
|
return new RedirectResponse('https://calendar.google.com/calendar/render?' . http_build_query([
|
||||||
|
'action' => 'TEMPLATE',
|
||||||
|
'text' => self::EVENT_DATA['title'],
|
||||||
|
'dates' => self::EVENT_DATA['start'] . '/' . self::EVENT_DATA['end'],
|
||||||
|
'details' => self::EVENT_DATA['description'],
|
||||||
|
'location' => self::EVENT_DATA['location'],
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,66 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
Success
|
Danke
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="container">
|
<div class="min-h-screen bg-gradient-to-b from-white to-gray-50 relative overflow-hidden">
|
||||||
<div class="row">
|
<header class="w-full bg-white/90 backdrop-blur-md shadow-lg fixed top-0 z-50 border-b border-gray-100">
|
||||||
<div class="col-md-12">
|
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-3 sm:py-4 flex justify-between items-center">
|
||||||
<h1 class="text-center">Success</h1>
|
<a href="{{ path('app_home') }}" class="flex items-center space-x-2 group">
|
||||||
<p class="text-center">Your ticket has been successfully created.</p>
|
<img src="{{ asset('images/logo.png') }}" alt="Logo" class="w-32 sm:w-36 md:w-40 h-auto group-hover:opacity-90 transition-opacity" />
|
||||||
|
</a>
|
||||||
|
<a href="{{ path('app_home') }}" class="bg-gradient-to-r from-red-500 to-orange-500 hover:from-red-600 hover:to-orange-600 text-white px-6 py-2.5 rounded-full text-sm font-medium shadow-md hover:shadow-lg transition-all duration-300 flex items-center space-x-2">
|
||||||
|
<twig:ux:icon name="line-md:home" class="w-4 h-4" />
|
||||||
|
<span>Zurück zur Startseite</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="container mx-auto px-4 sm:px-6 lg:px-8 pt-24 sm:pt-28 md:pt-32 pb-16 sm:pb-20 flex flex-col items-center justify-center relative z-10">
|
||||||
|
<div class="w-full max-w-2xl mx-auto text-center">
|
||||||
|
<div class="mb-8">
|
||||||
|
<div class="inline-flex items-center justify-center w-16 h-16 rounded-full bg-green-100 mb-6">
|
||||||
|
<twig:ux:icon name="heroicons:check-circle" class="w-10 h-10 text-green-500" />
|
||||||
|
</div>
|
||||||
|
<h1 class="text-3xl sm:text-4xl font-bold text-gray-900 mb-4">Vielen Dank für deine Bestellung!</h1>
|
||||||
|
<p class="text-lg text-gray-600">Wir freuen uns, dich bei der Veranstaltung begrüßen zu dürfen.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bg-white rounded-2xl shadow-lg p-8 border border-gray-100">
|
||||||
|
<h2 class="text-2xl font-semibold text-purple-900 mb-6">Veranstaltungsdetails</h2>
|
||||||
|
<div class="space-y-4">
|
||||||
|
<div class="flex items-center justify-center space-x-3">
|
||||||
|
<twig:ux:icon name="heroicons:calendar" class="w-5 h-5 text-gray-400" />
|
||||||
|
<p class="text-gray-700">[Datum]</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-center space-x-3">
|
||||||
|
<twig:ux:icon name="heroicons:clock" class="w-5 h-5 text-gray-400" />
|
||||||
|
<p class="text-gray-700">[Uhrzeit]</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-center space-x-3">
|
||||||
|
<twig:ux:icon name="heroicons:map-pin" class="w-5 h-5 text-gray-400" />
|
||||||
|
<p class="text-gray-700">[Adresse]</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-8 pt-6 border-t border-gray-100">
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<a href="{{ path('app_calendar') }}"
|
||||||
|
target="_blank"
|
||||||
|
class="flex items-center px-6 py-2.5 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors">
|
||||||
|
<twig:ux:icon name="heroicons:calendar" class="w-5 h-5 text-gray-600 mr-2" />
|
||||||
|
<span class="text-sm text-gray-700">Zum Kalender hinzufügen</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Decorative elements -->
|
||||||
|
<div class="absolute top-1/2 left-0 transform -translate-y-1/2 -translate-x-1/2 w-96 h-96 bg-orange-100 rounded-full opacity-20 blur-3xl"></div>
|
||||||
|
<div class="absolute bottom-0 right-0 transform translate-y-1/2 translate-x-1/2 w-96 h-96 bg-red-100 rounded-full opacity-20 blur-3xl"></div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user