]> _ Git - psq.git/commitdiff
add titles
authorLouis Jeckel <louis.jeckel@outlook.cm>
Wed, 9 Sep 2020 16:19:05 +0000 (18:19 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Wed, 9 Sep 2020 16:19:05 +0000 (18:19 +0200)
13 files changed:
app/Http/Controllers/ActuLabosController.php
app/Http/Controllers/AdCampaignController.php
app/Http/Controllers/AgendaController.php
app/Http/Controllers/EnPlusController.php
app/Http/Controllers/FileController.php
app/Http/Controllers/HumeurController.php
app/Http/Controllers/MagController.php
app/Http/Controllers/SocialArticleController.php
app/Models/WeeklyAgenda.php
app/View/Components/PillBox.php
config/app.php
resources/views/en-plus/agenda/show.blade.php
resources/views/layouts/app.blade.php

index 88b8596f160c80199dd52b81e187946e0db9fe02..c5160e6c120b6795c26733de1f848dd570e86df0 100644 (file)
@@ -10,6 +10,8 @@ class ActuLabosController extends Controller
 {
     public function index()
     {
+        \View::share('title', "L'actu des Labos");
+
         \View::share('actus', LaboArticle::query()->orderBy('position')->published()->visible()->take(4)->get());
         return view('actu-labos.index');
     }
@@ -19,7 +21,9 @@ class ActuLabosController extends Controller
     {
         $actu = $repository->forSlug($slug);
 
+        \View::share('title', $actu->title);
         \View::share('actu', $actu);
+
         return view('actu-labos.show');
     }
 }
index 44fc8a1cc8dd165650cf67a9c34a5b8d4d61b8ed..bf9ef831d18a2870cf3367251c11a60e0f31fd06 100644 (file)
@@ -26,6 +26,8 @@ class AdCampaignController extends Controller
             ->published()
             ->visible()
             ->get();
+
+        \View::share('title', "Marketing & Com : Les Campagnes de la Semaine");
         \View::share('campaigns', $campaigns);
         return view('com-campaigns.index');
     }
@@ -35,6 +37,7 @@ class AdCampaignController extends Controller
     {
         $campaign = $repository->forSlug($slug);
         \View::share('campaign', $campaign);
+        \View::share('title', $campaign->title);
 
         return view('com-campaigns.show');
 
index c0a5f49daef16316d780ba7bf3485289d59e08fb..f56b6e88894ec2fe92545500d04f4c0ffe2e16c6 100644 (file)
@@ -10,6 +10,7 @@ class AgendaController extends Controller
     public function show(WeeklyAgenda $agenda)
     {
         \View::share('agenda', $agenda);
+        \View::share('title', $agenda->getFullTitle());
         return view('en-plus.agenda.show');
     }
 }
index 2199e6ad3b8577ce3d87e831c7f0febceabca220..4e3136ce335252f5c11b221a7c40a45b163b48dd 100644 (file)
@@ -13,6 +13,7 @@ class EnPlusController extends Controller
     {
         \View::share('humeur', Humeur::query()->orderByDesc('id')->firstOrFail());
         \View::share('agenda', WeeklyAgenda::query()->orderByDesc('id')->firstOrFail());
+        \View::share('title', "Agenda et Humeur");
 
         return view('en-plus.index');
     }
index 7fb41eb262c5559b41f93d56e084819a017fdd63..9cecba2767faab080424748aad4448c51a34a6d9 100644 (file)
@@ -30,6 +30,8 @@ class FileController extends Controller
     public function show(PdfFile $file)
     {
         \View::share('file', $file);
+        \View::share('title', $file->title);
+
         return view('file.show');
     }
 
index 2dd4d92fdc7e4120f448c744b921ad6e28a0879f..ee1c9ea37e833b81a85b81477db2ba4e8d017052 100644 (file)
@@ -22,7 +22,7 @@ class HumeurController extends Controller
         /** @var Humeur $article */
         $humeur = $repository->forSlug($slug);
         abort_if($humeur === null, 404);
-
+        \View::share('title', $humeur->title);
         \View::share('humeur', $humeur);
         return view('en-plus.humeurs.show');
 
index 6169564830641db4d1aecd0ab5a6d2eee4938c17..63653a9b38805054217da80ae09d90d6228efc16 100644 (file)
@@ -8,6 +8,7 @@ class MagController extends Controller
 {
     public function index()
     {
+        \View::share('title', 'Le Mag');
         return view('mag.index');
     }
 }
index 38274554c7fcffaaf9fc5cc2cb93150b140e154e..75bfdd3b29392ba66de353684b7e0e1a867611cc 100644 (file)
@@ -21,6 +21,7 @@ class SocialArticleController extends Controller
         $article->addView();
 
         \View::share('article', $article);
+        \View::share('title', $article->title);
 
         return view('social-articles.show');
     }
index dcd1cec39b9731e778af9a6893ad359fe2d6d975..97d532055697d8ee6961a5a85a028fb87839d176 100644 (file)
@@ -42,6 +42,12 @@ class WeeklyAgenda extends Model
     {
         return $this->startDateCarbon()->format('d/m/Y');
     }
+
+    public function getFullTitle()
+    {
+        return "Semaine du {$this->startDateCarbon()->format('d/m/Y')} au {$this->endDateCarbon()->format('d/m/Y')}";
+    }
+
     public function getUrlAttribute()
     {
         return route('agenda.show', ['agenda' => $this->id]);
index fc6a1a994304a3cddd2a2fb10e8f3682bff75095..5d7fbb6f9c38d87dc3dae6ee791a341c6f4fbc75 100644 (file)
@@ -23,7 +23,7 @@ class PillBox extends Component
      * @param string $link
      * @param string $content
      */
-    public function __construct(?string $slug, $object = null, $title = '', $link = '#', $content = '')
+    public function __construct($slug = null, $object = null, $title = '', $link = '#', $content = null)
     {
         /** @var PillBoxSpaceRepository $repository */
         $repository = resolve(PillBoxSpaceRepository::class);
index 65c2b35263b2a4061b77fe4dd5abf42e693cfe35..64c5f76409cd468f2a437ad08f5f9131881f6f6e 100644 (file)
@@ -13,7 +13,7 @@ return [
     |
     */
 
-    'name' => env('APP_NAME', 'Laravel'),
+    'name' => "Prescription Santé - Le Quotidien",
 
     /*
     |--------------------------------------------------------------------------
index 27a76f49e12dff2261306a53c8414f9f3b0c48c8..a60f1a7984506f4df0da2e2088da463e6bdcbac8 100644 (file)
@@ -6,7 +6,7 @@
 
         @component('components.back', ['back' => route('humeur-agenda.index')])
         @endcomponent
-        <h1>Semaine du {{$agenda->startDateCarbon()->format('d/m/Y')}} au {{$agenda->endDateCarbon()->format('d/m/Y')}}</h1>
+        <h1>{{$agenda->getFullTitle()}}</h1>
 
         <div class="row">
 
index b2d2bc3c249d1348e7eb6818663d033afc5207f8..1538f926239f53d9d525c6eab312ec63d243a67f 100644 (file)
@@ -7,7 +7,7 @@
     <!-- CSRF Token -->
     <meta name="csrf-token" content="{{ csrf_token() }}">
 
-    <title>{{ config('app.name', 'Laravel') }}</title>
+    <title>{{isset($title) ? "$title | " : ""}}{{ config('app.name', 'Laravel') }}</title>
 
     <!-- Scripts -->
     <script src="{{ asset('js/app.js') }}" defer></script>