diff --git a/app/Enums/StaticPageType.php b/app/Enums/StaticPageType.php index 89fec570..7610d3ae 100644 --- a/app/Enums/StaticPageType.php +++ b/app/Enums/StaticPageType.php @@ -11,6 +11,7 @@ enum StaticPageType: int case contact = 1; case legals = 2; case confidentiality = 3; + case recruitment = 4; /** * Optionnal labels definition. @@ -21,5 +22,6 @@ enum StaticPageType: int self::contact->name => 'Contact', self::legals->name => 'Mentions légales', self::confidentiality->name => 'Confidentialité', + self::recruitment->name => 'Recrutement', ]; } diff --git a/app/Http/Controllers/Fo/StaticPageController.php b/app/Http/Controllers/Fo/StaticPageController.php index d233b4c6..6672da62 100644 --- a/app/Http/Controllers/Fo/StaticPageController.php +++ b/app/Http/Controllers/Fo/StaticPageController.php @@ -9,38 +9,50 @@ use App\Models\StaticPage; class StaticPageController extends Controller { /** - * Contact show + * Contact page. * - * @param \App\Models\StaticPage $contactPage + * @param \App\Models\StaticPage $staticPageModel * @return \Illuminate\Contracts\View\View */ - public function contact(StaticPage $contactPage) + public function contact(StaticPage $staticPageModel) { - $contactPage = StaticPage::query()->where('type', StaticPageType::contact)->first(); - return view('fo.pages.legals', ['staticPageModel' => $contactPage]); + $staticPageModel = StaticPage::query()->where('type', StaticPageType::contact)->first(); + return view('fo.pages.legals', ['staticPageModel' => $staticPageModel]); } /** - * Legal show + * Legals page. * - * @param \App\Models\StaticPage $legalPage + * @param \App\Models\StaticPage $staticPageModel * @return \Illuminate\Contracts\View\View */ - public function legals(StaticPage $legalPage) + public function legals(StaticPage $staticPageModel) { - $legalPage = StaticPage::query()->where('type', StaticPageType::legals)->first(); - return view('fo.pages.legals', ['staticPageModel' => $legalPage]); + $staticPageModel = StaticPage::query()->where('type', StaticPageType::legals)->first(); + return view('fo.pages.legals', ['staticPageModel' => $staticPageModel]); } /** - * Policies show + * Confidentiality page. * - * @param \App\Models\StaticPage $policiesPage + * @param \App\Models\StaticPage $staticPageModel * @return \Illuminate\Contracts\View\View */ - public function policies(StaticPage $policiesPage) + public function policies(StaticPage $staticPageModel) { - $policiesPage = StaticPage::query()->where('type', StaticPageType::confidentiality)->first(); - return view('fo.pages.legals', ['staticPageModel' => $policiesPage]); + $staticPageModel = StaticPage::query()->where('type', StaticPageType::confidentiality)->first(); + return view('fo.pages.legals', ['staticPageModel' => $staticPageModel]); + } + + /** + * Recruitment page. + * + * @param \App\Models\StaticPage $staticPageModel + * @return \Illuminate\Contracts\View\View + */ + public function recruitment(StaticPage $staticPageModel) + { + $staticPageModel = StaticPage::query()->where('type', StaticPageType::recruitment)->first(); + return view('fo.pages.recruitment', ['staticPageModel' => $staticPageModel]); } } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 2c78eaf6..560e4142 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -26,7 +26,7 @@ class RedirectIfAuthenticated if (auth($guard)->check()) { switch ($guard) { case 'frontend': - return \redirect()->route('fo.homepage'); + return \redirect()->route('fo.home.show'); case 'backend': if (!$request->routeIs('bo.*')) { continue; diff --git a/database/seeders/Mandatory/StaticPageSeeder.php b/database/seeders/Mandatory/StaticPageSeeder.php index 89cba341..66be3bf1 100644 --- a/database/seeders/Mandatory/StaticPageSeeder.php +++ b/database/seeders/Mandatory/StaticPageSeeder.php @@ -16,39 +16,43 @@ class StaticPageSeeder extends Seeder public function run() { StaticPage::query()->updateOrCreate( + ['type' => StaticPageType::contact], [ - 'type' => StaticPageType::contact, - ], - [ - 'seo_title' => 'Seo title pour la page contact', - 'seo_description' => 'Seo description pour la page contact', - 'title' => 'Contact', + 'seo_title' => sprintf('Seo title pour la page %s', StaticPageType::contact->label()), + 'seo_description' => sprintf('Seo description pour la page %s', StaticPageType::contact->label()), + 'title' => StaticPageType::contact->label(), 'type' => StaticPageType::contact, - 'content' => \clean(\fake()->randomHtml(6, 7)), + 'content' => \clean(\fake()->randomHtml()), ] ); StaticPage::query()->updateOrCreate( + ['type' => StaticPageType::legals], [ - 'type' => StaticPageType::legals, - ], - [ - 'seo_title' => 'Seo title pour la page mentions légales', - 'seo_description' => 'Seo description pour la page mentions légales', - 'title' => 'Mentions légales', + 'seo_title' => sprintf('Seo title pour la page %s', StaticPageType::legals->label()), + 'seo_description' => sprintf('Seo description pour la page %s', StaticPageType::legals->label()), + 'title' => StaticPageType::legals->label(), 'type' => StaticPageType::legals, - 'content' => \clean(\fake()->randomHtml(6, 7)), + 'content' => \clean(\fake()->randomHtml()), ] ); StaticPage::query()->updateOrCreate( + ['type' => StaticPageType::confidentiality], [ - 'type' => StaticPageType::confidentiality, - ], - [ - 'seo_title' => 'Seo title pour la page charte de confidentialitée', - 'seo_description' => 'Seo description pour la page charte de confidentialitée', - 'title' => 'Charte de confidentialitée', + 'seo_title' => sprintf('Seo title pour la page %s', StaticPageType::confidentiality->label()), + 'seo_description' => sprintf('Seo description pour la page %s', StaticPageType::confidentiality->label()), + 'title' => StaticPageType::confidentiality->label(), 'type' => StaticPageType::confidentiality, - 'content' => \clean(\fake()->randomHtml(6, 7)), + 'content' => \clean(\fake()->randomHtml()), + ] + ); + StaticPage::query()->updateOrCreate( + ['type' => StaticPageType::recruitment], + [ + 'seo_title' => sprintf('Seo title pour la page %s', StaticPageType::recruitment->label()), + 'seo_description' => sprintf('Seo description pour la page %s', StaticPageType::recruitment->label()), + 'title' => StaticPageType::recruitment->label(), + 'type' => StaticPageType::recruitment, + 'content' => \clean(\fake()->randomHtml()), ] ); } diff --git a/resources/sass/bo/base/_common.scss b/resources/sass/bo/base/_common.scss index 46160397..8d79e69a 100644 --- a/resources/sass/bo/base/_common.scss +++ b/resources/sass/bo/base/_common.scss @@ -15,11 +15,13 @@ body { .sidebar { position: fixed; + z-index: 2; top: $bo-header-height; left: 0; overflow-y: auto; @include media-breakpoint-up(md) { + z-index: 1; height: calc(100vh - #{$bo-header-height}); } @@ -94,3 +96,8 @@ body { border-radius: 0 0 0.375rem !important; } } + +.image-preview { + max-width: 6rem; + max-height: 6rem; +} diff --git a/resources/ts/bo/components/ImageInputComponent.vue b/resources/ts/bo/components/ImageInputComponent.vue index 9951b0ef..981044eb 100644 --- a/resources/ts/bo/components/ImageInputComponent.vue +++ b/resources/ts/bo/components/ImageInputComponent.vue @@ -1,10 +1,10 @@