lecturer landing pages added

This commit is contained in:
Benjamin Takats
2023-01-15 14:44:01 +01:00
parent f3c8ebc3c5
commit cee5e7031c
5 changed files with 15 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ use App\Models\Country;
use App\Models\CourseEvent; use App\Models\CourseEvent;
use App\Models\Lecturer; use App\Models\Lecturer;
use Livewire\Component; use Livewire\Component;
use RalphJSmit\Laravel\SEO\Support\SEOData;
class LecturerLandingPage extends Component class LecturerLandingPage extends Component
{ {
@@ -37,7 +38,14 @@ class LecturerLandingPage extends Component
'location' => $event->course->name, 'location' => $event->course->name,
'description' => $event->venue->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) public function showEvent($id)

View File

@@ -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 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.", "This is the subtitle on the landing page.": "Das ist der Untertitel auf der Landing-Page des Dozenten.",
"Subtitle": "Untertitel auf der Landing-Page", "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."
} }

View File

@@ -627,5 +627,6 @@
"This is the introduction text that is shown on the landing page.": "", "This is the introduction text that is shown on the landing page.": "",
"This is the subtitle on the landing page.": "", "This is the subtitle on the landing page.": "",
"Subtitle": "", "Subtitle": "",
"Intro": "" "Intro": "",
"This lecturer has not yet written an introduction.": ""
} }

View File

@@ -24,7 +24,7 @@
</x-button> </x-button>
@endif @endif
<x-button <x-button
:href="route('school.landingPage.lecturer', ['country' => $country, 'lecturer' => $row->id])" :href="route('school.landingPage.lecturer', ['country' => $country, 'lecturer' => $row->slug])"
amber> amber>
<i class="fa fa-thin fa-browser mr-2"></i> <i class="fa fa-thin fa-browser mr-2"></i>
{{ __('Show landing page') }} {{ __('Show landing page') }}

View File

@@ -31,7 +31,7 @@ Route::middleware([])
Route::get('/event', \App\Http\Livewire\School\EventTable::class) Route::get('/event', \App\Http\Livewire\School\EventTable::class)
->name('table.event'); ->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'); ->name('landingPage.lecturer');
}); });