diff --git a/app/Enums/Contact/ContactFormType.php b/app/Enums/Contact/ContactFormType.php index 820e15ce..14afc1f1 100644 --- a/app/Enums/Contact/ContactFormType.php +++ b/app/Enums/Contact/ContactFormType.php @@ -3,6 +3,7 @@ namespace App\Enums\Contact; use App\Helpers\RouteHelper; +use Illuminate\Support\Facades\Lang; use Uwil\LaravelCommon\Traits\Enums\BaseEnum; enum ContactFormType: int @@ -117,21 +118,6 @@ enum ContactFormType: int }; } - /** - * Get the data-target - * - * @return string - */ - public function hasBlankTarget(): string - { - $locale = config('app.locale'); - - return match (true) { - $this === self::restauration => $locale === "en" ? true : false, - default => false, - }; - } - /** * Get the subtitle * @@ -150,18 +136,18 @@ enum ContactFormType: int * * @return string|null */ - public function slug(): string|null + public function slug(?string $locale = null): ?string { return match ($this) { - self::collaborator => __('enums.contactFormType.collaborator.slug'), - self::breeder => __('enums.contactFormType.breeder.slug'), + self::collaborator => Lang::get('enums.contactFormType.collaborator.slug', [], $locale), + self::breeder => Lang::get('enums.contactFormType.breeder.slug', [], $locale), self::professional => null, - self::restauration => __('enums.contactFormType.restauration.slug'), - self::export => __('enums.contactFormType.export.slug'), - self::finance => __('enums.contactFormType.finance.slug'), - self::commitments => __('enums.contactFormType.commitments.slug'), - self::product => __('enums.contactFormType.product.slug'), - self::info => __('enums.contactFormType.info.slug'), + self::restauration => Lang::get('enums.contactFormType.restauration.slug', [], $locale), + self::export => Lang::get('enums.contactFormType.export.slug', [], $locale), + self::finance => Lang::get('enums.contactFormType.finance.slug', [], $locale), + self::commitments => Lang::get('enums.contactFormType.commitments.slug', [], $locale), + self::product => Lang::get('enums.contactFormType.product.slug', [], $locale), + self::info => Lang::get('enums.contactFormType.info.slug', [], $locale), self::press => null, }; } @@ -182,16 +168,12 @@ enum ContactFormType: int self::commitments, self::product, self::info, - + self::restauration ]; - $locale = config('app.locale'); return match (true) { in_array($this, $commonRoutes, true) => route('front.contact.show', ['slug' => $this->slug()]), $this === self::professional => null, $this === self::press => RouteHelper::routeNameChecker('front.dynamic-pages.espace-presse') . '#page-press-form', - $this === self::restauration => $locale === "fr" - ? RouteHelper::routeNameChecker('front.contact.show', ['slug' => $this->slug()]) - : 'https://www.legauloisprofessionnel.fr/contactez-nous', default => null, }; } @@ -264,4 +246,22 @@ enum ContactFormType: int ], }; } + + /** + * Check if current lang slug match in specific lang slug + */ + public static function fromSlug(string $slug, string $locale): ?self + { + foreach (self::cases() as $case) { + $caseSlug = $case->slug($locale); + + if ( + $caseSlug !== null && + mb_strtolower($caseSlug) === mb_strtolower($slug) + ) { + return $case; + } + } + return null; + } } diff --git a/app/Helpers/DynamicPageHelper.php b/app/Helpers/DynamicPageHelper.php index 7208ba4f..e93bc494 100644 --- a/app/Helpers/DynamicPageHelper.php +++ b/app/Helpers/DynamicPageHelper.php @@ -3,6 +3,9 @@ namespace App\Helpers; use App\Enums\DynamicFieldTypes; +use App\Enums\DynamicPages\PageStatusEnum; +use App\Models\DynamicPage; +use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Str; use Illuminate\Database\Eloquent\Model; use Uwil\LaravelCommon\Helpers\FileHelper; @@ -122,4 +125,38 @@ class DynamicPageHelper $new = collect($newContent)->filter($filter); return $new->keys()->merge($old->keys())->unique(); } + + /** + * Get all segments url for dynamic pages + * + * @param DynamicPage $page + * @param Collection $pages + * @param string $locale + * @return array|null + */ + public static function getAllDynamicPageSegments(DynamicPage $page, Collection $pages, string $locale): ?array + { + $segments = []; + $parentId = $page->page_id ?? ($page->parentPage->id ?? null); + + // Browse all relationships. + while ($parentId) { + /** @var \App\Models\DynamicPage|null $parentPage */ + $parent = $pages->find($parentId); + + if (! $parent || !$parent->status->equals(PageStatusEnum::published)) { + return null; + } + + $parentSlug = $parent->getTranslation('slug', $locale); + + if (! $parentSlug) { + return null; + } + + array_unshift($segments, $parentSlug); + $parentId = $parent->page_id; + } + return $segments; + } } diff --git a/app/Helpers/RouteHelper.php b/app/Helpers/RouteHelper.php index 0b51d8e0..59b98063 100644 --- a/app/Helpers/RouteHelper.php +++ b/app/Helpers/RouteHelper.php @@ -2,7 +2,11 @@ namespace App\Helpers; +use App\Enums\Contact\ContactFormType; +use App\Models\DynamicPage; +use Illuminate\Routing\Route; use Uwil\LaravelCommon\Controllers\Controller; +use Mcamara\LaravelLocalization\Facades\LaravelLocalization; class RouteHelper extends Controller { @@ -17,7 +21,7 @@ class RouteHelper extends Controller * @param string|null $locale The target locale to get the route. * @return string The route URL if it exists, or "#" otherwise. */ - public static function routeNameChecker(string $routeName, string|null $locale = null): string + public static function routeNameChecker(string $routeName, mixed $locale = null): string { if (is_null($locale)) { $locale = app()->getLocale(); @@ -28,4 +32,114 @@ class RouteHelper extends Controller } return "#"; } + + /** + * Return true or false, if the passed route is actually active + * + * @param string $routeName + * @param mixed $locale + * @return boolean + */ + public static function isRouteActive(string $routeName, mixed $locale = null): bool + { + if (is_null($locale)) { + $locale = app()->getLocale(); + } + $definitiveRouteName = sprintf("$routeName.%s", $locale); + return \request()->routeIs($definitiveRouteName); + } + + /** + * Get the localized url in the langage switcher + * + * @param string $localeCode LocaleCode from LaravelLocalization::getSupportedLocales() + * @return string + */ + public static function getLocalizedUrl(string $localeCode): string + { + $route = request()->route(); + if (! $route) { + return LaravelLocalization::getLocalizedURL($localeCode); + } + return self::resolve( + self::getDynamicPageLocalizedURL($route, $localeCode), + self::getContactShowLocalizedURL($route, $localeCode), + ) ?? LaravelLocalization::getLocalizedURL($localeCode, null, [], false); + } + + /** + * Resolve the url to be returned for the localized switcher + * + * @param string|null ...$urls + * @return string|null + */ + private static function resolve(?string ...$urls): ?string + { + foreach ($urls as $url) { + if ($url !== null) { + return $url; + } + } + return null; + } + + /** + * Return the localized url for contact page show + * + * @param Route $route + * @param string $localeCode + * @return string|false|null + */ + private static function getContactShowLocalizedURL(Route $route, string $localeCode) + { + $contactPage = $route->parameter('contactPage'); + + if ($contactPage) { + $localizedUrl = LaravelLocalization::getLocalizedURL( + $localeCode, + null, + [], + false + ); + $parsed = parse_url($localizedUrl); + if (! isset($parsed['path'])) { + return $localizedUrl; + } + $segments = explode('/', trim($parsed['path'], '/')); + $currentSlug = end($segments); + + $enum = ContactFormType::fromSlug( + $currentSlug, + app()->getLocale() + ); + + if ($enum) { + $translatedSlug = $enum->slug($localeCode); + if ($translatedSlug) { + $segments[count($segments) - 1] = $translatedSlug; + return '/' . implode('/', $segments); + } + } + return $localizedUrl; + } + } + + /** + * Return the localized url for all dynamic pages + * + * @param \Illuminate\Routing\Route $route + * @param string $localeCode + * @return string|false|null + */ + private static function getDynamicPageLocalizedURL(Route $route, string $localeCode) + { + /** @var DynamicPage|null $page */ + $dynamicPage = $route->parameter('dynamicPage'); + if ($dynamicPage instanceof DynamicPage) { + $path = $dynamicPage->getLocalizedPath($localeCode); + if ($path) { + return LaravelLocalization::getLocalizedURL($localeCode, "/{$path}", [], false); + } + } + } } diff --git a/app/Http/Controllers/Front/ContactController.php b/app/Http/Controllers/Front/ContactController.php index 7902c2ae..6732d297 100644 --- a/app/Http/Controllers/Front/ContactController.php +++ b/app/Http/Controllers/Front/ContactController.php @@ -27,11 +27,9 @@ class ContactController $enumType = collect(ContactFormType::all())->first(function ($enum) use ($slug) { return $enum->slug() === $slug; }); - if (!$enumType) { return redirect()->route('front.contact.index'); } - return view('front.pages.contact.show', compact('enumType')); } diff --git a/app/Http/Controllers/Front/NewsController.php b/app/Http/Controllers/Front/NewsController.php index 6c187a9e..1be9a295 100644 --- a/app/Http/Controllers/Front/NewsController.php +++ b/app/Http/Controllers/Front/NewsController.php @@ -12,8 +12,8 @@ class NewsController extends Controller return view('front.pages.news.index'); } - public function show(News $model) + public function show(News $news) { - return view('front.pages.news.show', ['model' => $model->load('categories')]); + return view('front.pages.news.show', ['model' => $news->load('categories')]); } } diff --git a/app/Models/DynamicPage.php b/app/Models/DynamicPage.php index 4e2050e1..a6377033 100644 --- a/app/Models/DynamicPage.php +++ b/app/Models/DynamicPage.php @@ -5,11 +5,13 @@ namespace App\Models; use App\Contracts\TranslatableModel; use App\Enums\DynamicFieldTypes; use App\Enums\DynamicPages\PageStatusEnum; +use App\Helpers\DynamicPageHelper; use App\Helpers\RouteHelper; use App\Helpers\TranslationHelper; use App\Traits\Models\HasCache; use App\Traits\Models\HasTranslations; use App\Traits\Models\HasUwilImages; +use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; @@ -79,7 +81,7 @@ class DynamicPage extends Model implements TranslatableModel 'title', 'content', ]; - + /** * Relations should be included in the cache. * @@ -274,7 +276,7 @@ class DynamicPage extends Model implements TranslatableModel /** * Get the url to access a specific resource. - * + * * @param integer $id Id field of the target model. * @return string */ @@ -319,4 +321,34 @@ class DynamicPage extends Model implements TranslatableModel { return $this->belongsTo(PageConfig::class, 'config_id'); } + + /** + * Get localized path from the locale + * + * @param string $locale + * @return string|null + */ + public function getLocalizedPath(string $locale): ?string + { + $slug = $this->getTranslation('slug', $locale); + + if (! $slug) { + return null; + } + + // Récupère toutes les pages publiées (cache déjà existant chez toi) + $pages = static::getModelsCached() + ->where('status', PageStatusEnum::published) + ->load('parentPage') + ->keyBy('id'); + + $segments = DynamicPageHelper::getAllDynamicPageSegments($this, $pages, $locale); + + $segmentsPath = implode('/', $segments); + + return $segmentsPath + ? "{$segmentsPath}/{$slug}" + : $slug; + } + } diff --git a/app/Models/News.php b/app/Models/News.php index ab39b00b..60f28535 100644 --- a/app/Models/News.php +++ b/app/Models/News.php @@ -16,7 +16,8 @@ use Illuminate\Support\Str; use Illuminate\Database\Eloquent\SoftDeletes; use Uwil\LaravelActivityLogs\Traits\ActivityLog; use Illuminate\Support\Arr; -use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\App; +use Mcamara\LaravelLocalization\Interfaces\LocalizedUrlRoutable; /** * @property string $seo_title SEO title of the news. @@ -35,7 +36,7 @@ use Illuminate\Support\Facades\Cache; * @property-read \Illuminate\Support\Carbon $updated_at Date on which the news was updated. * @property-read \Illuminate\Support\Carbon $deleted_at Date on which the news was updated. */ -class News extends Model implements TranslatableModel +class News extends Model implements TranslatableModel, LocalizedUrlRoutable { use ActivityLog; use HasCache; @@ -47,6 +48,19 @@ class News extends Model implements TranslatableModel HasUwilImages::inertiaFill as traitInertiaFill; } + public function getRouteKeyName(): string + { + return 'slug'; + } + + public function getLocalizedRouteKey($locale) + { + return $this->getTranslation( + $this->getRouteKeyName(), + $locale + ); + } + /** * Champs contenant des images dynamiques à gérer. * @@ -298,4 +312,14 @@ class News extends Model implements TranslatableModel 'category_id' ); } + + + public static function getPublishedNewsInCurrentLocale() + { + $locale = App::getLocale(); + // ici mettre le cache avec la relation catégorie + return News::query() + ->with('categories') + ->whereNotNull("slug->$locale"); + } } diff --git a/app/Providers/DynamicPageRouteServiceProvider.php b/app/Providers/DynamicPageRouteServiceProvider.php index 3e7890b8..b0ded6c9 100644 --- a/app/Providers/DynamicPageRouteServiceProvider.php +++ b/app/Providers/DynamicPageRouteServiceProvider.php @@ -3,14 +3,13 @@ namespace App\Providers; use App\Enums\DynamicPages\PageStatusEnum; +use App\Helpers\DynamicPageHelper; use App\Models\DynamicPage; -use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\View; use Illuminate\Support\ServiceProvider; use Mcamara\LaravelLocalization\Facades\LaravelLocalization; -use Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRoutes; class DynamicPageRouteServiceProvider extends ServiceProvider { @@ -46,7 +45,9 @@ class DynamicPageRouteServiceProvider extends ServiceProvider // Set the prefix according to the locale. 'prefix' => $prefix, // Set custom middlewares. - 'middleware' => ['web'], + 'middleware' => [ + 'web' + ], ], function () use ($locale, $dynamicPageModels) { foreach ($dynamicPageModels as $dynamicPageModel) { $slug = $dynamicPageModel->getTranslation('slug', $locale); @@ -55,7 +56,7 @@ class DynamicPageRouteServiceProvider extends ServiceProvider if (!$slug) continue; // Retrieves the parent segments for this locale. - $segments = $this->buildFullUrlFromGroups( + $segments = DynamicPageHelper::getAllDynamicPageSegments( $dynamicPageModel, $dynamicPageModels->keyBy('id'), $locale @@ -71,7 +72,9 @@ class DynamicPageRouteServiceProvider extends ServiceProvider app()->setLocale($locale); LaravelLocalization::setLocale($locale); return view($dynamicPageModel->getView(), compact('dynamicPageModel')); - })->name("front.dynamic-pages.{$dynamicPageModel->id_key}.{$locale}"); + }) + ->defaults('dynamicPage', $dynamicPageModel) + ->name("front.dynamic-pages.{$dynamicPageModel->id_key}.{$locale}"); } }); } @@ -82,44 +85,4 @@ class DynamicPageRouteServiceProvider extends ServiceProvider View::share(sprintf("page%s", $pascalCase), $dynamicPageModel); } } - - /** - * Returns the parent segments for the locale or null if a parent does not have a slug. - * - * @param \App\Models\DynamicPage $page - * @param \Illuminate\Database\Eloquent\Collection $groupsKeyedById - * @param string $locale - * @return array|null - */ - private function buildFullUrlFromGroups(DynamicPage $page, Collection $groupsKeyedById, string $locale): ?array - { - $segments = []; - - // Start at page_id of the DynamicPage. - $parentPageId = $page->page_id ?? ($page->parentPage->id ?? null); - - // Browse all relationships. - while ($parentPageId) { - /** @var \App\Models\DynamicPage|null $parentPage */ - $parentPage = $groupsKeyedById->find($parentPageId); - - if (!$parentPage || !$parentPage->status->equals(PageStatusEnum::published)) { - return null; - } - - $slug = $parentPage->getTranslation('slug', $locale); - - if (empty($slug)) { - return null; - } - - // Save parentPage slug if it is published. - array_unshift($segments, $slug); - - // Continue to move up even if the parentPage is not published. - $parentPageId = $parentPage->page_id; - } //end while - - return $segments; - } } diff --git a/app/View/Components/Front/News/IndexNewsComponent.php b/app/View/Components/Front/News/IndexNewsComponent.php index 11306654..2c77a3ad 100644 --- a/app/View/Components/Front/News/IndexNewsComponent.php +++ b/app/View/Components/Front/News/IndexNewsComponent.php @@ -47,7 +47,7 @@ class IndexNewsComponent extends Component ->toArray(); /** @var \Illuminate\Database\Eloquent\Builder<\App\Models\News> $query */ - $query = News::query()->with('categories'); + $query = News::getPublishedNewsInCurrentLocale(); /** Sort columns with a query */ $bladeHelper->runSortQuery($query); @@ -55,9 +55,6 @@ class IndexNewsComponent extends Component /** Custom pagination */ $this->newsModels = $bladeHelper->runPaginate($query); - - - /** * Cette section est à revoir mais c'est pour coller et être iso au site actuellement en prod */ @@ -89,7 +86,7 @@ class IndexNewsComponent extends Component break; default: - $this->postContainer['load_more'] = __('front.buttons.load_more'); + $this->postContainer['load_more'] = ucfirst(__('front.buttons.see_more_news')); break; } } diff --git a/bootstrap/app.php b/bootstrap/app.php index 0e49db19..f4aae1b0 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -33,6 +33,10 @@ return Application::configure(basePath: dirname(__DIR__)) 'auth' => \Uwil\LaravelBackend\Middlewares\Authenticate::class, 'guest' => \Uwil\LaravelBackend\Middlewares\RedirectIfAuthenticated::class, 'lang' => \Uwil\LaravelBackend\Middlewares\Lang::class, + 'localeSessionRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect::class, + 'localeCookieRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleCookieRedirect::class, + 'localizationRedirect' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRedirectFilter::class, + 'localeViewPath' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationViewPath::class, ]); }) ->withExceptions(function (Exceptions $exceptions) { diff --git a/lang/en/enums.php b/lang/en/enums.php index 4c7c9cfd..2d91d003 100644 --- a/lang/en/enums.php +++ b/lang/en/enums.php @@ -38,13 +38,15 @@ return [ ], 'breeder' => [ 'label' => 'join us as a farmer', - 'slug' => 'join us as a farmer' + 'slug' => 'join-us-as-a-farmer' ], 'professional' => [ 'label' => 'a request as a professional' ], 'restauration' => [ 'label' => 'foodservice, Industry, Retailer France & Overseas', + 'slug' => 'foodservice-industry-retailer-distributor', + 'subtitle' => 'a request as a customer / retailer / distributor' ], 'export' => [ 'label' => 'other countries / Export', @@ -54,7 +56,7 @@ return [ 'label' => 'finance', 'slug' => 'finance-2' #FIXME: revoir le slug ], - 'engagements' => [ + 'commitments' => [ 'label' => 'our commitments', 'slug' => 'our-commitments-2' #FIXME: revoir le slug ], diff --git a/lang/en/front.php b/lang/en/front.php index 10bcf7c8..fea40ca0 100644 --- a/lang/en/front.php +++ b/lang/en/front.php @@ -21,8 +21,13 @@ return [ "respecter-la-terre" => "respecting the nature", "bien-nourrir" => "providing healthy food", 'search' => 'search', - "actualites" => [ + "news" => [ "index" => "news", + "read_article" => "read more", + "results" => "results", + "on_document_count" => ":current documents of :total", + "theme" => "theme", + "year" => "year", ], "finance" => "finance", 'espace-presse' => 'press space', @@ -30,7 +35,8 @@ return [ 'send' => 'send', 'back_to_contact' => 'return to choice of contact', 'see_more_news' => 'load more news', - 'see_more_docs' => 'load more documentary resources' + 'see_more_docs' => 'load more documentary resources', + "clear_filters" => "clear les filtres" ], 'contact' => [ "index" => "Contact us", @@ -108,4 +114,9 @@ return [ 'pole' => 'Pole', 'responsible' => 'Responsible', 'address' => 'Address', + "follow_us" => 'follow us', + "3_clicks" => 'I apply in 3 clicks', + "contact_details" => 'Your contact details', + 'contact_our' => 'contact our', + 'press_department' => 'press department' ]; diff --git a/lang/en/routes.php b/lang/en/routes.php new file mode 100644 index 00000000..80be7e01 --- /dev/null +++ b/lang/en/routes.php @@ -0,0 +1,7 @@ + 'contact-us/{slug}', + 'contact_index' => 'contact-us', + 'news' => 'news/{news}' +]; diff --git a/lang/fr/front.php b/lang/fr/front.php index 75d9ff74..61354488 100644 --- a/lang/fr/front.php +++ b/lang/fr/front.php @@ -23,6 +23,11 @@ return [ "bien-nourrir" => "bien nourrir", "news" => [ "index" => "actualités", + "read_article" => "lire l'article", + "results" => "résultat", + "on_document_count" => ":current documents sur :total", + "theme" => "thématique", + "year" => "année", ], "finance" => "finance", 'search' => 'rechercher', @@ -31,7 +36,8 @@ return [ 'send' => 'envoyer', 'back_to_contact' => 'retour au choix de contact', 'see_more_news' => 'voir plus d\'actualités', - 'see_more_docs' => 'voir plus de ressources documentaires' + 'see_more_docs' => 'voir plus de ressources documentaires', + "clear_filters" => "effacer les filtres" ], 'contact' => [ "index" => "Nous contacter", @@ -109,4 +115,9 @@ return [ 'pole' => 'Pôle', 'responsible' => 'Responsable', 'address' => 'Adresse', + "follow_us" => 'suivez-nous', + "3_clicks" => 'Je postule en 3 clics', + "contact_details" => 'Vos coordonnées', + 'contact_our' => 'contactez notre', + 'press_department' => 'service presse' ]; diff --git a/lang/fr/routes.php b/lang/fr/routes.php new file mode 100644 index 00000000..7592b138 --- /dev/null +++ b/lang/fr/routes.php @@ -0,0 +1,7 @@ + 'nous-contacter/{slug}', + 'contact_index' => 'nous-contacter', + 'news' => 'actualites/{news}' +]; diff --git a/resources/views/components/front/filter-posts.blade.php b/resources/views/components/front/filter-posts.blade.php index d5105ae8..8bef9bad 100644 --- a/resources/views/components/front/filter-posts.blade.php +++ b/resources/views/components/front/filter-posts.blade.php @@ -39,11 +39,11 @@ @endforeach @endif
- Résultat : + {{ ucfirst(__('front.news.results')) }} : - 0 - documents sur - 0 + + {{ ucfirst(__('front.news.on_document_count', ['current' => 0, 'total' => 10])) }} +
@@ -53,8 +53,9 @@
- ✖ Effacer - les filtres + ✖ + {{ ucfirst(__('front.buttons.clear_filters')) }}
diff --git a/resources/views/components/front/news/index-news-component.blade.php b/resources/views/components/front/news/index-news-component.blade.php index 99421749..0046fc78 100644 --- a/resources/views/components/front/news/index-news-component.blade.php +++ b/resources/views/components/front/news/index-news-component.blade.php @@ -16,11 +16,11 @@ $filters = [ [ - 'title' => 'Thématique', + 'title' => ucfirst(__('front.news.theme')), 'fields' => $categories, ], [ - 'title' => 'Année', + 'title' => ucfirst(__('front.news.year')), 'fields' => $years, ], ]; diff --git a/resources/views/components/front/news/news-next-event-component.blade.php b/resources/views/components/front/news/news-next-event-component.blade.php index 27f55be6..bfcd8754 100644 --- a/resources/views/components/front/news/news-next-event-component.blade.php +++ b/resources/views/components/front/news/news-next-event-component.blade.php @@ -12,7 +12,10 @@ - + @if (isset($pageActualites)) + + @endif diff --git a/resources/views/components/front/pages/finance/assemblees-generales.blade.php b/resources/views/components/front/pages/finance/assemblees-generales.blade.php index e5f030ad..8aa545a0 100644 --- a/resources/views/components/front/pages/finance/assemblees-generales.blade.php +++ b/resources/views/components/front/pages/finance/assemblees-generales.blade.php @@ -1,4 +1,6 @@ -
+
diff --git a/resources/views/components/front/pages/finance/bourse.blade.php b/resources/views/components/front/pages/finance/bourse.blade.php index 4199e77c..4e066533 100644 --- a/resources/views/components/front/pages/finance/bourse.blade.php +++ b/resources/views/components/front/pages/finance/bourse.blade.php @@ -5,7 +5,7 @@ @endphp @if (!empty($data)) -
+

diff --git a/resources/views/components/front/pages/finance/finance-3.blade.php b/resources/views/components/front/pages/finance/finance-3.blade.php index f82be5e0..71e11890 100644 --- a/resources/views/components/front/pages/finance/finance-3.blade.php +++ b/resources/views/components/front/pages/finance/finance-3.blade.php @@ -1,5 +1,5 @@ @if (!empty($data)) -
+
@if (!empty($data['string_title'])) @@ -126,15 +126,19 @@
- @if(!empty($rightsSection['list_section_document_list']) && !empty($rightsSection['list_section_document_list'][0]['list_documents'])) + @if ( + !empty($rightsSection['list_section_document_list']) && + !empty($rightsSection['list_section_document_list'][0]['list_documents'])) @php - $btnConfig = $rightsSection['list_section_document_list'][0]['list_document_button'][0]; + $btnConfig = + $rightsSection['list_section_document_list'][0]['list_document_button'][0]; @endphp - @foreach ($rightsSection['list_section_document_list'][0]['list_documents'] as $slide) + @foreach ($rightsSection['list_section_document_list'][0]['list_documents'] as $slide)
- Document + Document
{{ $slide['string_label'] }}
+
diff --git a/resources/views/components/front/pages/finance/finance-6.blade.php b/resources/views/components/front/pages/finance/finance-6.blade.php index bd903f1e..be309f2b 100644 --- a/resources/views/components/front/pages/finance/finance-6.blade.php +++ b/resources/views/components/front/pages/finance/finance-6.blade.php @@ -170,7 +170,7 @@ ]; @endphp -
+
diff --git a/resources/views/components/front/pages/finance/graphics.blade.php b/resources/views/components/front/pages/finance/graphics.blade.php index d834a130..f25524b6 100644 --- a/resources/views/components/front/pages/finance/graphics.blade.php +++ b/resources/views/components/front/pages/finance/graphics.blade.php @@ -18,10 +18,11 @@ ], ]; @endphp -
+
- +
@@ -33,12 +34,12 @@ @foreach ($graphs as $g)
@if (!empty($g['data']['string_label'])) -
{{ $g['data']['string_label'] }}
+
{{ $g['data']['string_label'] }}
@endif @if (!empty($g['data']['string_sub_label'])) -
-

