From 65460fd9f138db91027543c58ff4c24004798593 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Sat, 13 Dec 2025 22:04:56 +0100 Subject: [PATCH] new: add a link to public article page from article and offres admin edit form --- .../views/Admin/Shop/Articles/form.blade.php | 19 +++++++++++++++++++ .../views/Admin/Shop/Offers/form.blade.php | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/resources/views/Admin/Shop/Articles/form.blade.php b/resources/views/Admin/Shop/Articles/form.blade.php index b75a92fc..f281ec0e 100644 --- a/resources/views/Admin/Shop/Articles/form.blade.php +++ b/resources/views/Admin/Shop/Articles/form.blade.php @@ -5,6 +5,25 @@ 'files' => true, ]) }} + +@php + $articlePublicUrl = null; + if (!empty($article['slug'] ?? null)) { + $articlePublicUrl = route('Shop.Articles.slug', ['slug' => $article['slug']]); + } elseif (!empty($article['id'] ?? null)) { + $articlePublicUrl = route('Shop.Articles.show', ['id' => $article['id']]); + } +@endphp + +@if ($articlePublicUrl) +
+ + Voir la page publique + + +
+@endif + @include('Admin.Shop.Articles.partials.characteristics') {{ Form::close() }} diff --git a/resources/views/Admin/Shop/Offers/form.blade.php b/resources/views/Admin/Shop/Offers/form.blade.php index a66438bf..4b367b9a 100644 --- a/resources/views/Admin/Shop/Offers/form.blade.php +++ b/resources/views/Admin/Shop/Offers/form.blade.php @@ -1,6 +1,15 @@ {{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }} +@if (($offer['id'] ?? false) && ($offer['article_id'] ?? false)) +
+ + Voir la page publique de l'article + + +
+@endif +