First commit
This commit is contained in:
commit
7cf3558ba7
12933 changed files with 1180047 additions and 0 deletions
65
app/Livewire/Web/Components/UI/ContactForm.php
Normal file
65
app/Livewire/Web/Components/UI/ContactForm.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Ui;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class ContactForm extends Component
|
||||
{
|
||||
public $firstName = '';
|
||||
public $lastName = '';
|
||||
public $company = '';
|
||||
public $email = '';
|
||||
public $phone = '';
|
||||
public $subject = '';
|
||||
public $message = '';
|
||||
|
||||
public $content = [];
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.contact_form", []);
|
||||
}
|
||||
|
||||
public function getSubjectsProperty()
|
||||
{
|
||||
return $this->content['form']['subjects'] ?? [];
|
||||
}
|
||||
|
||||
public function getContactInfoProperty()
|
||||
{
|
||||
return $this->content['contact_info'] ?? [];
|
||||
}
|
||||
|
||||
public function getSocialMediaProperty()
|
||||
{
|
||||
return $this->content['social_media']['platforms'] ?? [];
|
||||
}
|
||||
|
||||
public function submit()
|
||||
{
|
||||
$this->validate([
|
||||
'firstName' => 'required|string|max:255',
|
||||
'lastName' => 'required|string|max:255',
|
||||
'email' => 'required|email|max:255',
|
||||
'subject' => 'required|string',
|
||||
'message' => 'required|string|max:2000',
|
||||
'company' => 'nullable|string|max:255',
|
||||
'phone' => 'nullable|string|max:255',
|
||||
]);
|
||||
|
||||
// Here you would typically save to database or send email
|
||||
// For now, we'll just show a success message
|
||||
|
||||
$successMessage = $this->content['form']['success_message'] ?? 'Vielen Dank für Ihre Nachricht! Wir werden uns schnellstmöglich bei Ihnen melden.';
|
||||
session()->flash('message', $successMessage);
|
||||
|
||||
$this->reset(['firstName', 'lastName', 'company', 'email', 'phone', 'subject', 'message']);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.ui.contact-form');
|
||||
}
|
||||
}
|
||||
13
app/Livewire/Web/Components/UI/Footer.php
Normal file
13
app/Livewire/Web/Components/UI/Footer.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Ui;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Footer extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.ui.footer');
|
||||
}
|
||||
}
|
||||
57
app/Livewire/Web/Components/UI/Header.php
Normal file
57
app/Livewire/Web/Components/UI/Header.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Ui;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Header extends Component
|
||||
{
|
||||
public $isMobileMenuOpen = false;
|
||||
public $domainName;
|
||||
public $domainUrl;
|
||||
public $content = [];
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->domainName = \App\Helpers\ThemeHelper::getDomainName();
|
||||
$this->domainUrl = \App\Helpers\ThemeHelper::getDomainUrl();
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.header", []);
|
||||
}
|
||||
|
||||
public function toggleMobileMenu()
|
||||
{
|
||||
$this->isMobileMenuOpen = ! $this->isMobileMenuOpen;
|
||||
}
|
||||
|
||||
public function closeMobileMenu()
|
||||
{
|
||||
$this->isMobileMenuOpen = false;
|
||||
}
|
||||
public function isActiveRoute($url)
|
||||
{
|
||||
$currentPath = request()->path();
|
||||
$currentPath = '/' . ltrim($currentPath, '/');
|
||||
|
||||
// Exact match
|
||||
if ($currentPath === $url) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Special handling for home route
|
||||
if ($url === '/' && ($currentPath === '/' || $currentPath === '')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if current path starts with the navigation URL (for sub-pages)
|
||||
if ($url !== '/' && str_starts_with($currentPath, rtrim($url, '/'))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.ui.header');
|
||||
}
|
||||
}
|
||||
62
app/Livewire/Web/Components/UI/TopBar.php
Normal file
62
app/Livewire/Web/Components/UI/TopBar.php
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Ui;
|
||||
|
||||
use Livewire\Component;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class TopBar extends Component
|
||||
{
|
||||
public $currentLocale;
|
||||
public $availableLocales = [
|
||||
'de' => 'Deutsch',
|
||||
'en' => 'English',
|
||||
//'fr' => 'Français',
|
||||
//'es' => 'Español',
|
||||
];
|
||||
|
||||
public $localeFlags = [
|
||||
'de' => '🇩🇪',
|
||||
'en' => '🇬🇧',
|
||||
];
|
||||
|
||||
public $domainName;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
Log::info('Mounting TopBar');
|
||||
$sessionLocale = session('locale');
|
||||
if ($sessionLocale && array_key_exists($sessionLocale, $this->availableLocales)) {
|
||||
app()->setLocale($sessionLocale);
|
||||
$this->currentLocale = $sessionLocale;
|
||||
} else {
|
||||
$this->currentLocale = app()->getLocale();
|
||||
}
|
||||
$this->domainName = \App\Helpers\ThemeHelper::getDomainName();
|
||||
}
|
||||
|
||||
public function switchLanguage($locale)
|
||||
{
|
||||
Log::info('Switching language to: ' . $locale);
|
||||
|
||||
if (array_key_exists($locale, $this->availableLocales)) {
|
||||
app()->setLocale($locale);
|
||||
session(['locale' => $locale]);
|
||||
$this->currentLocale = $locale;
|
||||
|
||||
Log::info('Language switched successfully to: ' . $locale);
|
||||
|
||||
// Wichtig: In Livewire zeigt request()->url() auf /livewire/update.
|
||||
// Für einen Seiten-Reload müssen wir den Browser-Referer nutzen.
|
||||
$referer = request()->header('Referer') ?? '/';
|
||||
return redirect()->to($referer);
|
||||
}
|
||||
|
||||
Log::warning('Invalid locale attempted: ' . $locale);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.ui.top-bar');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue