]> _ Git - psq.git/commitdiff
wait #7736 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 12 Sep 2025 16:27:05 +0000 (18:27 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 12 Sep 2025 16:27:05 +0000 (18:27 +0200)
app/Console/Kernel.php
app/Http/Controllers/FluidbookController.php
resources/views/components/cover.blade.php
resources/views/home/index.blade.php

index f8bfcabd6d35f46ac4da6eea3e9aca0a37ba3509..099c7418d62766ccedd46412d28b76d65a21c45a 100644 (file)
@@ -27,6 +27,7 @@ class Kernel extends ConsoleKernel
     {
         $schedule->job(new CheckForTrialExpirationDates)->dailyAt('13:00');
         $schedule->command('psq:fluidbook:archives')->dailyAt('04:00');
+        $schedule->command('psq:fluidbook:updatedemo')->cron('0 4 1,15 * *');
     }
 
     /**
index 99f259fc26e6d3c74a554098a262de76f6f0623a..c6bb3426cb503ae1d644d4e3afb1a64303d5caad 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace App\Http\Controllers;
 
+use A17\Twill\Repositories\SettingRepository;
 use App\AccessLog;
 use App\PdfFile;
 use Cubist\Util\Files\Files;
@@ -20,7 +21,9 @@ class FluidbookController extends Controller
      */
     public function view(PdfFile $file, string $path = '')
     {
-        $this->authorize('view', $file);
+        if (app(SettingRepository::class)->byKey('fluidbook_demo_ref') != $file->slug) {
+            $this->authorize('view', $file);
+        }
         // Add trailing slash if needed
         $request = request();
         if ($request->getPathInfo() === '/view/' . $file->slug) {
index bf43284e07f5104ed4068c225b61eccaf839c618..7313876fe3f9587e29f5998454798b0bf032c5a7 100644 (file)
@@ -1,12 +1,14 @@
 <div class="cover {{$class}}">
-    <a class="img-link cursor-pointer {{!Auth::check() ? 'notConnected' : ''}}" href="{{Auth::check() ? $link : '#'}}" target="{{$target}}">
+    <a class="img-link cursor-pointer {{!Auth::check() ? 'notConnected' : ''}}" href="{{Auth::check() ? $link : '#'}}"
+       target="{{Auth::check() ? $target : '_self'}}">
         <img class="d-block cover-over box-shadow-cover" src="{{$pdf->coverUrl}}" alt="">
         <div class="shadowcover">
-            <img class="max-h-[39px]" src="{{ @asset('img/ombre-magazine.svg') }}" />
+            <img class="max-h-[39px]" src="{{ @asset('img/ombre-magazine.svg') }}"/>
         </div>
     </a>
     <div class="cover-title text-left bg-transparent max-xs:!-mt-1">
         <p class="font-bold bg-transparent">{{$pdf->title}}</p>
-        <a href="{{Auth::check() ? $link : '#'}}" class="underline font-medium {{!Auth::check() ? 'notConnected' : ''}}">Lire cette édition</a>
+        <a target="{{Auth::check() ? $target : '_self'}}" href="{{Auth::check() ? $link : '#'}}"
+           class="underline font-medium {{!Auth::check() ? 'notConnected' : ''}}">Lire cette édition</a>
     </div>
 </div>
index 1857fb1297baef6ec7b037aacdb650d546303c4e..00a9db556a39de145599c5f039b30df33f69e4f8 100644 (file)
@@ -26,7 +26,9 @@
             {{ __('If you did not receive the email') }},
             <form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
                 @csrf
-                <button type="submit" class="btn btn-link p-0 m-0 align-baseline">{{ __('click here to request another') }}</button>.
+                <button type="submit"
+                        class="btn btn-link p-0 m-0 align-baseline">{{ __('click here to request another') }}</button>
+                .
             </form>
         </div>
     @endif
                         <div class="grid-1 gap-0">
                             <h1 class="bigtitle">{!! $settings->byKey('main_title') !!}</h1>
                             <p class="date !mt-6 xl:!mt-8">{{ ucfirst($last_pdf->first()->created_at->translatedFormat('l d F Y')) }}</p>
-                            {{-- /view/{{ $last_pdf->first()['slug'] }} --}}
-                            <a href="https://hosting.fluidbook.com/psq-1952a" class="btnorange mt-4 {{ !Auth::check() ? 'notConnected' : '' }}" target="_blank">Lire le quotidien</a>
+                            <a href="{{url('view/'.$last_pdf->first()->slug)}}"
+                               class="btnorange mt-4 {{ !Auth::check() ? 'notConnected' : '' }}" target="_blank">Lire le
+                                quotidien</a>
                         </div>
-                        <x-cover :pdf="$last_pdf->first()" type="3" linkTo="read">
+                        <x-cover :pdf="$last_pdf->first()" type="3" linkTo="read" target="_blank">
                         </x-cover>
                         <div class="grid-2">
                             <h2>{!! $settings->byKey('not_register_title') !!}</h2>
-                            <a href="{{ route('contact.subscribe') }}" class="underline font-medium">{!! $settings->byKey('not_register_link') !!}</a>
+                            <a href="{{ route('contact.subscribe') }}"
+                               class="underline font-medium">{!! $settings->byKey('not_register_link') !!}</a>
                         </div>
                     </div>
                     {{--@foreach($last_pdf->first()->headlines ?? [] as $headline)
@@ -66,8 +70,9 @@
                                 {!! $settings->byKey('text_discover_home') !!}
                             </div>
                         </div>
-                        <div class="shadowcover max-xl:absolute max-xl:w-[238px] max-xl:bottom-0 max-xl:h-3 max-xl:translate-y-full">
-                            <img class="max-xl:!h-auto" src="{{ @asset('img/ombre-magazine.svg') }}" />
+                        <div
+                            class="shadowcover max-xl:absolute max-xl:w-[238px] max-xl:bottom-0 max-xl:h-3 max-xl:translate-y-full">
+                            <img class="max-xl:!h-auto" src="{{ @asset('img/ombre-magazine.svg') }}"/>
                         </div>
                     </div>
 
@@ -84,7 +89,7 @@
                         <div class="embla__container">
                             @foreach($last_pdf as $key => $pdf)
                                 <div class="item embla__slide">
-                                    <x-cover :pdf="$pdf" type="2" linkTo="read">
+                                    <x-cover :pdf="$pdf" type="2" linkTo="read" target="_blank">
                                     </x-cover>
                                 </div>
                             @endforeach
         <div class="psq-home-section-footer flex flex-col xl:flex-row max-xl:!pb-4 p-64-0 gap-[16px] xl:gap-[64px]">
             <div class="flex flex-auto flex-col xl:flex-row">
                 <div class="thumbnail w-50">
-                    <img src="{{ @asset('img/offre_abonnement.png') }}" />
+                    <img src="{{ @asset('img/offre_abonnement.png') }}"/>
                 </div>
                 <div class="texts bg-clearblue w-50 flex flex-col justify-center">
                     <h3 class="regulartitle">{!! $settings->byKey('title_bloc_image_home') !!}</h3>
                         <p class="font-semibold !mb-3">{!! $settings->byKey('subtitle_bloc_image_home') !!}</p>
                         {!! $settings->byKey('text_bloc_image_home') !!}
                     </div>
-                    <a href="{{ route('contact.subscribe') }}" class="linkunderline">{!! $settings->byKey('not_register_link') !!}</a>
+                    <a href="{{ route('contact.subscribe') }}"
+                       class="linkunderline">{!! $settings->byKey('not_register_link') !!}</a>
                 </div>
             </div>
             <div class="w-full max-xl:h-[398px] xl:w-[384px] shrink-0 overflow-hidden bg-blue relative radius">
                 <div class="p-64 flex flex-col justify-between items-center pdf-block relative h-full z-1">
                     <h3 class="title-feuilleter regulartitle">{{ $settings->byKey('title_quotidien_home') }}</h3>
-                    {{-- /view/{{ $last_pdf->first()['slug'] }} --}}
-                    <a href="https://hosting.fluidbook.com/psq-1952a" class="btnorange fw-normal relative" target="_blank">Feuilleter un quotidien</a>
+                    <a target="_blank" href="{{url('view/'.$settings->byKey('fluidbook_demo_ref'))}}"
+                       class="btnorange fw-normal relative" target="_blank">Feuilleter un quotidien</a>
                 </div>
-                <img class="absolute max-xl:h-full xl:w-100 left-1/2 top-[45%] xl:top-[48%] -translate-1/2" src="{{ asset('/img/quotidien.jpg') }}" alt="" />
+                <img class="absolute max-xl:h-full xl:w-100 left-1/2 top-[45%] xl:top-[48%] -translate-1/2"
+                     src="{{ asset('/img/quotidien.jpg') }}" alt=""/>
             </div>
         </div>