{{ $g['data']['string_sub_label'] }} -

+
+

{{ $g['data']['string_sub_label'] }} +

@endif
@php @@ -52,7 +53,7 @@ });
- @if($g['type'] === 'list_bilan_simplify') + @if ($g['type'] === 'list_bilan_simplify')
{{ $g['data']['string_base_euros'] }}
@@ -63,4 +64,3 @@
- diff --git a/resources/views/components/front/sections/news.blade.php b/resources/views/components/front/sections/news.blade.php index 994a15fa..5790d180 100644 --- a/resources/views/components/front/sections/news.blade.php +++ b/resources/views/components/front/sections/news.blade.php @@ -30,7 +30,7 @@ url="{{ $url }}" buttonIcon="btn__icon_arrow-right" /> @else - Lire l'article + {{ ucfirst(__('front.news.read_article')) }} @endif
diff --git a/resources/views/front/layouts/footer.blade.php b/resources/views/front/layouts/footer.blade.php index 4aa236e2..fa37bf9f 100644 --- a/resources/views/front/layouts/footer.blade.php +++ b/resources/views/front/layouts/footer.blade.php @@ -67,12 +67,13 @@ @endif
  • - Nous contacter + + {{ ucfirst(__('front.contact.index')) }}
  • - + - Je postule en 3 clics + {{ ucfirst(__('front.3_clicks')) }} back-to-top diff --git a/resources/views/front/layouts/header.blade.php b/resources/views/front/layouts/header.blade.php index a786d1cc..d89f9dfa 100644 --- a/resources/views/front/layouts/header.blade.php +++ b/resources/views/front/layouts/header.blade.php @@ -1,12 +1,24 @@ +@php + function currentMenuItemClass(string $routeName) + { + return \App\Helpers\RouteHelper::isRouteActive($routeName) ? 'current-menu-item' : ''; + } +@endphp
    +