nicht nutzbarer stand, header menü ist nicht intertia initialisiert. aber schick. codex änderungen noch enthalten.
This commit is contained in:
1
.kilocode/mcp.json
Normal file
1
.kilocode/mcp.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"mcpServers":{}}
|
||||||
@@ -13,7 +13,9 @@ use Illuminate\Auth\Events\Registered;
|
|||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\\Support\\Facades\\DB;\r\nuse Illuminate\\Support\\Facades\\Hash;\r\nuse Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Facades\Mail;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Validation\Rules;
|
use Illuminate\Validation\Rules;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
@@ -25,7 +27,7 @@ class CheckoutController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Render the checkout wizard using the legacy marketing controller for now.
|
* Render the checkout wizard using the legacy marketing controller for now.
|
||||||
*/
|
*/
|
||||||
public function show(Request $request, Package $package): Response
|
public function show(Request $request, Package $package): JsonResponse
|
||||||
{
|
{
|
||||||
$marketingController = app(MarketingController::class);
|
$marketingController = app(MarketingController::class);
|
||||||
|
|
||||||
|
|||||||
28
app/Http/Controllers/LocaleController.php
Normal file
28
app/Http/Controllers/LocaleController.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
|
class LocaleController extends Controller
|
||||||
|
{
|
||||||
|
public function set(Request $request)
|
||||||
|
{
|
||||||
|
$locale = $request->input('locale');
|
||||||
|
$supportedLocales = ['de', 'en'];
|
||||||
|
|
||||||
|
if (in_array($locale, $supportedLocales)) {
|
||||||
|
App::setLocale($locale);
|
||||||
|
Session::put('locale', $locale);
|
||||||
|
}
|
||||||
|
|
||||||
|
$previousUrl = $request->header('Referer') ?? '/';
|
||||||
|
$currentPath = parse_url($previousUrl, PHP_URL_PATH);
|
||||||
|
// Remove prefix if present for redirect to prefix-free
|
||||||
|
$currentPath = preg_replace('/^\/(de|en)/', '', $currentPath);
|
||||||
|
|
||||||
|
return redirect($currentPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,6 +37,12 @@ class MarketingController extends Controller
|
|||||||
return $p->append(['features', 'limits']);
|
return $p->append(['features', 'limits']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Log::info('Inertia render called for index', [
|
||||||
|
'url' => request()->url(),
|
||||||
|
'inertia_header' => request()->header('X-Inertia'),
|
||||||
|
'packages_count' => $packages->count()
|
||||||
|
]);
|
||||||
|
|
||||||
return Inertia::render('marketing/Home', compact('packages'));
|
return Inertia::render('marketing/Home', compact('packages'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,13 +446,28 @@ class MarketingController extends Controller
|
|||||||
return Inertia::render('marketing/Packages', compact('endcustomerPackages', 'resellerPackages'));
|
return Inertia::render('marketing/Packages', compact('endcustomerPackages', 'resellerPackages'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function occasionsType($locale, $type)
|
public function occasionsType($type)
|
||||||
{
|
{
|
||||||
|
Log::info('OccasionsType hit', [
|
||||||
|
'type' => $type,
|
||||||
|
'locale' => app()->getLocale(),
|
||||||
|
'url' => request()->fullUrl(),
|
||||||
|
'route' => request()->route()->getName(),
|
||||||
|
'isInertia' => request()->header('X-Inertia')
|
||||||
|
]);
|
||||||
|
|
||||||
$validTypes = ['hochzeit', 'geburtstag', 'firmenevent'];
|
$validTypes = ['hochzeit', 'geburtstag', 'firmenevent'];
|
||||||
if (!in_array($type, $validTypes)) {
|
if (!in_array($type, $validTypes)) {
|
||||||
|
Log::warning('Invalid occasion type accessed', ['type' => $type]);
|
||||||
abort(404, 'Invalid occasion type');
|
abort(404, 'Invalid occasion type');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log::info('Inertia render called for occasionsType', [
|
||||||
|
'url' => request()->url(),
|
||||||
|
'inertia_header' => request()->header('X-Inertia'),
|
||||||
|
'type' => $type
|
||||||
|
]);
|
||||||
|
|
||||||
return Inertia::render('marketing/Occasions', ['type' => $type]);
|
return Inertia::render('marketing/Occasions', ['type' => $type]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,27 +17,19 @@ class SetLocale
|
|||||||
*/
|
*/
|
||||||
public function handle(Request $request, Closure $next): Response
|
public function handle(Request $request, Closure $next): Response
|
||||||
{
|
{
|
||||||
$locale = $request->segment(1); // Erste URL-Segment als Locale (z.B. /de/packages -> 'de')
|
|
||||||
|
|
||||||
// Unterstützte Sprachen
|
|
||||||
$supportedLocales = ['de', 'en'];
|
$supportedLocales = ['de', 'en'];
|
||||||
|
$sessionLocale = Session::get('locale', 'de');
|
||||||
|
|
||||||
if (in_array($locale, $supportedLocales)) {
|
// Fallback to Accept-Language header if no session
|
||||||
// Locale setzen
|
if (!in_array($sessionLocale, $supportedLocales)) {
|
||||||
App::setLocale($locale);
|
$acceptLanguage = $request->header('Accept-Language', 'de');
|
||||||
Session::put('locale', $locale);
|
$localeFromHeader = substr($acceptLanguage, 0, 2);
|
||||||
} else {
|
$sessionLocale = in_array($localeFromHeader, $supportedLocales) ? $localeFromHeader : 'de';
|
||||||
// Fallback zu 'de'
|
|
||||||
$defaultLocale = 'de';
|
|
||||||
App::setLocale($defaultLocale);
|
|
||||||
Session::put('locale', $defaultLocale);
|
|
||||||
|
|
||||||
// Redirect zu default Locale, wenn keine Locale in URL
|
|
||||||
if (!$locale) {
|
|
||||||
return redirect("/{$defaultLocale}" . $request->getRequestUri());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App::setLocale($sessionLocale);
|
||||||
|
Session::put('locale', $sessionLocale);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use Illuminate\Cache\RateLimiting\Limit;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\RateLimiter;
|
use Illuminate\Support\Facades\RateLimiter;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Inertia\Inertia;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@@ -41,6 +42,10 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
return Limit::perMinute(10)->by('oauth:' . ($request->ip() ?? 'unknown'));
|
return Limit::perMinute(10)->by('oauth:' . ($request->ip() ?? 'unknown'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
\Inertia\Inertia::share('locale', function () {
|
||||||
|
return app()->getLocale();
|
||||||
|
});
|
||||||
|
|
||||||
if ($this->app->runningInConsole()) {
|
if ($this->app->runningInConsole()) {
|
||||||
$this->app->register(\App\Providers\Filament\AdminPanelProvider::class);
|
$this->app->register(\App\Providers\Filament\AdminPanelProvider::class);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 84 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 84 KiB |
@@ -1,274 +0,0 @@
|
|||||||
# Page snapshot
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- banner:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- link:
|
|
||||||
- /url: /
|
|
||||||
- text: Die Fotospiel.App
|
|
||||||
- img
|
|
||||||
- navigation:
|
|
||||||
- link:
|
|
||||||
- /url: /#how-it-works
|
|
||||||
- text: So funktioniert es
|
|
||||||
- link:
|
|
||||||
- /url: /#features
|
|
||||||
- text: Features
|
|
||||||
- generic:
|
|
||||||
- button: Anlässe
|
|
||||||
- link:
|
|
||||||
- /url: /blog
|
|
||||||
- text: Blog
|
|
||||||
- link:
|
|
||||||
- /url: /packages
|
|
||||||
- text: Packages
|
|
||||||
- link:
|
|
||||||
- /url: /kontakt
|
|
||||||
- text: Kontakt
|
|
||||||
- link:
|
|
||||||
- /url: /packages
|
|
||||||
- text: Packages entdecken
|
|
||||||
- main:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=1]: Unsere Packages
|
|
||||||
- paragraph: Wählen Sie das passende Paket für Ihr Event – von kostenlos bis premium.
|
|
||||||
- link:
|
|
||||||
- /url: "#endcustomer"
|
|
||||||
- text: Jetzt entdecken
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=2]: Für Endkunden
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: Free / Test
|
|
||||||
- paragraph: 0.00 €
|
|
||||||
- list:
|
|
||||||
- listitem: • Events
|
|
||||||
- listitem: • Max. 30 Fotos
|
|
||||||
- listitem: • Galerie 7 Tage
|
|
||||||
- listitem: • Max. 50 Gäste
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: Starter
|
|
||||||
- paragraph: 29.00 €
|
|
||||||
- list:
|
|
||||||
- listitem: • Events
|
|
||||||
- listitem: • Max. 200 Fotos
|
|
||||||
- listitem: • Galerie 30 Tage
|
|
||||||
- listitem: • Max. 100 Gäste
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: Pro
|
|
||||||
- paragraph: 79.00 €
|
|
||||||
- list:
|
|
||||||
- listitem: • Events
|
|
||||||
- listitem: • Max. 1000 Fotos
|
|
||||||
- listitem: • Galerie 90 Tage
|
|
||||||
- listitem: • Max. 500 Gäste
|
|
||||||
- listitem:
|
|
||||||
- generic: Kein Watermark
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Endkunden-Pakete vergleichen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- table:
|
|
||||||
- rowgroup:
|
|
||||||
- row:
|
|
||||||
- cell: Feature
|
|
||||||
- cell: Free / Test
|
|
||||||
- cell: Starter
|
|
||||||
- cell: Pro
|
|
||||||
- rowgroup:
|
|
||||||
- row:
|
|
||||||
- cell: Preis
|
|
||||||
- cell: 0.00 €
|
|
||||||
- cell: 29.00 €
|
|
||||||
- cell: 79.00 €
|
|
||||||
- row:
|
|
||||||
- cell:
|
|
||||||
- text: Max. Fotos
|
|
||||||
- img
|
|
||||||
- cell: "30"
|
|
||||||
- cell: "200"
|
|
||||||
- cell: "1000"
|
|
||||||
- row:
|
|
||||||
- cell:
|
|
||||||
- text: Max. Gäste
|
|
||||||
- img
|
|
||||||
- cell: "50"
|
|
||||||
- cell: "100"
|
|
||||||
- cell: "500"
|
|
||||||
- row:
|
|
||||||
- cell:
|
|
||||||
- text: Galerie Tage
|
|
||||||
- img
|
|
||||||
- cell: "7"
|
|
||||||
- cell: "30"
|
|
||||||
- cell: "90"
|
|
||||||
- row:
|
|
||||||
- cell:
|
|
||||||
- text: Watermark
|
|
||||||
- img
|
|
||||||
- cell:
|
|
||||||
- img
|
|
||||||
- cell:
|
|
||||||
- img
|
|
||||||
- cell:
|
|
||||||
- img
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=2]: Für Reseller
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: S (Small Reseller)
|
|
||||||
- paragraph: 199.00 € / Jahr
|
|
||||||
- list:
|
|
||||||
- listitem:
|
|
||||||
- generic: Custom Branding
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: M (Medium Reseller)
|
|
||||||
- paragraph: 399.00 € / Jahr
|
|
||||||
- list:
|
|
||||||
- listitem:
|
|
||||||
- generic: Custom Branding
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=2]: Häufige Fragen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Was ist das Free-Paket?
|
|
||||||
- paragraph: "Ideal für Tests: 30 Fotos, 7 Tage Galerie, mit Watermark."
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Kann ich upgraden?
|
|
||||||
- paragraph: Ja, jederzeit im Dashboard – Limits werden sofort erweitert.
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Was für Reseller?
|
|
||||||
- paragraph: Jährliche Subscriptions mit Dashboard, Branding und Support.
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Zahlungssicher?
|
|
||||||
- paragraph: Sichere Zahlung via Stripe/PayPal, 14 Tage Rückgaberecht.
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=2]: Was unsere Kunden sagen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- paragraph: "\"Das Starter-Paket war perfekt für unsere Hochzeit – einfach und günstig!\""
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- paragraph: Anna M.
|
|
||||||
- generic:
|
|
||||||
- paragraph: "\"Pro-Paket mit Analytics hat uns geholfen, die besten Momente zu finden.\""
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- paragraph: Max B.
|
|
||||||
- generic:
|
|
||||||
- paragraph: "\"Als Reseller spare ich Zeit mit dem M-Paket – super Support!\""
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- paragraph: Lisa K.
|
|
||||||
- contentinfo:
|
|
||||||
- generic:
|
|
||||||
- paragraph: © 2025 Fotospiel GmbH. Alle Rechte vorbehalten.
|
|
||||||
- generic:
|
|
||||||
- link:
|
|
||||||
- /url: /impressum
|
|
||||||
- text: Impressum
|
|
||||||
- link:
|
|
||||||
- /url: /datenschutz
|
|
||||||
- text: Datenschutz
|
|
||||||
- link:
|
|
||||||
- /url: /kontakt
|
|
||||||
- text: Kontakt
|
|
||||||
- dialog "Starter - Details" [ref=e2]:
|
|
||||||
- heading "Starter - Details" [level=2] [ref=e4]
|
|
||||||
- generic [ref=e5]:
|
|
||||||
- tablist [ref=e6]:
|
|
||||||
- tab "Details" [active] [selected] [ref=e7]
|
|
||||||
- tab "Kaufen" [ref=e8]
|
|
||||||
- progressbar [ref=e9]
|
|
||||||
- tabpanel "Details" [ref=e11]:
|
|
||||||
- generic [ref=e12]:
|
|
||||||
- generic [ref=e13]:
|
|
||||||
- heading "Starter" [level=2] [ref=e14]
|
|
||||||
- paragraph [ref=e15]: 29.00 €
|
|
||||||
- paragraph
|
|
||||||
- generic [ref=e16]:
|
|
||||||
- generic [ref=e17]:
|
|
||||||
- img
|
|
||||||
- text: Max. 200 Fotos
|
|
||||||
- generic [ref=e18]:
|
|
||||||
- img
|
|
||||||
- text: Max. 100 Gäste
|
|
||||||
- generic [ref=e19]:
|
|
||||||
- img
|
|
||||||
- text: 30 Tage Galerie
|
|
||||||
- generic [ref=e20]:
|
|
||||||
- heading "Was Kunden sagen" [level=3] [ref=e21]
|
|
||||||
- generic [ref=e22]:
|
|
||||||
- generic [ref=e23]:
|
|
||||||
- paragraph [ref=e24]: "\"Das Starter-Paket war perfekt für unsere Hochzeit – einfach und günstig!\""
|
|
||||||
- paragraph [ref=e25]: Anna M.
|
|
||||||
- generic [ref=e26]:
|
|
||||||
- img [ref=e27]
|
|
||||||
- img [ref=e29]
|
|
||||||
- img [ref=e31]
|
|
||||||
- img [ref=e33]
|
|
||||||
- img [ref=e35]
|
|
||||||
- generic [ref=e37]:
|
|
||||||
- paragraph [ref=e38]: "\"Pro-Paket mit Analytics hat uns geholfen, die besten Momente zu finden.\""
|
|
||||||
- paragraph [ref=e39]: Max B.
|
|
||||||
- generic [ref=e40]:
|
|
||||||
- img [ref=e41]
|
|
||||||
- img [ref=e43]
|
|
||||||
- img [ref=e45]
|
|
||||||
- img [ref=e47]
|
|
||||||
- img [ref=e49]
|
|
||||||
- generic [ref=e51]:
|
|
||||||
- paragraph [ref=e52]: "\"Als Reseller spare ich Zeit mit dem M-Paket – super Support!\""
|
|
||||||
- paragraph [ref=e53]: Lisa K.
|
|
||||||
- generic [ref=e54]:
|
|
||||||
- img [ref=e55]
|
|
||||||
- img [ref=e57]
|
|
||||||
- img [ref=e59]
|
|
||||||
- img [ref=e61]
|
|
||||||
- img [ref=e63]
|
|
||||||
- button "Zum Kauf" [ref=e65]
|
|
||||||
- button "Close" [ref=e66]:
|
|
||||||
- img
|
|
||||||
- generic [ref=e67]: Close
|
|
||||||
```
|
|
||||||
@@ -1,274 +0,0 @@
|
|||||||
# Page snapshot
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- banner:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- link:
|
|
||||||
- /url: /
|
|
||||||
- text: Die Fotospiel.App
|
|
||||||
- img
|
|
||||||
- navigation:
|
|
||||||
- link:
|
|
||||||
- /url: /#how-it-works
|
|
||||||
- text: So funktioniert es
|
|
||||||
- link:
|
|
||||||
- /url: /#features
|
|
||||||
- text: Features
|
|
||||||
- generic:
|
|
||||||
- button: Anlässe
|
|
||||||
- link:
|
|
||||||
- /url: /blog
|
|
||||||
- text: Blog
|
|
||||||
- link:
|
|
||||||
- /url: /packages
|
|
||||||
- text: Packages
|
|
||||||
- link:
|
|
||||||
- /url: /kontakt
|
|
||||||
- text: Kontakt
|
|
||||||
- link:
|
|
||||||
- /url: /packages
|
|
||||||
- text: Packages entdecken
|
|
||||||
- main:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=1]: Unsere Packages
|
|
||||||
- paragraph: Wählen Sie das passende Paket für Ihr Event – von kostenlos bis premium.
|
|
||||||
- link:
|
|
||||||
- /url: "#endcustomer"
|
|
||||||
- text: Jetzt entdecken
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=2]: Für Endkunden
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: Free / Test
|
|
||||||
- paragraph: 0.00 €
|
|
||||||
- list:
|
|
||||||
- listitem: • Events
|
|
||||||
- listitem: • Max. 30 Fotos
|
|
||||||
- listitem: • Galerie 7 Tage
|
|
||||||
- listitem: • Max. 50 Gäste
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: Starter
|
|
||||||
- paragraph: 29.00 €
|
|
||||||
- list:
|
|
||||||
- listitem: • Events
|
|
||||||
- listitem: • Max. 200 Fotos
|
|
||||||
- listitem: • Galerie 30 Tage
|
|
||||||
- listitem: • Max. 100 Gäste
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: Pro
|
|
||||||
- paragraph: 79.00 €
|
|
||||||
- list:
|
|
||||||
- listitem: • Events
|
|
||||||
- listitem: • Max. 1000 Fotos
|
|
||||||
- listitem: • Galerie 90 Tage
|
|
||||||
- listitem: • Max. 500 Gäste
|
|
||||||
- listitem:
|
|
||||||
- generic: Kein Watermark
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Endkunden-Pakete vergleichen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- table:
|
|
||||||
- rowgroup:
|
|
||||||
- row:
|
|
||||||
- cell: Feature
|
|
||||||
- cell: Free / Test
|
|
||||||
- cell: Starter
|
|
||||||
- cell: Pro
|
|
||||||
- rowgroup:
|
|
||||||
- row:
|
|
||||||
- cell: Preis
|
|
||||||
- cell: 0.00 €
|
|
||||||
- cell: 29.00 €
|
|
||||||
- cell: 79.00 €
|
|
||||||
- row:
|
|
||||||
- cell:
|
|
||||||
- text: Max. Fotos
|
|
||||||
- img
|
|
||||||
- cell: "30"
|
|
||||||
- cell: "200"
|
|
||||||
- cell: "1000"
|
|
||||||
- row:
|
|
||||||
- cell:
|
|
||||||
- text: Max. Gäste
|
|
||||||
- img
|
|
||||||
- cell: "50"
|
|
||||||
- cell: "100"
|
|
||||||
- cell: "500"
|
|
||||||
- row:
|
|
||||||
- cell:
|
|
||||||
- text: Galerie Tage
|
|
||||||
- img
|
|
||||||
- cell: "7"
|
|
||||||
- cell: "30"
|
|
||||||
- cell: "90"
|
|
||||||
- row:
|
|
||||||
- cell:
|
|
||||||
- text: Watermark
|
|
||||||
- img
|
|
||||||
- cell:
|
|
||||||
- img
|
|
||||||
- cell:
|
|
||||||
- img
|
|
||||||
- cell:
|
|
||||||
- img
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=2]: Für Reseller
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: S (Small Reseller)
|
|
||||||
- paragraph: 199.00 € / Jahr
|
|
||||||
- list:
|
|
||||||
- listitem:
|
|
||||||
- generic: Custom Branding
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- heading [level=3]: M (Medium Reseller)
|
|
||||||
- paragraph: 399.00 € / Jahr
|
|
||||||
- list:
|
|
||||||
- listitem:
|
|
||||||
- generic: Custom Branding
|
|
||||||
- button: Details anzeigen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=2]: Häufige Fragen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Was ist das Free-Paket?
|
|
||||||
- paragraph: "Ideal für Tests: 30 Fotos, 7 Tage Galerie, mit Watermark."
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Kann ich upgraden?
|
|
||||||
- paragraph: Ja, jederzeit im Dashboard – Limits werden sofort erweitert.
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Was für Reseller?
|
|
||||||
- paragraph: Jährliche Subscriptions mit Dashboard, Branding und Support.
|
|
||||||
- generic:
|
|
||||||
- heading [level=3]: Zahlungssicher?
|
|
||||||
- paragraph: Sichere Zahlung via Stripe/PayPal, 14 Tage Rückgaberecht.
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- heading [level=2]: Was unsere Kunden sagen
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- paragraph: "\"Das Starter-Paket war perfekt für unsere Hochzeit – einfach und günstig!\""
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- paragraph: Anna M.
|
|
||||||
- generic:
|
|
||||||
- paragraph: "\"Pro-Paket mit Analytics hat uns geholfen, die besten Momente zu finden.\""
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- paragraph: Max B.
|
|
||||||
- generic:
|
|
||||||
- paragraph: "\"Als Reseller spare ich Zeit mit dem M-Paket – super Support!\""
|
|
||||||
- generic:
|
|
||||||
- generic:
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- img
|
|
||||||
- paragraph: Lisa K.
|
|
||||||
- contentinfo:
|
|
||||||
- generic:
|
|
||||||
- paragraph: © 2025 Fotospiel GmbH. Alle Rechte vorbehalten.
|
|
||||||
- generic:
|
|
||||||
- link:
|
|
||||||
- /url: /impressum
|
|
||||||
- text: Impressum
|
|
||||||
- link:
|
|
||||||
- /url: /datenschutz
|
|
||||||
- text: Datenschutz
|
|
||||||
- link:
|
|
||||||
- /url: /kontakt
|
|
||||||
- text: Kontakt
|
|
||||||
- dialog "Free / Test - Details" [ref=e2]:
|
|
||||||
- heading "Free / Test - Details" [level=2] [ref=e4]
|
|
||||||
- generic [ref=e5]:
|
|
||||||
- tablist [ref=e6]:
|
|
||||||
- tab "Details" [active] [selected] [ref=e7]
|
|
||||||
- tab "Kaufen" [ref=e8]
|
|
||||||
- progressbar [ref=e9]
|
|
||||||
- tabpanel "Details" [ref=e11]:
|
|
||||||
- generic [ref=e12]:
|
|
||||||
- generic [ref=e13]:
|
|
||||||
- heading "Free / Test" [level=2] [ref=e14]
|
|
||||||
- paragraph [ref=e15]: 0.00 €
|
|
||||||
- paragraph
|
|
||||||
- generic [ref=e16]:
|
|
||||||
- generic [ref=e17]:
|
|
||||||
- img
|
|
||||||
- text: Max. 30 Fotos
|
|
||||||
- generic [ref=e18]:
|
|
||||||
- img
|
|
||||||
- text: Max. 50 Gäste
|
|
||||||
- generic [ref=e19]:
|
|
||||||
- img
|
|
||||||
- text: 7 Tage Galerie
|
|
||||||
- generic [ref=e20]:
|
|
||||||
- heading "Was Kunden sagen" [level=3] [ref=e21]
|
|
||||||
- generic [ref=e22]:
|
|
||||||
- generic [ref=e23]:
|
|
||||||
- paragraph [ref=e24]: "\"Das Starter-Paket war perfekt für unsere Hochzeit – einfach und günstig!\""
|
|
||||||
- paragraph [ref=e25]: Anna M.
|
|
||||||
- generic [ref=e26]:
|
|
||||||
- img [ref=e27]
|
|
||||||
- img [ref=e29]
|
|
||||||
- img [ref=e31]
|
|
||||||
- img [ref=e33]
|
|
||||||
- img [ref=e35]
|
|
||||||
- generic [ref=e37]:
|
|
||||||
- paragraph [ref=e38]: "\"Pro-Paket mit Analytics hat uns geholfen, die besten Momente zu finden.\""
|
|
||||||
- paragraph [ref=e39]: Max B.
|
|
||||||
- generic [ref=e40]:
|
|
||||||
- img [ref=e41]
|
|
||||||
- img [ref=e43]
|
|
||||||
- img [ref=e45]
|
|
||||||
- img [ref=e47]
|
|
||||||
- img [ref=e49]
|
|
||||||
- generic [ref=e51]:
|
|
||||||
- paragraph [ref=e52]: "\"Als Reseller spare ich Zeit mit dem M-Paket – super Support!\""
|
|
||||||
- paragraph [ref=e53]: Lisa K.
|
|
||||||
- generic [ref=e54]:
|
|
||||||
- img [ref=e55]
|
|
||||||
- img [ref=e57]
|
|
||||||
- img [ref=e59]
|
|
||||||
- img [ref=e61]
|
|
||||||
- img [ref=e63]
|
|
||||||
- button "Zum Kauf" [ref=e65]
|
|
||||||
- button "Close" [ref=e66]:
|
|
||||||
- img
|
|
||||||
- generic [ref=e67]: Close
|
|
||||||
```
|
|
||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -6,5 +6,18 @@
|
|||||||
"already_logged_in": "Sie sind bereits eingeloggt.",
|
"already_logged_in": "Sie sind bereits eingeloggt.",
|
||||||
"failed_credentials": "Falsche Anmeldedaten.",
|
"failed_credentials": "Falsche Anmeldedaten.",
|
||||||
"header.login": "Anmelden",
|
"header.login": "Anmelden",
|
||||||
"header.register": "Registrieren"
|
"header.register": "Registrieren",
|
||||||
|
"header": {
|
||||||
|
"home": "Home",
|
||||||
|
"packages": "Pakete",
|
||||||
|
"blog": "Blog",
|
||||||
|
"contact": "Kontakt",
|
||||||
|
"login": "Anmelden",
|
||||||
|
"register": "Registrieren",
|
||||||
|
"occasions": {
|
||||||
|
"wedding": "Hochzeit",
|
||||||
|
"birthday": "Geburtstag",
|
||||||
|
"corporate": "Firmenevent"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,11 @@ createInertiaApp({
|
|||||||
setup({ el, App, props }) {
|
setup({ el, App, props }) {
|
||||||
const root = createRoot(el);
|
const root = createRoot(el);
|
||||||
|
|
||||||
|
// Sync i18n with initial locale from props
|
||||||
|
if (props.initialPage && props.initialPage.props && props.initialPage.props.locale) {
|
||||||
|
i18n.changeLanguage(props.initialPage.props.locale);
|
||||||
|
}
|
||||||
|
|
||||||
root.render(
|
root.render(
|
||||||
<I18nextProvider i18n={i18n}>
|
<I18nextProvider i18n={i18n}>
|
||||||
<App {...props} />
|
<App {...props} />
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
import React from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { usePage } from '@inertiajs/react';
|
import { usePage } from '@inertiajs/react';
|
||||||
import { Link, router } from '@inertiajs/react';
|
import { Link, router } from '@inertiajs/react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import i18n from '@/i18n';
|
||||||
import { useAppearance } from '@/hooks/use-appearance';
|
import { useAppearance } from '@/hooks/use-appearance';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
||||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
|
||||||
|
import { NavigationMenu, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, navigationMenuTriggerStyle } from '@/components/ui/navigation-menu';
|
||||||
import { Sun, Moon } from 'lucide-react';
|
import { Sun, Moon } from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
import { marketing as marketingRoute, packages as packagesRoute, blog as blogRoute, kontakt as kontaktRoute, login as loginRoute, register as registerRoute, anlaesseType } from '@/routes';
|
||||||
|
|
||||||
const Header: React.FC = () => {
|
const Header: React.FC = () => {
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('Header mounted - Inertia initialized?', typeof window.Inertia !== 'undefined' ? 'Yes' : 'No');
|
||||||
|
console.log('Inertia links on page:', document.querySelectorAll('a[data-inertia]').length);
|
||||||
|
}, []);
|
||||||
const { auth, locale } = usePage().props as any;
|
const { auth, locale } = usePage().props as any;
|
||||||
const { t } = useTranslation('auth');
|
const { t } = useTranslation('auth');
|
||||||
const { appearance, updateAppearance } = useAppearance();
|
const { appearance, updateAppearance } = useAppearance();
|
||||||
@@ -21,74 +28,114 @@ const Header: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleLanguageChange = (value: string) => {
|
const handleLanguageChange = (value: string) => {
|
||||||
router.visit(`/${value}`, { preserveState: true, replace: true });
|
router.post(
|
||||||
|
'/set-locale',
|
||||||
|
{ locale: value },
|
||||||
|
{
|
||||||
|
preserveState: true,
|
||||||
|
replace: true,
|
||||||
|
onSuccess: () => {
|
||||||
|
i18n.changeLanguage(value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
router.post(`/${locale}/logout`);
|
router.post('/logout');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const occasionUrl = (typeKey: 'hochzeit' | 'geburtstag' | 'firmenevent') =>
|
||||||
|
`/anlaesse/${typeKey}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="fixed top-0 z-50 w-full bg-white dark:bg-gray-900 shadow-lg border-b-2 border-gray-200 dark:border-gray-700">
|
<header className="fixed top-0 z-50 w-full bg-white/95 dark:bg-gray-900/95 backdrop-blur-md shadow-lg border-b border-gray-200/50 dark:border-gray-700/50">
|
||||||
<div className="container mx-auto px-4 py-4">
|
<div className="container mx-auto px-4 py-3">
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<Link href={`/${locale}`} className="text-2xl font-bold text-gray-800 dark:text-gray-200">
|
<Link
|
||||||
|
href={marketingRoute().url}
|
||||||
|
className="text-2xl font-bold text-gray-800 dark:text-gray-200 hover:text-pink-500 dark:hover:text-pink-400 transition-colors duration-200"
|
||||||
|
>
|
||||||
Fotospiel
|
Fotospiel
|
||||||
</Link>
|
</Link>
|
||||||
<nav className="flex space-x-8">
|
<NavigationMenu className="hidden md:flex">
|
||||||
<Link href={`/${locale}`} className="text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg">
|
<NavigationMenuList className="space-x-1">
|
||||||
Home
|
<NavigationMenuItem>
|
||||||
</Link>
|
<NavigationMenuLink href={marketingRoute().url} className={cn(
|
||||||
<Link href={`/${locale}/packages`} className="text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg">
|
navigationMenuTriggerStyle(),
|
||||||
Pakete
|
"text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg bg-transparent hover:bg-pink-50 dark:hover:bg-pink-900/20 rounded-md px-3 py-2 transition-all duration-200"
|
||||||
</Link>
|
)}>
|
||||||
<Link href={`/${locale}/blog`} className="text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg">
|
{t('header.home', 'Home')}
|
||||||
Blog
|
</NavigationMenuLink>
|
||||||
</Link>
|
</NavigationMenuItem>
|
||||||
<DropdownMenu>
|
<NavigationMenuItem>
|
||||||
<DropdownMenuTrigger asChild>
|
<NavigationMenuLink href={packagesRoute().url} className={cn(
|
||||||
<Button variant="ghost" className="text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg">
|
navigationMenuTriggerStyle(),
|
||||||
Anlässe
|
"text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg bg-transparent hover:bg-pink-50 dark:hover:bg-pink-900/20 rounded-md px-3 py-2 transition-all duration-200"
|
||||||
</Button>
|
)}>
|
||||||
</DropdownMenuTrigger>
|
{t('header.packages', 'Pakete')}
|
||||||
<DropdownMenuContent>
|
</NavigationMenuLink>
|
||||||
<DropdownMenuItem asChild>
|
</NavigationMenuItem>
|
||||||
<Link href={`/${locale}/anlaesse/hochzeit`}>
|
<NavigationMenuItem>
|
||||||
Hochzeit
|
<NavigationMenuLink href={blogRoute().url} className={cn(
|
||||||
</Link>
|
navigationMenuTriggerStyle(),
|
||||||
</DropdownMenuItem>
|
"text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg bg-transparent hover:bg-pink-50 dark:hover:bg-pink-900/20 rounded-md px-3 py-2 transition-all duration-200"
|
||||||
<DropdownMenuItem asChild>
|
)}>
|
||||||
<Link href={`/${locale}/anlaesse/geburtstag`}>
|
{t('header.blog', 'Blog')}
|
||||||
Geburtstag
|
</NavigationMenuLink>
|
||||||
</Link>
|
</NavigationMenuItem>
|
||||||
</DropdownMenuItem>
|
<NavigationMenuItem>
|
||||||
<DropdownMenuItem asChild>
|
<DropdownMenu>
|
||||||
<Link href={`/${locale}/anlaesse/firmenevent`}>
|
<DropdownMenuTrigger asChild>
|
||||||
Firmenevent
|
<Button variant="ghost" className="text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg bg-transparent hover:bg-pink-50 dark:hover:bg-pink-900/20 rounded-md px-3 py-2 transition-all duration-200">
|
||||||
</Link>
|
Anlässe
|
||||||
</DropdownMenuItem>
|
</Button>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuTrigger>
|
||||||
</DropdownMenu>
|
<DropdownMenuContent className="w-56 bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 shadow-lg rounded-xl">
|
||||||
<Link href={`/${locale}/kontakt`} className="text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg">
|
<DropdownMenuItem asChild>
|
||||||
Kontakt
|
<Link href={occasionUrl('hochzeit')} className="w-full hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-colors duration-200">
|
||||||
</Link>
|
{t('header.occasions.wedding', 'Hochzeit')}
|
||||||
</nav>
|
</Link>
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem asChild>
|
||||||
|
<Link href={occasionUrl('geburtstag')} className="w-full hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-colors duration-200">
|
||||||
|
{t('header.occasions.birthday', 'Geburtstag')}
|
||||||
|
</Link>
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem asChild>
|
||||||
|
<Link href={occasionUrl('firmenevent')} className="w-full hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-colors duration-200">
|
||||||
|
{t('header.occasions.corporate', 'Firmenevent')}
|
||||||
|
</Link>
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
</NavigationMenuItem>
|
||||||
|
<NavigationMenuItem>
|
||||||
|
<NavigationMenuLink href={kontaktRoute().url} className={cn(
|
||||||
|
navigationMenuTriggerStyle(),
|
||||||
|
"text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white font-sans-marketing text-lg bg-transparent hover:bg-pink-50 dark:hover:bg-pink-900/20 rounded-md px-3 py-2 transition-all duration-200"
|
||||||
|
)}>
|
||||||
|
{t('header.contact', 'Kontakt')}
|
||||||
|
</NavigationMenuLink>
|
||||||
|
</NavigationMenuItem>
|
||||||
|
</NavigationMenuList>
|
||||||
|
</NavigationMenu>
|
||||||
<div className="flex items-center space-x-4">
|
<div className="flex items-center space-x-4">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={toggleTheme}
|
onClick={toggleTheme}
|
||||||
className="h-8 w-8"
|
className="h-8 w-8 hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-colors duration-200"
|
||||||
>
|
>
|
||||||
<Sun className={cn("h-4 w-4", appearance === "dark" && "hidden")} />
|
<Sun className={cn("h-4 w-4", appearance === "dark" && "hidden")} />
|
||||||
<Moon className={cn("h-4 w-4", appearance !== "dark" && "hidden")} />
|
<Moon className={cn("h-4 w-4", appearance !== "dark" && "hidden")} />
|
||||||
<span className="sr-only">Theme Toggle</span>
|
<span className="sr-only">Theme Toggle</span>
|
||||||
</Button>
|
</Button>
|
||||||
<Select value={locale} onValueChange={handleLanguageChange}>
|
<Select value={locale} onValueChange={handleLanguageChange}>
|
||||||
<SelectTrigger className="w-[70px] h-8">
|
<SelectTrigger className="w-[70px] h-8 border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 hover:bg-pink-50 dark:hover:bg-pink-900/20">
|
||||||
<SelectValue placeholder="DE" />
|
<SelectValue placeholder="DE" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent className="bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700">
|
||||||
<SelectItem value="de">DE</SelectItem>
|
<SelectItem value="de">DE</SelectItem>
|
||||||
<SelectItem value="en">EN</SelectItem>
|
<SelectItem value="en">EN</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
@@ -96,33 +143,33 @@ const Header: React.FC = () => {
|
|||||||
{auth.user ? (
|
{auth.user ? (
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<Button variant="ghost" className="relative h-8 w-8 rounded-full">
|
<Button variant="ghost" className="relative h-8 w-8 rounded-full hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-colors duration-200">
|
||||||
<Avatar className="h-8 w-8">
|
<Avatar className="h-8 w-8">
|
||||||
<AvatarImage src={auth.user?.avatar} alt={auth.user?.name || 'User'} />
|
<AvatarImage src={auth.user?.avatar} alt={auth.user?.name || 'User'} />
|
||||||
<AvatarFallback>{(auth.user?.name || auth.user?.email || 'U').charAt(0)}</AvatarFallback>
|
<AvatarFallback className="bg-pink-100 dark:bg-pink-900 text-pink-600 dark:text-pink-400">{(auth.user?.name || auth.user?.email || 'U').charAt(0)}</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent className="w-56" align="end" forceMount>
|
<DropdownMenuContent className="w-56 bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 shadow-lg rounded-xl" align="end" forceMount>
|
||||||
<DropdownMenuLabel className="font-normal">
|
<DropdownMenuLabel className="font-normal">
|
||||||
<div className="flex flex-col space-y-1">
|
<div className="flex flex-col space-y-1">
|
||||||
<p className="text-sm font-medium leading-none">{auth.user?.name || auth.user?.email || 'User'}</p>
|
<p className="text-sm font-medium leading-none text-gray-900 dark:text-gray-100">{auth.user?.name || auth.user?.email || 'User'}</p>
|
||||||
<p className="text-xs leading-none text-muted-foreground">{auth.user?.email || ''}</p>
|
<p className="text-xs leading-none text-gray-500 dark:text-gray-400">{auth.user?.email || ''}</p>
|
||||||
</div>
|
</div>
|
||||||
</DropdownMenuLabel>
|
</DropdownMenuLabel>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator className="bg-gray-200 dark:bg-gray-700" />
|
||||||
<DropdownMenuItem asChild>
|
<DropdownMenuItem asChild>
|
||||||
<Link href="/profile">
|
<Link href="/profile" className="hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-colors duration-200">
|
||||||
Profil
|
Profil
|
||||||
</Link>
|
</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem asChild>
|
<DropdownMenuItem asChild>
|
||||||
<Link href="/profile/orders">
|
<Link href="/profile/orders" className="hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-colors duration-200">
|
||||||
Bestellungen
|
Bestellungen
|
||||||
</Link>
|
</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator className="bg-gray-200 dark:bg-gray-700" />
|
||||||
<DropdownMenuItem onClick={handleLogout}>
|
<DropdownMenuItem onClick={handleLogout} className="hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-colors duration-200">
|
||||||
Abmelden
|
Abmelden
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
@@ -130,14 +177,14 @@ const Header: React.FC = () => {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Link
|
<Link
|
||||||
href={`/${locale}/login`}
|
href={loginRoute().url}
|
||||||
className="text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white"
|
className="text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white hover:bg-pink-50 dark:hover:bg-pink-900/20 px-3 py-2 rounded-md transition-all duration-200"
|
||||||
>
|
>
|
||||||
{t('header.login')}
|
{t('header.login')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href={`/${locale}/register`}
|
href={registerRoute().url}
|
||||||
className="bg-pink-500 text-white px-4 py-2 rounded hover:bg-pink-600 dark:bg-pink-600 dark:hover:bg-pink-700"
|
className="bg-pink-500 hover:bg-pink-600 dark:bg-pink-600 dark:hover:bg-pink-700 text-white px-4 py-2 rounded-md transition-all duration-200 shadow-md hover:shadow-lg"
|
||||||
>
|
>
|
||||||
{t('header.register')}
|
{t('header.register')}
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
6
resources/js/hooks/useLocale.ts
Normal file
6
resources/js/hooks/useLocale.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { usePage } from '@inertiajs/react';
|
||||||
|
|
||||||
|
export const useLocale = () => {
|
||||||
|
const { locale } = usePage().props as any;
|
||||||
|
return locale;
|
||||||
|
};
|
||||||
@@ -1,64 +1,12 @@
|
|||||||
import { useMemo } from 'react';
|
import { useLocale } from './useLocale';
|
||||||
import { usePage } from '@inertiajs/react';
|
|
||||||
|
|
||||||
declare const route: ((name: string, params?: Record<string, unknown>, absolute?: boolean) => string) | undefined;
|
|
||||||
|
|
||||||
type PageProps = {
|
|
||||||
locale?: string;
|
|
||||||
url?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useLocalizedRoutes = () => {
|
export const useLocalizedRoutes = () => {
|
||||||
const page = usePage<PageProps>();
|
const locale = useLocale();
|
||||||
const currentUrl = page.url ?? (typeof window !== 'undefined' ? window.location.pathname : '/') ?? '/';
|
|
||||||
|
|
||||||
return useMemo(() => {
|
const localizedPath = (path: string) => {
|
||||||
let locale = page.props.locale;
|
// Since prefix-free, return plain path. Locale is handled via session.
|
||||||
|
return path.startsWith('/') ? path : `/${path}`;
|
||||||
|
};
|
||||||
|
|
||||||
if (!locale) {
|
return { localizedPath };
|
||||||
if (currentUrl.startsWith('/en')) {
|
|
||||||
locale = 'en';
|
|
||||||
} else if (currentUrl.startsWith('/de')) {
|
|
||||||
locale = 'de';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!locale) {
|
|
||||||
locale = 'de';
|
|
||||||
}
|
|
||||||
|
|
||||||
const localePrefix = locale ? `/${locale}` : '';
|
|
||||||
|
|
||||||
const localizedPath = (path = '/') => {
|
|
||||||
if (!path || path === '/') {
|
|
||||||
return localePrefix || '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
const normalized = path.startsWith('/') ? path : `/${path}`;
|
|
||||||
const result = `${localePrefix}${normalized}`;
|
|
||||||
|
|
||||||
return result.replace(/\/+$/, '').replace(/\/+/g, '/');
|
|
||||||
};
|
|
||||||
|
|
||||||
const localizedRoute = (name: string, params: Record<string, unknown> = {}, absolute = false) => {
|
|
||||||
if (typeof route === 'function') {
|
|
||||||
const payload = locale ? { locale, ...params } : params;
|
|
||||||
|
|
||||||
try {
|
|
||||||
return route(name, payload, absolute);
|
|
||||||
} catch (error) {
|
|
||||||
console.warn('Failed to resolve route', name, error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return localizedPath(name.startsWith('/') ? name : `/${name}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
locale,
|
|
||||||
localePrefix,
|
|
||||||
localizedPath,
|
|
||||||
localizedRoute,
|
|
||||||
};
|
|
||||||
}, [page.props.locale, currentUrl]);
|
|
||||||
};
|
};
|
||||||
@@ -20,9 +20,8 @@ i18n
|
|||||||
loadPath: '/lang/{{lng}}/{{ns}}.json',
|
loadPath: '/lang/{{lng}}/{{ns}}.json',
|
||||||
},
|
},
|
||||||
detection: {
|
detection: {
|
||||||
order: ['path', 'localStorage', 'htmlTag'],
|
order: ['sessionStorage', 'localStorage', 'htmlTag'],
|
||||||
lookupFromPathIndex: 0,
|
caches: ['sessionStorage'],
|
||||||
caches: ['localStorage'],
|
|
||||||
},
|
},
|
||||||
react: {
|
react: {
|
||||||
useSuspense: false,
|
useSuspense: false,
|
||||||
|
|||||||
@@ -13,15 +13,14 @@ const MarketingLayout: React.FC<MarketingLayoutProps> = ({ children, title }) =>
|
|||||||
const { url } = page;
|
const { url } = page;
|
||||||
const { t } = useTranslation('marketing');
|
const { t } = useTranslation('marketing');
|
||||||
const i18n = useTranslation();
|
const i18n = useTranslation();
|
||||||
const { locale, localizedPath } = useLocalizedRoutes();
|
const { locale } = usePage().props as any;
|
||||||
|
const { localizedPath } = useLocalizedRoutes();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const localeCandidate = locale || (url.startsWith('/en/') ? 'en' : 'de');
|
if (locale && i18n.i18n.language !== locale) {
|
||||||
|
i18n.i18n.changeLanguage(locale);
|
||||||
if (localeCandidate && i18n.i18n.language !== localeCandidate) {
|
|
||||||
i18n.i18n.changeLanguage(localeCandidate);
|
|
||||||
}
|
}
|
||||||
}, [url, i18n, locale]);
|
}, [locale, i18n]);
|
||||||
|
|
||||||
const marketing = page.props.translations?.marketing ?? {};
|
const marketing = page.props.translations?.marketing ?? {};
|
||||||
|
|
||||||
@@ -30,15 +29,19 @@ const MarketingLayout: React.FC<MarketingLayoutProps> = ({ children, title }) =>
|
|||||||
return typeof value === 'string' ? value : fallback;
|
return typeof value === 'string' ? value : fallback;
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeLocale = locale || (url.startsWith('/en/') ? 'en' : 'de');
|
const activeLocale = locale || 'de';
|
||||||
const alternateLocale = activeLocale === 'de' ? 'en' : 'de';
|
const alternateLocale = activeLocale === 'de' ? 'en' : 'de';
|
||||||
const path = url.replace(/^\/(de|en)/, '');
|
const path = url.replace(/^\/(de|en)/, '');
|
||||||
const canonicalUrl = `https://fotospiel.app${localizedPath(path || '/')}`;
|
const canonicalUrl = `https://fotospiel.app${path || '/'}`;
|
||||||
|
|
||||||
const handleLocaleChange = (nextLocale: string) => {
|
const handleLocaleChange = (nextLocale: string) => {
|
||||||
const normalizedPath = url.replace(/^\/(de|en)/, '') || '/';
|
router.post('/set-locale', { locale: nextLocale }, {
|
||||||
const destination = normalizedPath === '/' ? `/${nextLocale}` : `/${nextLocale}${normalizedPath}`;
|
preserveState: true,
|
||||||
router.visit(destination);
|
replace: true,
|
||||||
|
onSuccess: () => {
|
||||||
|
i18n.i18n.changeLanguage(nextLocale);
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -56,28 +59,28 @@ const MarketingLayout: React.FC<MarketingLayoutProps> = ({ children, title }) =>
|
|||||||
/>
|
/>
|
||||||
<meta property="og:url" content={canonicalUrl} />
|
<meta property="og:url" content={canonicalUrl} />
|
||||||
<link rel="canonical" href={canonicalUrl} />
|
<link rel="canonical" href={canonicalUrl} />
|
||||||
<link rel="alternate" hrefLang="de" href={`https://fotospiel.app/de${path}`} />
|
<link rel="alternate" hreflang="de" href={`https://fotospiel.app/de${path}`} />
|
||||||
<link rel="alternate" hrefLang="en" href={`https://fotospiel.app/en${path}`} />
|
<link rel="alternate" hreflang="en" href={`https://fotospiel.app/en${path}`} />
|
||||||
<link rel="alternate" hrefLang="x-default" href="https://fotospiel.app/de" />
|
<link rel="alternate" hreflang="x-default" href="https://fotospiel.app/" />
|
||||||
</Head>
|
</Head>
|
||||||
<div className="min-h-screen bg-white">
|
<div className="min-h-screen bg-white">
|
||||||
<header className="bg-white shadow-sm">
|
<header className="bg-white shadow-sm">
|
||||||
<div className="container mx-auto px-4 py-4">
|
<div className="container mx-auto px-4 py-4">
|
||||||
<nav className="flex justify-between items-center">
|
<nav className="flex justify-between items-center">
|
||||||
<Link href={localizedPath('/')} className="text-xl font-bold text-gray-900">
|
<Link href="/" className="text-xl font-bold text-gray-900">
|
||||||
Fotospiel
|
Fotospiel
|
||||||
</Link>
|
</Link>
|
||||||
<div className="hidden md:flex space-x-8">
|
<div className="hidden md:flex space-x-8">
|
||||||
<Link href={localizedPath('/')} className="text-gray-700 hover:text-gray-900">
|
<Link href="/" className="text-gray-700 hover:text-gray-900">
|
||||||
{t('nav.home')}
|
{t('nav.home')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link href={localizedPath('/packages')} className="text-gray-700 hover:text-gray-900">
|
<Link href="/packages" className="text-gray-700 hover:text-gray-900">
|
||||||
{t('nav.packages')}
|
{t('nav.packages')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link href={localizedPath('/blog')} className="text-gray-700 hover:text-gray-900">
|
<Link href="/blog" className="text-gray-700 hover:text-gray-900">
|
||||||
{t('nav.blog')}
|
{t('nav.blog')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link href={localizedPath('/kontakt')} className="text-gray-700 hover:text-gray-900">
|
<Link href="/kontakt" className="text-gray-700 hover:text-gray-900">
|
||||||
{t('nav.contact')}
|
{t('nav.contact')}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
@@ -101,13 +104,13 @@ const MarketingLayout: React.FC<MarketingLayoutProps> = ({ children, title }) =>
|
|||||||
<div className="container mx-auto px-4 text-center">
|
<div className="container mx-auto px-4 text-center">
|
||||||
<p>© 2025 Fotospiel. Alle Rechte vorbehalten.</p>
|
<p>© 2025 Fotospiel. Alle Rechte vorbehalten.</p>
|
||||||
<div className="mt-4 space-x-4">
|
<div className="mt-4 space-x-4">
|
||||||
<Link href={localizedPath('/datenschutz')} className="hover:underline">
|
<Link href="/datenschutz" className="hover:underline">
|
||||||
{t('nav.privacy')}
|
{t('nav.privacy')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link href={localizedPath('/impressum')} className="hover:underline">
|
<Link href="/impressum" className="hover:underline">
|
||||||
{t('nav.impressum')}
|
{t('nav.impressum')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link href={localizedPath('/kontakt')} className="hover:underline">
|
<Link href="/kontakt" className="hover:underline">
|
||||||
{t('nav.contact')}
|
{t('nav.contact')}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Head, Link, useForm, usePage } from '@inertiajs/react';
|
import { Head, Link, useForm, usePage } from '@inertiajs/react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useLocalizedRoutes } from '@/hooks/useLocalizedRoutes';
|
||||||
import MarketingLayout from '@/layouts/marketing/MarketingLayout';
|
import MarketingLayout from '@/layouts/marketing/MarketingLayout';
|
||||||
|
|
||||||
const Kontakt: React.FC = () => {
|
const Kontakt: React.FC = () => {
|
||||||
@@ -12,6 +13,7 @@ const Kontakt: React.FC = () => {
|
|||||||
|
|
||||||
const { flash } = usePage().props as any;
|
const { flash } = usePage().props as any;
|
||||||
const { t } = useTranslation('marketing');
|
const { t } = useTranslation('marketing');
|
||||||
|
const { localizedPath } = useLocalizedRoutes();
|
||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { usePage } from "@inertiajs/react";
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||||
import { useCheckoutWizard } from "../WizardContext";
|
import { useCheckoutWizard } from "../WizardContext";
|
||||||
import LoginForm, { AuthUserPayload } from "../../auth/LoginForm";
|
import LoginForm, { AuthUserPayload } from "../../../auth/LoginForm";
|
||||||
import RegisterForm, { RegisterSuccessPayload } from "../../auth/RegisterForm";
|
import RegisterForm, { RegisterSuccessPayload } from "../../../auth/RegisterForm";
|
||||||
|
|
||||||
interface AuthStepProps {
|
interface AuthStepProps {
|
||||||
privacyHtml: string;
|
privacyHtml: string;
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ export const ConfirmationStep: React.FC<ConfirmationStepProps> = ({ onViewProfil
|
|||||||
<Alert>
|
<Alert>
|
||||||
<AlertTitle>Willkommen bei FotoSpiel</AlertTitle>
|
<AlertTitle>Willkommen bei FotoSpiel</AlertTitle>
|
||||||
<AlertDescription>
|
<AlertDescription>
|
||||||
{Ihr Paket "" ist aktiviert. Wir haben Ihnen eine Bestaetigung per E-Mail gesendet.}
|
Ihr Paket wurde aktiviert. Wir haben Ihnen eine Bestätigung per E-Mail gesendet.
|
||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
</Alert>
|
</Alert>
|
||||||
<div className="flex flex-wrap gap-3 justify-end">
|
<div className="flex flex-wrap gap-3 justify-end">
|
||||||
<Button variant="outline" onClick={onViewProfile}>
|
<Button variant="outline" onClick={onViewProfile}>
|
||||||
Profil oeffnen
|
Profil öffnen
|
||||||
</Button>
|
</Button>
|
||||||
<Button>Zum Admin-Bereich</Button>
|
<Button>Zum Admin-Bereich</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -32,4 +32,17 @@ return [
|
|||||||
'notice' => 'Bitte bestätigen Sie Ihre E-Mail-Adresse.',
|
'notice' => 'Bitte bestätigen Sie Ihre E-Mail-Adresse.',
|
||||||
'resend' => 'E-Mail erneut senden',
|
'resend' => 'E-Mail erneut senden',
|
||||||
],
|
],
|
||||||
|
'header' => [
|
||||||
|
'home' => 'Home',
|
||||||
|
'packages' => 'Pakete',
|
||||||
|
'blog' => 'Blog',
|
||||||
|
'contact' => 'Kontakt',
|
||||||
|
'login' => 'Anmelden',
|
||||||
|
'register' => 'Registrieren',
|
||||||
|
'occasions' => [
|
||||||
|
'wedding' => 'Hochzeit',
|
||||||
|
'birthday' => 'Geburtstag',
|
||||||
|
'corporate' => 'Firmenevent',
|
||||||
|
],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
45
resources/lang/en/auth.php
Normal file
45
resources/lang/en/auth.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'failed' => 'These credentials do not match our records.',
|
||||||
|
'password' => 'The provided password is incorrect.',
|
||||||
|
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
|
||||||
|
'login' => [
|
||||||
|
'title' => 'Log In',
|
||||||
|
'username_or_email' => 'Username or Email',
|
||||||
|
'password' => 'Password',
|
||||||
|
'remember' => 'Remember Me',
|
||||||
|
'submit' => 'Log In',
|
||||||
|
],
|
||||||
|
'register' => [
|
||||||
|
'title' => 'Register',
|
||||||
|
'name' => 'Full Name',
|
||||||
|
'username' => 'Username',
|
||||||
|
'email' => 'Email Address',
|
||||||
|
'password' => 'Password',
|
||||||
|
'password_confirmation' => 'Confirm Password',
|
||||||
|
'first_name' => 'First Name',
|
||||||
|
'last_name' => 'Last Name',
|
||||||
|
'address' => 'Address',
|
||||||
|
'phone' => 'Phone Number',
|
||||||
|
'privacy_consent' => 'I agree to the privacy policy and accept the processing of my personal data.',
|
||||||
|
'submit' => 'Register',
|
||||||
|
],
|
||||||
|
'verification' => [
|
||||||
|
'notice' => 'Please confirm your email address.',
|
||||||
|
'resend' => 'Resend Email',
|
||||||
|
],
|
||||||
|
'header' => [
|
||||||
|
'home' => 'Home',
|
||||||
|
'packages' => 'Packages',
|
||||||
|
'blog' => 'Blog',
|
||||||
|
'contact' => 'Contact',
|
||||||
|
'login' => 'Login',
|
||||||
|
'register' => 'Register',
|
||||||
|
'occasions' => [
|
||||||
|
'wedding' => 'Wedding',
|
||||||
|
'birthday' => 'Birthday',
|
||||||
|
'corporate' => 'Corporate Event',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
@@ -8,6 +8,18 @@
|
|||||||
<link rel="icon" href="{{ asset('logo.svg') }}" type="image/svg+xml">
|
<link rel="icon" href="{{ asset('logo.svg') }}" type="image/svg+xml">
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.tsx'])
|
@vite(['resources/css/app.css', 'resources/js/app.tsx'])
|
||||||
|
|
||||||
|
@php
|
||||||
|
$currentLocale = app()->getLocale();
|
||||||
|
$path = request()->path();
|
||||||
|
$supportedLocales = ['de', 'en'];
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<link rel="canonical" href="{{ url($path) }}">
|
||||||
|
@foreach($supportedLocales as $locale)
|
||||||
|
<link rel="alternate" hreflang="{{ $locale }}" href="{{ url("/$locale$path") }}">
|
||||||
|
@endforeach
|
||||||
|
<link rel="alternate" hreflang="x-default" href="{{ url('/de' . $path) }}">
|
||||||
<style>
|
<style>
|
||||||
@keyframes aurora {
|
@keyframes aurora {
|
||||||
0%, 100% { background-position: 0% 50%; }
|
0%, 100% { background-position: 0% 50%; }
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
use Inertia\Inertia;
|
use Inertia\Inertia;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use App\Http\Controllers\CheckoutController;
|
use App\Http\Controllers\CheckoutController;
|
||||||
|
use App\Http\Controllers\LocaleController;
|
||||||
|
|
||||||
Route::get('/lang/{locale}/{namespace}', function ($locale, $namespace) {
|
Route::get('/lang/{locale}/{namespace}', function ($locale, $namespace) {
|
||||||
Log::info('Lang route hit', ['locale' => $locale, 'namespace' => $namespace]);
|
Log::info('Lang route hit', ['locale' => $locale, 'namespace' => $namespace]);
|
||||||
@@ -18,7 +19,20 @@ Route::get('/lang/{locale}/{namespace}', function ($locale, $namespace) {
|
|||||||
return response()->json($content);
|
return response()->json($content);
|
||||||
})->where(['locale' => 'de|en', 'namespace' => 'marketing|auth|common']);
|
})->where(['locale' => 'de|en', 'namespace' => 'marketing|auth|common']);
|
||||||
|
|
||||||
Route::prefix('{locale?}')->where(['locale' => 'de|en'])->middleware('locale')->group(function () {
|
// Redirect old prefixed URLs to prefix-free (301 permanent)
|
||||||
|
Route::any('{locale}/{path?}', function ($locale, $path = '') {
|
||||||
|
$cleanPath = $path ? "/$path" : '/';
|
||||||
|
return redirect($cleanPath, 301);
|
||||||
|
})->where([
|
||||||
|
'locale' => 'de|en',
|
||||||
|
'path' => '.*'
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Set locale route
|
||||||
|
Route::post('/set-locale', [LocaleController::class, 'set'])->name('locale.set');
|
||||||
|
|
||||||
|
// Main routes (prefix-free)
|
||||||
|
Route::middleware('locale')->group(function () {
|
||||||
Route::get('/', [\App\Http\Controllers\MarketingController::class, 'index'])->name('marketing');
|
Route::get('/', [\App\Http\Controllers\MarketingController::class, 'index'])->name('marketing');
|
||||||
Route::get('/packages', [\App\Http\Controllers\MarketingController::class, 'packagesIndex'])->name('packages');
|
Route::get('/packages', [\App\Http\Controllers\MarketingController::class, 'packagesIndex'])->name('packages');
|
||||||
Route::get('/packages/{id}', function ($id) {
|
Route::get('/packages/{id}', function ($id) {
|
||||||
@@ -29,67 +43,29 @@ Route::prefix('{locale?}')->where(['locale' => 'de|en'])->middleware('locale')->
|
|||||||
Route::get('/register', [\App\Http\Controllers\Auth\MarketingRegisterController::class, 'create'])->name('register');
|
Route::get('/register', [\App\Http\Controllers\Auth\MarketingRegisterController::class, 'create'])->name('register');
|
||||||
Route::post('/register', [\App\Http\Controllers\Auth\MarketingRegisterController::class, 'store'])->middleware('throttle:6,1')->name('register.store');
|
Route::post('/register', [\App\Http\Controllers\Auth\MarketingRegisterController::class, 'store'])->middleware('throttle:6,1')->name('register.store');
|
||||||
Route::post('/logout', [\App\Http\Controllers\Auth\AuthenticatedSessionController::class, 'destroy'])->name('logout');
|
Route::post('/logout', [\App\Http\Controllers\Auth\AuthenticatedSessionController::class, 'destroy'])->name('logout');
|
||||||
});
|
|
||||||
|
|
||||||
// Fallback for /login (redirect to default locale)
|
// Blog routes
|
||||||
Route::get('/login', function () {
|
|
||||||
return redirect('/de/login');
|
|
||||||
})->name('login.fallback');
|
|
||||||
|
|
||||||
// Fallback for POST /login (redirect to default locale, preserve method)
|
|
||||||
Route::post('/login', function (Request $request) {
|
|
||||||
return redirect('/de/login', 307)->withInput();
|
|
||||||
})->name('login.fallback.post');
|
|
||||||
|
|
||||||
// Fallback for /register (redirect to default locale)
|
|
||||||
Route::post('/register', function (Request $request) {
|
|
||||||
return redirect('/de/register' . $request->getQueryString());
|
|
||||||
})->name('register.fallback');
|
|
||||||
|
|
||||||
// Fallback for /logout (redirect to default locale)
|
|
||||||
Route::post('/logout', function () {
|
|
||||||
return redirect('/de/logout');
|
|
||||||
})->name('logout.fallback');
|
|
||||||
|
|
||||||
// Fallback for /packages (redirect to default locale)
|
|
||||||
Route::get('/packages', function () {
|
|
||||||
return redirect('/de/packages');
|
|
||||||
})->name('packages.fallback');
|
|
||||||
|
|
||||||
// Fallback for /blog (redirect to default locale)
|
|
||||||
Route::get('/blog', function () {
|
|
||||||
return redirect('/de/blog');
|
|
||||||
})->name('blog.fallback');
|
|
||||||
|
|
||||||
// Blog Routes (inside locale group for i18n support)
|
|
||||||
Route::prefix('{locale?}')->where(['locale' => 'de|en'])->middleware('locale')->group(function () {
|
|
||||||
Route::get('/blog', [\App\Http\Controllers\MarketingController::class, 'blogIndex'])->name('blog');
|
Route::get('/blog', [\App\Http\Controllers\MarketingController::class, 'blogIndex'])->name('blog');
|
||||||
Route::get('/blog/{post}', [\App\Http\Controllers\MarketingController::class, 'blogShow'])->name('blog.show');
|
Route::get('/blog/{post}', [\App\Http\Controllers\MarketingController::class, 'blogShow'])->name('blog.show');
|
||||||
|
|
||||||
|
// Legal pages
|
||||||
|
Route::get('/impressum', function () {
|
||||||
|
return view('legal.impressum');
|
||||||
|
})->name('impressum');
|
||||||
|
Route::get('/datenschutz', function () {
|
||||||
|
return view('legal.datenschutz');
|
||||||
|
})->name('datenschutz');
|
||||||
|
Route::get('/kontakt', [\App\Http\Controllers\MarketingController::class, 'contactView'])->name('kontakt');
|
||||||
|
Route::post('/kontakt', [\App\Http\Controllers\MarketingController::class, 'contact'])->name('kontakt.submit');
|
||||||
|
|
||||||
|
// Anlässe routes
|
||||||
|
Route::get('/anlaesse/{type}', [\App\Http\Controllers\MarketingController::class, 'occasionsType'])
|
||||||
|
->where([
|
||||||
|
'type' => 'hochzeit|geburtstag|firmenevent'
|
||||||
|
])
|
||||||
|
->name('anlaesse.type');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fallbacks for Legal Pages (redirect to default locale)
|
|
||||||
Route::get('/impressum', function () {
|
|
||||||
return redirect('/de/impressum');
|
|
||||||
})->name('impressum.fallback');
|
|
||||||
Route::get('/datenschutz', function () {
|
|
||||||
return redirect('/de/datenschutz');
|
|
||||||
})->name('datenschutz.fallback');
|
|
||||||
Route::get('/kontakt', function () {
|
|
||||||
return redirect('/de/kontakt');
|
|
||||||
})->name('kontakt.fallback');
|
|
||||||
|
|
||||||
// Legal Pages in locale group
|
|
||||||
Route::prefix('{locale?}')->where(['locale' => 'de|en'])->middleware('locale')->group(function () {
|
|
||||||
Route::get('/impressum', function () {
|
|
||||||
return view('legal.impressum');
|
|
||||||
})->name('impressum');
|
|
||||||
Route::get('/datenschutz', function () {
|
|
||||||
return view('legal.datenschutz');
|
|
||||||
})->name('datenschutz');
|
|
||||||
Route::get('/kontakt', [\App\Http\Controllers\MarketingController::class, 'contactView'])->name('kontakt');
|
|
||||||
Route::post('/kontakt', [\App\Http\Controllers\MarketingController::class, 'contact'])->name('kontakt.submit');
|
|
||||||
});
|
|
||||||
|
|
||||||
Route::middleware(['auth', 'verified'])->group(function () {
|
Route::middleware(['auth', 'verified'])->group(function () {
|
||||||
Route::get('dashboard', function () {
|
Route::get('dashboard', function () {
|
||||||
return Inertia::render('dashboard');
|
return Inertia::render('dashboard');
|
||||||
@@ -163,13 +139,6 @@ Route::middleware('auth')->group(function () {
|
|||||||
|
|
||||||
Route::get('/marketing/success/{package_id?}', [\App\Http\Controllers\MarketingController::class, 'success'])->name('marketing.success');
|
Route::get('/marketing/success/{package_id?}', [\App\Http\Controllers\MarketingController::class, 'success'])->name('marketing.success');
|
||||||
|
|
||||||
Route::prefix('{locale?}')->where(['locale' => 'de|en'])->middleware('locale')->group(function () {
|
|
||||||
Route::get('/anlaesse/{type}', [\App\Http\Controllers\MarketingController::class, 'occasionsType'])
|
|
||||||
->where([
|
|
||||||
'type' => 'hochzeit|geburtstag|firmenevent'
|
|
||||||
])
|
|
||||||
->name('anlaesse.type');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
73
tests/e2e/link-test.test.ts
Normal file
73
tests/e2e/link-test.test.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import { test, expect } from '@playwright/test';
|
||||||
|
|
||||||
|
test('Test all links on homepage', async ({ page }) => {
|
||||||
|
const errors: string[] = [];
|
||||||
|
const consoleMessages: { type: string; text: string }[] = [];
|
||||||
|
|
||||||
|
page.on('console', msg => {
|
||||||
|
consoleMessages.push({ type: msg.type(), text: msg.text() });
|
||||||
|
if (msg.type() === 'error') {
|
||||||
|
console.log('Console Error:', msg.text());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
page.on('pageerror', error => {
|
||||||
|
console.log('Page Error:', error.message);
|
||||||
|
errors.push(error.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.goto('http://localhost:8000/');
|
||||||
|
|
||||||
|
// Wait for page to load
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
|
// Get all links
|
||||||
|
const links = await page.locator('a[href]').all();
|
||||||
|
|
||||||
|
console.log(`Found ${links.length} links`);
|
||||||
|
|
||||||
|
for (let i = 0; i < links.length; i++) {
|
||||||
|
const link = links[i];
|
||||||
|
const text = await link.textContent();
|
||||||
|
const href = await link.getAttribute('href');
|
||||||
|
|
||||||
|
console.log(`Clicking link ${i + 1}: "${text?.trim() || 'No text'}" -> ${href}`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Clear previous errors
|
||||||
|
const currentErrors = [...errors];
|
||||||
|
errors.length = 0;
|
||||||
|
|
||||||
|
await link.click({ force: true });
|
||||||
|
|
||||||
|
// Wait a bit for navigation or error
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
|
||||||
|
// Check for new errors
|
||||||
|
const newErrors = errors.filter(e => !currentErrors.includes(e));
|
||||||
|
if (newErrors.length > 0) {
|
||||||
|
console.log(`Error on link "${text?.trim() || 'No text'}":`, newErrors);
|
||||||
|
expect(newErrors).toHaveLength(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check console for errors after click
|
||||||
|
const recentConsole = consoleMessages.filter(msg => msg.text.includes('TypeError') || msg.text.includes('href') || msg.type === 'error');
|
||||||
|
if (recentConsole.length > 0) {
|
||||||
|
console.log(`Console error on link "${text?.trim() || 'No text'}":`, recentConsole);
|
||||||
|
expect(recentConsole).toHaveLength(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If navigated, go back
|
||||||
|
if (page.url() !== 'http://localhost:8000/') {
|
||||||
|
await page.goBack();
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error: unknown) {
|
||||||
|
console.log(`Error clicking link "${text?.trim() || 'No text'}":`, (error as Error).message);
|
||||||
|
expect(error).toBeUndefined();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(errors).toHaveLength(0);
|
||||||
|
});
|
||||||
73
tests/link-test.spec.ts
Normal file
73
tests/link-test.spec.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import { test, expect } from '@playwright/test';
|
||||||
|
|
||||||
|
test('Test all links on homepage', async ({ page }) => {
|
||||||
|
const errors = [];
|
||||||
|
const consoleMessages = [];
|
||||||
|
|
||||||
|
page.on('console', msg => {
|
||||||
|
consoleMessages.push({ type: msg.type(), text: msg.text() });
|
||||||
|
if (msg.type() === 'error') {
|
||||||
|
console.log('Console Error:', msg.text());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
page.on('pageerror', error => {
|
||||||
|
console.log('Page Error:', error.message);
|
||||||
|
errors.push(error.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.goto('http://localhost:8000/');
|
||||||
|
|
||||||
|
// Wait for page to load
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
|
// Get all links
|
||||||
|
const links = await page.locator('a[href]').all();
|
||||||
|
|
||||||
|
console.log(`Found ${links.length} links`);
|
||||||
|
|
||||||
|
for (let i = 0; i < links.length; i++) {
|
||||||
|
const link = links[i];
|
||||||
|
const text = await link.textContent();
|
||||||
|
const href = await link.getAttribute('href');
|
||||||
|
|
||||||
|
console.log(`Clicking link ${i + 1}: "${text?.trim() || 'No text'}" -> ${href}`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Clear previous errors
|
||||||
|
const currentErrors = [...errors];
|
||||||
|
errors.length = 0;
|
||||||
|
|
||||||
|
await link.click({ force: true });
|
||||||
|
|
||||||
|
// Wait a bit for navigation or error
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
|
||||||
|
// Check for new errors
|
||||||
|
const newErrors = errors.filter(e => !currentErrors.includes(e));
|
||||||
|
if (newErrors.length > 0) {
|
||||||
|
console.log(`Error on link "${text?.trim() || 'No text'}":`, newErrors);
|
||||||
|
expect(newErrors).toHaveLength(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check console for errors after click
|
||||||
|
const recentConsole = consoleMessages.filter(msg => msg.text.includes('TypeError') || msg.text.includes('href') || msg.type() === 'error');
|
||||||
|
if (recentConsole.length > 0) {
|
||||||
|
console.log(`Console error on link "${text?.trim() || 'No text'}":`, recentConsole);
|
||||||
|
expect(recentConsole).toHaveLength(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If navigated, go back
|
||||||
|
if (page.url() !== 'http://localhost:8000/') {
|
||||||
|
await page.goBack();
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(`Error clicking link "${text?.trim() || 'No text'}":`, error);
|
||||||
|
expect(error).toBeUndefined();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(errors).toHaveLength(0);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user