From cee5e7031c4655a0af81be2d663291143ab84674 Mon Sep 17 00:00:00 2001 From: Benjamin Takats Date: Sun, 15 Jan 2023 14:44:01 +0100 Subject: [PATCH] lecturer landing pages added --- app/Http/Livewire/School/LecturerLandingPage.php | 10 +++++++++- resources/lang/de.json | 3 ++- resources/lang/en.json | 3 ++- resources/views/columns/lectures/action.blade.php | 2 +- routes/web.php | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/Http/Livewire/School/LecturerLandingPage.php b/app/Http/Livewire/School/LecturerLandingPage.php index 97651a9a..7e18ac78 100644 --- a/app/Http/Livewire/School/LecturerLandingPage.php +++ b/app/Http/Livewire/School/LecturerLandingPage.php @@ -6,6 +6,7 @@ use App\Models\Country; use App\Models\CourseEvent; use App\Models\Lecturer; use Livewire\Component; +use RalphJSmit\Laravel\SEO\Support\SEOData; class LecturerLandingPage extends Component { @@ -37,7 +38,14 @@ class LecturerLandingPage extends Component 'location' => $event->course->name, 'description' => $event->venue->name, ]), - ]); + ]) + ->layout('layouts.guest', [ + 'SEOData' => new SEOData( + title: $this->lecturer->name, + description: $this->lecturer->intro ?? __('This lecturer has not yet written an introduction.'), + image: asset($this->lecturer->getFirstMediaUrl('avatar')), + ) + ]); } public function showEvent($id) diff --git a/resources/lang/de.json b/resources/lang/de.json index 127b834a..ca73bae9 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -635,5 +635,6 @@ "This is the introduction text that is shown on the landing page.": "Das ist der Text, der auf der Landing-Page des Dozenten.", "This is the subtitle on the landing page.": "Das ist der Untertitel auf der Landing-Page des Dozenten.", "Subtitle": "Untertitel auf der Landing-Page", - "Intro": "Intro auf der Landing-Page" + "Intro": "Intro auf der Landing-Page", + "This lecturer has not yet written an introduction.": "Dieser Dozent hat noch keine Einführung geschrieben." } diff --git a/resources/lang/en.json b/resources/lang/en.json index 0de4d4fc..5a7d6be9 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -627,5 +627,6 @@ "This is the introduction text that is shown on the landing page.": "", "This is the subtitle on the landing page.": "", "Subtitle": "", - "Intro": "" + "Intro": "", + "This lecturer has not yet written an introduction.": "" } diff --git a/resources/views/columns/lectures/action.blade.php b/resources/views/columns/lectures/action.blade.php index 1fcc1b23..6509bf2b 100644 --- a/resources/views/columns/lectures/action.blade.php +++ b/resources/views/columns/lectures/action.blade.php @@ -24,7 +24,7 @@ @endif {{ __('Show landing page') }} diff --git a/routes/web.php b/routes/web.php index 06b6d6fc..b613a419 100644 --- a/routes/web.php +++ b/routes/web.php @@ -31,7 +31,7 @@ Route::middleware([]) Route::get('/event', \App\Http\Livewire\School\EventTable::class) ->name('table.event'); - Route::get('/{lecturer}', \App\Http\Livewire\School\LecturerLandingPage::class) + Route::get('/{lecturer:slug}', \App\Http\Livewire\School\LecturerLandingPage::class) ->name('landingPage.lecturer'); });