diff --git a/app/Http/Livewire/Frontend/Header.php b/app/Http/Livewire/Frontend/Header.php index 44c902c1..8b30f95d 100644 --- a/app/Http/Livewire/Frontend/Header.php +++ b/app/Http/Livewire/Frontend/Header.php @@ -23,20 +23,26 @@ class Header extends Component public string $l = 'de'; + public string $timezone; + public $bgColor = 'bg-21gray'; protected $queryString = ['l']; + protected $listeners = ['refresh' => '$refresh']; + public function rules() { return [ - 'c' => 'required', - 'l' => 'required', + 'c' => 'required', + 'l' => 'required', + 'timezone' => 'required', ]; } public function mount() { + $this->timezone = config('app.user-timezone'); $this->l = Cookie::get('lang') ?: config('app.locale'); if (!$this->country) { $this->country = Country::query() @@ -47,6 +53,15 @@ class Header extends Component $this->c = $this->country->code; } + public function updatedTimezone($value) + { + auth() + ->user() + ->update(['timezone' => $value]); + + return redirect(request()->header('Referer')); + } + public function updatedC($value) { return to_route($this->currentRouteName, ['country' => $value, 'lang' => $this->l]); diff --git a/resources/lang/de.json b/resources/lang/de.json index 0ba32f28..7b16bdb8 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -786,5 +786,6 @@ "Manage": "Verwalten", "Manage content creators": "Verwalte Content Creators", "Lecturers\/Content Creators": "Dozenten\/Content Creators", - "Manage lecturers": "Verwalte Dozenten" + "Manage lecturers": "Verwalte Dozenten", + "Settings": "Einstellungen" } diff --git a/resources/lang/en.json b/resources/lang/en.json index 4768be0f..1988a4aa 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -783,5 +783,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/es.json b/resources/lang/es.json index 8d338b77..2c30e745 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -783,5 +783,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/fr.json b/resources/lang/fr.json index b5ff8dcd..3a8d9373 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -784,5 +784,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/hr.json b/resources/lang/hr.json index 648f3edd..4ae2bcaf 100644 --- a/resources/lang/hr.json +++ b/resources/lang/hr.json @@ -784,5 +784,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/it.json b/resources/lang/it.json index 6959eec7..482434fb 100644 --- a/resources/lang/it.json +++ b/resources/lang/it.json @@ -784,5 +784,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/mk.json b/resources/lang/mk.json index 5c6c13e4..e1476cdd 100644 --- a/resources/lang/mk.json +++ b/resources/lang/mk.json @@ -784,5 +784,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/pl.json b/resources/lang/pl.json index e0d9e7eb..4d316d06 100644 --- a/resources/lang/pl.json +++ b/resources/lang/pl.json @@ -784,5 +784,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/pt.json b/resources/lang/pt.json index 3a0595cf..bbdadd56 100644 --- a/resources/lang/pt.json +++ b/resources/lang/pt.json @@ -784,5 +784,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/sv.json b/resources/lang/sv.json index 040f5c0e..284f31ff 100644 --- a/resources/lang/sv.json +++ b/resources/lang/sv.json @@ -746,5 +746,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/lang/tr.json b/resources/lang/tr.json index ceec03d7..001d4507 100644 --- a/resources/lang/tr.json +++ b/resources/lang/tr.json @@ -758,5 +758,6 @@ "Manage content creators": "", "Participants": "", "Lecturers\/Content Creators": "", - "Manage lecturers": "" + "Manage lecturers": "", + "Settings": "" } \ No newline at end of file diff --git a/resources/views/livewire/frontend/header.blade.php b/resources/views/livewire/frontend/header.blade.php index cba510bf..5d66a86c 100644 --- a/resources/views/livewire/frontend/header.blade.php +++ b/resources/views/livewire/frontend/header.blade.php @@ -35,6 +35,8 @@ @include('livewire.frontend.navigation.profile') @endauth + @include('livewire.frontend.navigation.settings') +