add news page BO
This commit is contained in:
parent
98ab8ef2d3
commit
37b68ab4ec
56 changed files with 1107 additions and 321 deletions
|
|
@ -5,7 +5,7 @@ namespace App\Enums;
|
|||
use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||
|
||||
/**
|
||||
* @method static self home()
|
||||
* @method static self homeHeader()
|
||||
* @method static self marqueHeader()
|
||||
* @method static self marqueBloc2()
|
||||
* @method static self marqueBloc3()
|
||||
|
|
@ -13,7 +13,7 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
|
|||
* @method static self marqueBloc4l()
|
||||
* @method static self marqueBloc4r()
|
||||
* @method static self marqueFooter()
|
||||
* @method static self newsAdvices()
|
||||
* @method static self newsAdvice()
|
||||
* @method static self newsQuestions()
|
||||
* @method static self newsPosts()
|
||||
* @method static self newsProducts()
|
||||
|
|
@ -26,21 +26,23 @@ class Page extends BaseEnumRoutable
|
|||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'home' => 0,
|
||||
'marqueHeader' => 1,
|
||||
'marqueBloc2' => 2,
|
||||
'marqueBloc3' => 3,
|
||||
'marqueBloc4' => 4,
|
||||
'marqueBloc4l' => 5,
|
||||
'marqueBloc4r' => 6,
|
||||
'marqueFooter' => 7,
|
||||
'newsAdvices' => 8,
|
||||
'newsQuestions' => 9,
|
||||
'newsPosts' => 10,
|
||||
'newsProducts' => 11,
|
||||
'foodHeader' => 12,
|
||||
'foodBloc2' => 13,
|
||||
'foodProducts' => 14,
|
||||
'homeHeader' => 0,
|
||||
'homeProducts' => 1,
|
||||
'homeNews' => 2,
|
||||
'marqueHeader' => 3,
|
||||
'marqueBloc2' => 4,
|
||||
'marqueBloc3' => 5,
|
||||
'marqueBloc4' => 6,
|
||||
'marqueBloc4l' => 7,
|
||||
'marqueBloc4r' => 8,
|
||||
'marqueFooter' => 9,
|
||||
'newsAdvice' => 10,
|
||||
'newsQuestions' => 11,
|
||||
'newsPosts' => 12,
|
||||
'newsProducts' => 13,
|
||||
'foodHeader' => 14,
|
||||
'foodBloc2' => 15,
|
||||
'foodProducts' => 16,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use App\Http\Controllers\Controller;
|
|||
use App\Http\Requests\UpdateAdviceRequest;
|
||||
use App\Models\Advice;
|
||||
|
||||
class AdvicesController extends Controller
|
||||
class AdviceController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
|
|
@ -17,7 +17,7 @@ class AdvicesController extends Controller
|
|||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
public function edit(Advice $advice)
|
||||
{
|
||||
return view('back.advices.edit', compact('advice'));
|
||||
return view('back.advice.edit', compact('advice'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -32,11 +32,11 @@ class AdvicesController extends Controller
|
|||
$advice->fill($request->validated());
|
||||
|
||||
if (!$advice->saveOrFail()) {
|
||||
return redirect()->route('bo.advices.edit', $advice->id)
|
||||
return redirect()->route('bo.advice.edit', $advice->id)
|
||||
->with('error', trans('La modification a échoué'));
|
||||
}
|
||||
|
||||
return redirect()->route('bo.advices.edit', $advice->id)
|
||||
return redirect()->route('bo.advice.edit', $advice->id)
|
||||
->with('success', trans('Modifications enregistrées !'));
|
||||
}
|
||||
}
|
||||
126
app/Http/Controllers/Bo/PostsController.php
Normal file
126
app/Http/Controllers/Bo/PostsController.php
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\StorePostRequest;
|
||||
use App\Http\Requests\UpdatePostRequest;
|
||||
use App\Models\Post;
|
||||
use phpDocumentor\Reflection\Types\Boolean;
|
||||
|
||||
class PostsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$posts = Post::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
return view('back.posts.index', compact('posts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @param Post $post
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
public function create(Post $post)
|
||||
{
|
||||
return view('back.posts.create', compact('post'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\StorePostRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StorePostRequest $request)
|
||||
{
|
||||
$post = new Post($request->validated());
|
||||
$response = $this->changeUniquePostOnTop($post->on_top);
|
||||
|
||||
if ($response) {
|
||||
$response = $post->saveOrFail();
|
||||
}
|
||||
if (!$response) {
|
||||
return redirect()->route('bo.posts.edit', $post->id)->with('error', 'L\'actualité n\'a pas été créee');
|
||||
}
|
||||
return redirect()->route('bo.posts.edit', $post->id)->with('success', 'Actualité créée !');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param Post $post
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
public function edit(Post $post)
|
||||
{
|
||||
return view('back.posts.edit', compact('post'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\UpdatePostRequest $request
|
||||
* @param Post $post
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Post $post, UpdatePostRequest $request)
|
||||
{
|
||||
$post->fill($request->validated());
|
||||
|
||||
$response = $this->changeUniquePostOnTop($post->on_top);
|
||||
|
||||
if ($response) {
|
||||
$response = $post->saveOrFail();
|
||||
}
|
||||
if (!$response) {
|
||||
return redirect()->route('bo.posts.edit', $post->id)
|
||||
->with('error', trans('La modification a échoué'));
|
||||
}
|
||||
|
||||
return redirect()->route('bo.posts.edit', $post->id)
|
||||
->with('success', trans('Modifications enregistrées !'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param Post $post
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Post $post)
|
||||
{
|
||||
if (!$post->delete()) {
|
||||
return redirect()->route('bo.posts.index')->with('error', trans('La suppression a échoué'));
|
||||
}
|
||||
|
||||
return redirect()->route('bo.posts.index')->with('success', trans('Suppression faite avec succès'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Change on_top column to a post if necessary
|
||||
*
|
||||
* @param Boolean $isCurrentPostOnTop
|
||||
* @return Boolean response
|
||||
*/
|
||||
private function changeUniquePostOnTop(bool $isCurrentPostOnTop): bool
|
||||
{
|
||||
if ($isCurrentPostOnTop) {
|
||||
$postOnTop = Post::where('on_top', true)->first();
|
||||
if ($postOnTop) {
|
||||
$postOnTop->on_top = false;
|
||||
return $postOnTop->saveOrFail();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -27,6 +27,7 @@ class SlidesController extends Controller
|
|||
* @param Slide $slide
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
public function create(Slide $slide)
|
||||
{
|
||||
$sliders = Slider::all();
|
||||
|
|
@ -67,6 +68,7 @@ class SlidesController extends Controller
|
|||
* @param Slide $slide
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
public function edit(Slide $slide)
|
||||
{
|
||||
$sliders = Slider::all();
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ namespace App\Http\Controllers\Bo;
|
|||
|
||||
use App\Enums\Page;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\StoreTextRequest;
|
||||
use App\Models\Text;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TextsController extends Controller
|
||||
{
|
||||
|
|
@ -16,70 +16,88 @@ class TextsController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
$pictos = Text::where('page', Page::newsQuestions()->value)->get();
|
||||
$texts = Text::where('page', Page::newsQuestions()->value)->get();
|
||||
|
||||
return view('back.pictos.index', compact('pictos'));
|
||||
return view('back.texts.index', compact('texts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @param Picto $picto
|
||||
* @param Text $text
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create(Picto $picto)
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
public function create(Text $text)
|
||||
{
|
||||
return view('back.pictos.create', compact('picto'));
|
||||
return view('back.texts.create', compact('text'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\StorePictoRequest $request
|
||||
* @param \Illuminate\Http\StoreTextRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StorePictoRequest $request)
|
||||
public function store(StoreTextRequest $request)
|
||||
{
|
||||
$picto = new Picto($request->validated());
|
||||
$picto->page = Page::marqueBloc2();
|
||||
$text = new Text($request->validated());
|
||||
$text->page = Page::newsQuestions();
|
||||
|
||||
if (!$picto->saveOrFail()) {
|
||||
return redirect()->route('bo.pictos.edit', $picto->id)->with('error', 'Le pictogramme n\'a pas été crée');
|
||||
if (!$text->saveOrFail()) {
|
||||
return redirect()
|
||||
->route('bo.texts.edit', $text->id)
|
||||
->with('error', 'La question/réponse n\'a pas été crée');
|
||||
}
|
||||
return redirect()->route('bo.pictos.edit', $picto->id)->with('success', 'Pictogramme créé !');
|
||||
return redirect()
|
||||
->route('bo.texts.edit', $text->id)
|
||||
->with('success', 'Question/réponse créé !');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @param Text $text
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
public function edit(Text $text)
|
||||
{
|
||||
//
|
||||
return view('back.texts.edit', compact('text'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @param \Illuminate\Http\StoreTextRequest $request
|
||||
* @param Text $text
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
public function update(Text $text, StoreTextRequest $request)
|
||||
{
|
||||
//
|
||||
$text->fill($request->validated());
|
||||
|
||||
if (!$text->saveOrFail()) {
|
||||
return redirect()->route('bo.texts.edit', $text->id)
|
||||
->with('error', trans('La modification a échoué'));
|
||||
}
|
||||
|
||||
return redirect()->route('bo.texts.edit', $text->id)
|
||||
->with('success', trans('Modifications enregistrées !'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @param Text $text
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
public function destroy(Text $text)
|
||||
{
|
||||
//
|
||||
if (!$text->delete()) {
|
||||
return redirect()->route('bo.texts.index')->with('error', trans('La suppression a échoué'));
|
||||
}
|
||||
|
||||
return redirect()->route('bo.texts.index')->with('success', trans('Suppression faite avec succès'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,18 +2,33 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\Page;
|
||||
use App\Models\Encart;
|
||||
use App\Models\EncartArg;
|
||||
use App\Models\Slide;
|
||||
use App\Models\Slider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$slider = Slider::where('published', 1)->first();
|
||||
|
||||
return view('front.home', compact('slider'));
|
||||
if ($slider) {
|
||||
$slides = Slide::whereHas('slider', function ($q) use ($slider) {
|
||||
$q->whereId($slider->id);
|
||||
})->where(function ($q) {
|
||||
$q->where(
|
||||
function ($q) {
|
||||
$q->where('date_start', '<=', Carbon::now()->format('Y-m-d H:i:s'))
|
||||
->where('date_end', '>', Carbon::now()->format('Y-m-d H:i:s'));
|
||||
}
|
||||
)->orWhere(function ($q) {
|
||||
$q->whereNull('date_start')
|
||||
->whereNull('date_end');
|
||||
});
|
||||
})->orderBy('order', 'ASC')
|
||||
->get();
|
||||
return view('front.home', compact('slider', 'slides'));
|
||||
} else {
|
||||
return view('front.home', compact('slider'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
namespace App\Http;
|
||||
|
||||
use App\Http\Middleware\InitVarsGlobals;
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
|
|
@ -14,7 +16,6 @@ class Kernel extends HttpKernel
|
|||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Fruitcake\Cors\HandleCors::class,
|
||||
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||
|
|
@ -33,14 +34,12 @@ class Kernel extends HttpKernel
|
|||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
'throttle:api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
|
@ -63,6 +62,6 @@ class Kernel extends HttpKernel
|
|||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
|
||||
'init-vars' => InitVarsGlobals::class,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
92
app/Http/Middleware/InitVarsGlobals.php
Normal file
92
app/Http/Middleware/InitVarsGlobals.php
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Enums\Page;
|
||||
use App\Models\Advice;
|
||||
use App\Models\Encart;
|
||||
use App\Models\Picto;
|
||||
use App\Models\PictoBrand;
|
||||
use App\Models\Post;
|
||||
use App\Models\Text;
|
||||
use App\Models\Title;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class InitVarsGlobals
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$encart_home = Encart::where('page', Page::homeHeader()->value)->first();
|
||||
$encart_marqueHeader = Encart::where('page', Page::marqueHeader()->value)->first();
|
||||
$encart_marqueBloc2 = Encart::where('page', Page::marqueBloc2()->value)->first();
|
||||
$encart_marqueBloc3 = Encart::where('page', Page::marqueBloc3()->value)->first();
|
||||
$encart_marqueBloc4l = Encart::where('page', Page::marqueBloc4l()->value)->first();
|
||||
$encart_marqueBloc4r = Encart::where('page', Page::marqueBloc4r()->value)->first();
|
||||
$encart_marqueFooter = Encart::where('page', Page::marqueFooter()->value)->first();
|
||||
$encart_food = Encart::where('page', Page::foodHeader()->value)->first();
|
||||
|
||||
$pictobrands_marque = PictoBrand::all();
|
||||
|
||||
$advice_news = Advice::all()->first();
|
||||
|
||||
$posts = Post::where([
|
||||
['date_start', '<=', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['date_end', '>', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
])
|
||||
->orderBy('created_at', 'DESC')
|
||||
->get();
|
||||
$post_home = Post::where([
|
||||
['date_start', '<=', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['date_end', '>', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['on_top', true]
|
||||
])->first();
|
||||
|
||||
$pictos_marqueBloc2 = Picto::where('page', Page::marqueBloc2()->value)->get();
|
||||
$pictos_food = Picto::where('page', Page::foodBloc2()->value)->get();
|
||||
|
||||
$texts_news = Text::where('page', Page::newsQuestions()->value)->get();
|
||||
|
||||
$title_marqueBloc2 = Title::where('page', Page::marqueBloc2()->value)->first();
|
||||
$title_marqueBloc4 = Title::where('page', Page::marqueBloc4()->value)->first();
|
||||
$title_foodBloc2 = Title::where('page', Page::foodBloc2()->value)->first();
|
||||
$title_newsPosts = Title::where('page', Page::newsPosts()->value)->first();
|
||||
|
||||
View::share('encart_home', $encart_home);
|
||||
View::share('encart_marqueHeader', $encart_marqueHeader);
|
||||
View::share('encart_marqueBloc2', $encart_marqueBloc2);
|
||||
View::share('encart_marqueBloc3', $encart_marqueBloc3);
|
||||
View::share('encart_marqueBloc4l', $encart_marqueBloc4l);
|
||||
View::share('encart_marqueBloc4r', $encart_marqueBloc4r);
|
||||
View::share('encart_marqueFooter', $encart_marqueFooter);
|
||||
View::share('encart_food', $encart_food);
|
||||
|
||||
View::share('pictobrands_marque', $pictobrands_marque);
|
||||
|
||||
View::share('post_home', $post_home);
|
||||
View::share('posts', $posts);
|
||||
|
||||
View::share('advice_news', $advice_news);
|
||||
|
||||
View::share('pictos_marqueBloc2', $pictos_marqueBloc2);
|
||||
View::share('pictos_food', $pictos_food);
|
||||
|
||||
View::share('texts_news', $texts_news);
|
||||
|
||||
View::share('title_marqueBloc2', $title_marqueBloc2);
|
||||
View::share('title_marqueBloc4', $title_marqueBloc4);
|
||||
View::share('title_foodBloc2', $title_foodBloc2);
|
||||
View::share('title_newsPosts', $title_newsPosts);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||
|
||||
class TrustHosts extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the host patterns that should be trusted.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function hosts()
|
||||
{
|
||||
return [
|
||||
$this->allSubdomainsOfApplicationUrl(),
|
||||
];
|
||||
}
|
||||
}
|
||||
59
app/Http/Requests/StorePostRequest.php
Normal file
59
app/Http/Requests/StorePostRequest.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Carbon\Exceptions\InvalidFormatException;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class StorePostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
try {
|
||||
$this->merge([
|
||||
'date_start' => Carbon::parse("$this->date_start_date $this->date_start_time:00")->toDateTimeString(),
|
||||
'date_end' => Carbon::parse("$this->date_end_date $this->date_end_time:00")->toDateTimeString(),
|
||||
'on_top' => $this->on_top ? true : false,
|
||||
]);
|
||||
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
|
||||
} catch (InvalidFormatException $e) {
|
||||
// On fait rien
|
||||
}
|
||||
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'picture_news' => 'required|image|mimes:jpeg,png,jpg|max:1024|dimensions:max_width=380,max_height=298',
|
||||
'title' => 'required|max:255',
|
||||
'text' => 'required|min:20',
|
||||
'date_start' => [
|
||||
'required',
|
||||
'date_format:Y-m-d H:i:s',
|
||||
'before:' . Carbon::now()->parse('2037-12-31'),
|
||||
'after:' . Carbon::now()->format('Y-m-d')
|
||||
],
|
||||
'date_end' => [
|
||||
'required',
|
||||
'date_format:Y-m-d H:i:s',
|
||||
'after:date_start',
|
||||
'before:' . Carbon::now()->parse('2037-12-31')
|
||||
],
|
||||
'picture_home' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:max_width=1030,max_height=239',
|
||||
'on_top' => 'nullable|boolean',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -27,10 +27,8 @@ class StoreSlideRequest extends FormRequest
|
|||
$this->merge([
|
||||
'link_new_tab' => $this->link_new_tab ? true : false
|
||||
]);
|
||||
if (auth()->check()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -57,7 +55,7 @@ class StoreSlideRequest extends FormRequest
|
|||
'date_end' => [
|
||||
'nullable',
|
||||
'date_format:Y-m-d H:i:s',
|
||||
'after:date_start_date',
|
||||
'after:date_start',
|
||||
'before:' . Carbon::now()->parse('2037-12-31')
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ class UpdateAdviceRequest extends FormRequest
|
|||
return [
|
||||
'title1' => 'required|max:50',
|
||||
'title2' => 'required|max:50',
|
||||
'picture1' => 'required|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284',
|
||||
'picture2' => 'required|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284',
|
||||
'picture3' => 'required|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284',
|
||||
'picture1' => 'sometimes|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284',
|
||||
'picture2' => 'sometimes|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284',
|
||||
'picture3' => 'sometimes|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284',
|
||||
'text1' => 'required|max:2047',
|
||||
'text2' => 'required|max:2047',
|
||||
];
|
||||
|
|
|
|||
34
app/Http/Requests/UpdatePostRequest.php
Normal file
34
app/Http/Requests/UpdatePostRequest.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
class UpdatePostRequest extends StorePostRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return array_merge(
|
||||
parent::rules(),
|
||||
[
|
||||
'picture_news' => [
|
||||
'sometimes',
|
||||
'image',
|
||||
'mimes:jpeg,png,jpg',
|
||||
'max:1024',
|
||||
'dimensions:max_width=380,max_height=298'
|
||||
],
|
||||
'picture_home' => [
|
||||
'sometimes',
|
||||
'image',
|
||||
'mimes:jpeg,png,jpg',
|
||||
'max:2048',
|
||||
'dimensions:max_width=1030,max_height=239'
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
54
app/Models/Post.php
Normal file
54
app/Models/Post.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Lib\Utils;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Post extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'date_start' => 'datetime',
|
||||
'date_end' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'text',
|
||||
'picture_home',
|
||||
'picture_news',
|
||||
'date_start',
|
||||
'date_end',
|
||||
'on_top'
|
||||
];
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
static::creating(function (Post $post) {
|
||||
if ($post->picture_home) {
|
||||
$post->picture_home = Utils::storeImage($post->picture_home, $post->getTable());
|
||||
}
|
||||
if ($post->picture_news) {
|
||||
$post->picture_news = Utils::storeImage($post->picture_news, $post->getTable());
|
||||
}
|
||||
});
|
||||
|
||||
static::updating(function (Post $post) {
|
||||
if ($post->picture_home) {
|
||||
$post->picture_home = Utils::storeImage($post->picture_home, $post->getTable());
|
||||
}
|
||||
if ($post->picture_news) {
|
||||
$post->picture_news = Utils::storeImage($post->picture_news, $post->getTable());
|
||||
}
|
||||
});
|
||||
parent::boot();
|
||||
}
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ class Slide extends Model
|
|||
'link_new_tab',
|
||||
'slider_id',
|
||||
'picture',
|
||||
'alt_text_picture',
|
||||
'date_start',
|
||||
'date_end'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,13 +2,6 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Enums\Page;
|
||||
use App\Models\Advice;
|
||||
use App\Models\Encart;
|
||||
use App\Models\Picto;
|
||||
use App\Models\PictoBrand;
|
||||
use App\Models\Title;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
|
|
@ -30,46 +23,6 @@ class AppServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
// $encart_home = Encart::where('page', Page::home()->value)->first();
|
||||
// $encart_marqueHeader = Encart::where('page', Page::marqueHeader()->value)->first();
|
||||
// $encart_marqueBloc2 = Encart::where('page', Page::marqueBloc2()->value)->first();
|
||||
// $encart_marqueBloc3 = Encart::where('page', Page::marqueBloc3()->value)->first();
|
||||
// $encart_marqueBloc4l = Encart::where('page', Page::marqueBloc4l()->value)->first();
|
||||
// $encart_marqueBloc4r = Encart::where('page', Page::marqueBloc4r()->value)->first();
|
||||
// $encart_marqueFooter = Encart::where('page', Page::marqueFooter()->value)->first();
|
||||
// $encart_food = Encart::where('page', Page::foodHeader()->value)->first();
|
||||
|
||||
// $pictobrands_marque = PictoBrand::all();
|
||||
|
||||
// $advices_news = Advice::all()->first();
|
||||
|
||||
// $pictos_marqueBloc2 = Picto::where('page', Page::marqueBloc2()->value)->get();
|
||||
// $pictos_food = Picto::where('page', Page::foodBloc2()->value)->get();
|
||||
|
||||
// $title_marqueBloc2 = Title::where('page', Page::marqueBloc2()->value)->first();
|
||||
// $title_marqueBloc4 = Title::where('page', Page::marqueBloc4()->value)->first();
|
||||
// $title_foodBloc2 = Title::where('page', Page::foodBloc2()->value)->first();
|
||||
// $title_newsPosts = Title::where('page', Page::newsPosts()->value)->first();
|
||||
|
||||
// View::share('encart_home', $encart_home);
|
||||
// View::share('encart_marqueHeader', $encart_marqueHeader);
|
||||
// View::share('encart_marqueBloc2', $encart_marqueBloc2);
|
||||
// View::share('encart_marqueBloc3', $encart_marqueBloc3);
|
||||
// View::share('encart_marqueBloc4l', $encart_marqueBloc4l);
|
||||
// View::share('encart_marqueBloc4r', $encart_marqueBloc4r);
|
||||
// View::share('encart_marqueFooter', $encart_marqueFooter);
|
||||
// View::share('encart_food', $encart_food);
|
||||
|
||||
// View::share('pictobrands_marque', $pictobrands_marque);
|
||||
|
||||
// View::share('advices_news', $advices_news);
|
||||
|
||||
// View::share('pictos_marqueBloc2', $pictos_marqueBloc2);
|
||||
// View::share('pictos_food', $pictos_food);
|
||||
|
||||
// View::share('title_marqueBloc2', $title_marqueBloc2);
|
||||
// View::share('title_marqueBloc4', $title_marqueBloc4);
|
||||
// View::share('title_foodBloc2', $title_foodBloc2);
|
||||
// View::share('title_newsPosts', $title_newsPosts);
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,4 +22,9 @@ return [
|
|||
'advice_image_maxwidth' => '284',
|
||||
'advice_image_maxheight' => '284',
|
||||
|
||||
'post_home_image_maxwidth' => '1030',
|
||||
'post_home_image_maxheight' => '239',
|
||||
'post_news_image_maxwidth' => '380',
|
||||
'post_news_image_maxheight' => '298',
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ class AdviceFactory extends Factory
|
|||
public function definition()
|
||||
{
|
||||
return [
|
||||
'title1' => $this->faker->text(20),
|
||||
'title2' => $this->faker->text(20),
|
||||
'title1' => $this->faker->text(40),
|
||||
'title2' => $this->faker->text(40),
|
||||
'picture1' => new SplFileInfo(resource_path('assets/images/repas.jpg')),
|
||||
'picture2' => new SplFileInfo(resource_path('assets/images/repas.jpg')),
|
||||
'picture3' => new SplFileInfo(resource_path('assets/images/repas.jpg')),
|
||||
|
|
|
|||
28
database/factories/PostFactory.php
Normal file
28
database/factories/PostFactory.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
use SplFileInfo;
|
||||
|
||||
class PostFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'title' => $this->faker->text(5),
|
||||
'text' => $this->faker->paragraph(10, false),
|
||||
'picture_home' => new SplFileInfo(resource_path('assets/images/burger-fond.jpg')),
|
||||
'picture_news' => new SplFileInfo(resource_path('assets/images/burger.jpg')),
|
||||
'date_start' => Carbon::now(),
|
||||
'date_end' => Carbon::now()->addDays(2),
|
||||
'on_top' => false
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -32,7 +32,8 @@ class SlideFactory extends Factory
|
|||
'link_new_tab' => rand(0, 1),
|
||||
'date_start' => Carbon::now(),
|
||||
'date_end' => Carbon::now()->addDays(2),
|
||||
'picture' => new SplFileInfo(resource_path('assets/images/image-sample.jpg'))
|
||||
'picture' => new SplFileInfo(resource_path('assets/images/image-sample.jpg')),
|
||||
'alt_text_picture' => $this->faker->sentence(10),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class SliderFactory extends Factory
|
|||
'label' => $label,
|
||||
'slug' => Str::slug($label),
|
||||
'commentaire' => $this->faker->realText(50),
|
||||
'published' => 1
|
||||
'published' => false
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class CreateSlidersTable extends Migration
|
|||
$table->string('label');
|
||||
$table->string('slug')->unique();
|
||||
$table->string('commentaire')->nullable();
|
||||
$table->boolean('published')->nullable();
|
||||
$table->boolean('published')->default(false);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class CreateSlidesTable extends Migration
|
|||
$table->string('title');
|
||||
$table->text('text')->nullable();
|
||||
$table->string('picture')->nullable();
|
||||
$table->string('alt_text_picture')->nullable();
|
||||
$table->string('link_label')->nullable();
|
||||
$table->string('link')->nullable();
|
||||
$table->boolean('link_new_tab')->default(false);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAdvicesTable extends Migration
|
||||
class CreateAdviceTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
|
@ -13,7 +13,7 @@ class CreateAdvicesTable extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('advices', function (Blueprint $table) {
|
||||
Schema::create('advice', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title1');
|
||||
$table->string('title2');
|
||||
|
|
@ -33,6 +33,6 @@ class CreateAdvicesTable extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('advices');
|
||||
Schema::dropIfExists('advice');
|
||||
}
|
||||
}
|
||||
38
database/migrations/2021_12_16_131639_create_posts_table.php
Normal file
38
database/migrations/2021_12_16_131639_create_posts_table.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePostsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('posts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title');
|
||||
$table->mediumText('text');
|
||||
$table->string('picture_home')->nullable();
|
||||
$table->string('picture_news')->nullable();
|
||||
$table->timestamp('date_start')->nullable();
|
||||
$table->timestamp('date_end')->nullable();
|
||||
$table->boolean('on_top')->default(false);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('posts');
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ namespace Database\Seeders;
|
|||
use App\Models\Advice;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AdvicesSeeder extends Seeder
|
||||
class AdviceSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
|
|
@ -22,7 +22,8 @@ class DatabaseSeeder extends Seeder
|
|||
PictoBrandsSeeder::class,
|
||||
TitlesSeeder::class,
|
||||
TextsSeeder::class,
|
||||
AdvicesSeeder::class,
|
||||
AdviceSeeder::class,
|
||||
PostsSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class EncartsSeeder extends Seeder
|
|||
public function run()
|
||||
{
|
||||
$tabEncarts = [
|
||||
Page::home(),
|
||||
Page::homeHeader(),
|
||||
Page::marqueHeader(),
|
||||
Page::marqueBloc4l(),
|
||||
Page::marqueBloc4r(),
|
||||
|
|
|
|||
19
database/seeders/PostsSeeder.php
Normal file
19
database/seeders/PostsSeeder.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Post;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PostsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Post::factory(3)->create();
|
||||
}
|
||||
}
|
||||
16
public/css/preload-back.css
vendored
16
public/css/preload-back.css
vendored
|
|
@ -16,6 +16,22 @@
|
|||
text-align:center;
|
||||
}
|
||||
|
||||
.wdt11{
|
||||
width:11%;
|
||||
}
|
||||
|
||||
.wdt25{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
.wdt50{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.wdt75{
|
||||
width:75%;
|
||||
}
|
||||
|
||||
#sidebarTop{
|
||||
height:3rem;
|
||||
}
|
||||
|
|
|
|||
16
public/css/preload-front.css
vendored
16
public/css/preload-front.css
vendored
|
|
@ -333,6 +333,10 @@ ul.infos span{
|
|||
}
|
||||
|
||||
@media screen and (min-width: 800px){
|
||||
.is-flex .w25{
|
||||
flex-basis:25%;
|
||||
}
|
||||
|
||||
.is-flex .w50{
|
||||
flex-basis:50%;
|
||||
}
|
||||
|
|
@ -1351,6 +1355,10 @@ input[type=text]{
|
|||
max-width:32%;
|
||||
}
|
||||
|
||||
.posts-list{
|
||||
align-items:initial;
|
||||
}
|
||||
|
||||
.gamme-card{
|
||||
width:32%;
|
||||
max-width:32%;
|
||||
|
|
@ -2034,6 +2042,10 @@ input[type=text]{
|
|||
line-height:1.5;
|
||||
}
|
||||
|
||||
.advice-img{
|
||||
min-width:270px;
|
||||
}
|
||||
|
||||
.blue header{
|
||||
background-color:#222f5c;
|
||||
}
|
||||
|
|
@ -2179,6 +2191,10 @@ input[type=text]{
|
|||
margin-top:180px;
|
||||
}
|
||||
|
||||
.desk-mr10{
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
.desk-mr18{
|
||||
margin-right:80px;
|
||||
}
|
||||
|
|
|
|||
13
resources/sass/_classes.scss
vendored
13
resources/sass/_classes.scss
vendored
|
|
@ -15,3 +15,16 @@
|
|||
background-color: #eeeeee !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wdt11 {
|
||||
width: 11%;
|
||||
}
|
||||
.wdt25 {
|
||||
width: 25%;
|
||||
}
|
||||
.wdt50 {
|
||||
width: 50%;
|
||||
}
|
||||
.wdt75 {
|
||||
width: 75%;
|
||||
}
|
||||
|
|
|
|||
7
resources/sass/frontend/_custom.scss
vendored
7
resources/sass/frontend/_custom.scss
vendored
|
|
@ -157,7 +157,9 @@
|
|||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.advice-img {
|
||||
min-width: 270px;
|
||||
}
|
||||
// .plan:before {
|
||||
// content: url("~@/images/icon-plan.png");
|
||||
// position: absolute;
|
||||
|
|
@ -342,6 +344,9 @@
|
|||
.desk-mt180 {
|
||||
margin-top: 180px;
|
||||
}
|
||||
.desk-mr10 {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.desk-mr18 {
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
|
|
|||
3
resources/sass/frontend/_list.scss
vendored
3
resources/sass/frontend/_list.scss
vendored
|
|
@ -259,6 +259,9 @@
|
|||
width: 32%;
|
||||
max-width: 32%;
|
||||
}
|
||||
.posts-list {
|
||||
align-items: initial;
|
||||
}
|
||||
|
||||
.gamme-card {
|
||||
width: 32%;
|
||||
|
|
|
|||
3
resources/sass/frontend/_utils.scss
vendored
3
resources/sass/frontend/_utils.scss
vendored
|
|
@ -70,6 +70,9 @@
|
|||
}
|
||||
|
||||
@media screen and (min-width: 800px) {
|
||||
.is-flex .w25 {
|
||||
flex-basis: 25%;
|
||||
}
|
||||
.is-flex .w50 {
|
||||
flex-basis: 50%;
|
||||
&:nth-child(2) {
|
||||
|
|
|
|||
71
resources/views/back/advice/edit.blade.php
Normal file
71
resources/views/back/advice/edit.blade.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
@extends('layouts.backend')
|
||||
|
||||
@section('content')
|
||||
<form action="{{route('bo.advice.update', $advice->id)}}" method="POST" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2"><a href="{{route('bo.home')}}" class="h2 text-decoration-none">
|
||||
< </a> {{ __('Présentation') }} <small class="text-muted">{{ __('Edition') }}</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
// dd($advice->page->equals(\App\Enums\Page::marqueHeader()), \App\Enums\Page::toArray()); exit;
|
||||
// dd($advice->page->equals(\App\Enums\Page::marqueHeader()), \App\Enums\Page::toValues()); exit;
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label for="picture1">{{ __('Image') }} *<small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('bo.advice_image_maxwidth') }} px par {{ Config::get('bo.advice_image_maxheight') }} px</small></label><br/>
|
||||
<input type="file" id="picture1" name="picture1" accept="image/png, image/jpeg">
|
||||
@if ($advice->picture1 !== null)
|
||||
<br />
|
||||
<br />
|
||||
<img src="{{$advice->picture1}}" alt="{{$advice->title1}}" style="max-height: 100px;">
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture1'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="title1">{{ __('Titre 1er bloc') }} *</label>
|
||||
<input type="text" id="title1" name="title1" class="form-control" placeholder="{{ __('Titre 1er bloc') }} *" value="{{ old('title1', $advice->title1 ?? '') }}" required>
|
||||
@include('back.modules.input-error', ['inputName'=>'title1'])
|
||||
</div>
|
||||
<div class="form-group mb-5">
|
||||
<label for="text1">{{ __('Texte 1er bloc') }} *</label>
|
||||
<textarea class="form-control" id="text1" name="text1" placeholder="{{ __('Texte 1er bloc') }}" style="height: 300px; width: 50%;" required>{{ old('text1', $advice->text1) }}</textarea>
|
||||
@include('back.modules.input-error', ['inputName'=>'text1'])
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="form-group me-5">
|
||||
<label for="picture2">{{ __('Image') }} *<small class="text-muted">- JPEG/PNG, 1Mo max. Dimensions {{ Config::get('bo.advice_image_maxwidth') }} px par {{ Config::get('bo.advice_image_maxheight') }} px</small></label><br/>
|
||||
<input type="file" id="picture2" name="picture2" accept="image/png, image/jpeg">
|
||||
@if ($advice->picture2 !== null)
|
||||
<br />
|
||||
<br />
|
||||
<img src="{{$advice->picture2}}" alt="{{$advice->title2}}" style="max-height: 100px;">
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture2'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="picture3">{{ __('Image') }} *<small class="text-muted">- JPEG/PNG, 1Mo max. Dimensions {{ Config::get('bo.advice_image_maxwidth') }} px par {{ Config::get('bo.advice_image_maxheight') }} px</small></label><br/>
|
||||
<input type="file" id="picture3" name="picture3" accept="image/png, image/jpeg">
|
||||
@if ($advice->picture3 !== null)
|
||||
<br />
|
||||
<br />
|
||||
<img src="{{$advice->picture3}}" alt="{{$advice->title3}}" style="max-height: 100px;">
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture3'])
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="title2">{{ __('Titre 2ème bloc') }} *</label>
|
||||
<input type="text" id="title2" name="title2" class="form-control" placeholder="{{ __('Titre 2ème bloc') }} *" value="{{ old('title2', $advice->title2 ?? '') }}" required>
|
||||
@include('back.modules.input-error', ['inputName'=>'title2'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="text2">{{ __('Texte 2ème bloc') }} *</label>
|
||||
<textarea class="form-control" id="text2" name="text2" placeholder="{{ __('Texte 2ème bloc') }}" style="height: 300px; width: 50%;" required>{{ old('text2', $advice->text2) }}</textarea>
|
||||
@include('back.modules.input-error', ['inputName'=>'text2'])
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
|
@ -4,8 +4,9 @@
|
|||
<form action="{{route('bo.pictos.store')}}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2"><a href="{{route('bo.pictos.index')}}" class="h2 text-decoration-none">
|
||||
< </a> {{ __('Pictogrammes') }} <small class="text-muted">{{ __('Création') }}</small></h1>
|
||||
<h1 class="h2">
|
||||
<a href="{{route('bo.home')}}" class="h2 text-decoration-none"> < </a>
|
||||
{{ __('Pictogrammes') }} <small class="text-muted">{{ __('Création') }}</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@
|
|||
@csrf
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">
|
||||
{{-- <a href="{{route('bo.pictos.index')}}" class="h2 text-decoration-none">
|
||||
< </a> --}}
|
||||
{{ __('Pictogramme') }} <small class="text-muted">{{ __('Edition') }}</small></h1>
|
||||
<a href="{{route('bo.home')}}" class="h2 text-decoration-none"> < </a>
|
||||
{{ __('Pictogramme') }} <small class="text-muted">{{ __('Edition') }}</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="d-flex">
|
||||
<div class="forms-group">
|
||||
<div class="form-group mb-4">
|
||||
<label for="picture">{{ __('Image') }} <small class="text-muted">- PNG, 500Ko max. Dimensions maximum {{ Config::get('bo.picto_image_maxwidth') }} px par {{ Config::get('bo.picto_image_maxheight') }} px</small></label></br>
|
||||
<label for="picture">{{ __('Image') }} <small class="text-muted">- PNG, 500Ko max. Dimensions maximum {{ Config::get('bo.picto_image_maxwidth') }} px par {{ Config::get('bo.picto_image_maxheight') }} px</small></label><br/>
|
||||
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg">
|
||||
@if ($picto->picture !== null)
|
||||
<br />
|
||||
|
|
|
|||
66
resources/views/back/posts/create.blade.php
Normal file
66
resources/views/back/posts/create.blade.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
@extends('layouts.backend')
|
||||
|
||||
@section('content')
|
||||
<form action="{{route('bo.posts.store')}}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2"><a href="{{route('bo.posts.index')}}" class="h2 text-decoration-none">
|
||||
< </a>{{ __('Actualité') }} <small class="text-muted">{{ __('Création') }}</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('back.posts.form-inputs')
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
var editorConfig = {
|
||||
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
|
||||
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo'],
|
||||
heading: {
|
||||
options: [{
|
||||
model: 'paragraph',
|
||||
title: 'Paragraph',
|
||||
class: 'ck-heading_paragraph'
|
||||
},
|
||||
{
|
||||
model: 'heading1',
|
||||
view: 'h1',
|
||||
title: 'Heading 1',
|
||||
class: 'ck-heading_heading1'
|
||||
},
|
||||
{
|
||||
model: 'heading2',
|
||||
view: 'h2',
|
||||
title: 'Heading 2',
|
||||
class: 'ck-heading_heading2'
|
||||
},
|
||||
{
|
||||
model: 'heading3',
|
||||
view: 'h3',
|
||||
title: 'Heading 3',
|
||||
class: 'ck-heading_heading3'
|
||||
},
|
||||
{
|
||||
model: 'heading4',
|
||||
view: 'h4',
|
||||
title: 'Heading 4',
|
||||
class: 'ck-heading_heading4'
|
||||
}
|
||||
]
|
||||
},
|
||||
table: {
|
||||
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells']
|
||||
}
|
||||
};
|
||||
ClassicEditor
|
||||
.create(document.querySelector('#text'), editorConfig)
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
|
@ -1,69 +1,17 @@
|
|||
@extends('layouts.backend')
|
||||
|
||||
@section('content')
|
||||
<form action="{{route('bo.advices.update', $advice->id)}}" method="POST" enctype="multipart/form-data">
|
||||
|
||||
<form action="{{route('bo.posts.update', $post->id)}}" method="POST" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2"><a href="{{route('bo.home')}}" class="h2 text-decoration-none">
|
||||
< </a> {{ __('Présentation') }} <small class="text-muted">{{ __('Edition') }}</small></h1>
|
||||
<h1 class="h2"><a href="{{route('bo.posts.index')}}" class="h2 text-decoration-none">
|
||||
< </a>{{ __('Actualité') }} <small class="text-muted">{{ __('Edition') }}</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
// dd($advice->page->equals(\App\Enums\Page::marqueHeader()), \App\Enums\Page::toArray()); exit;
|
||||
// dd($advice->page->equals(\App\Enums\Page::marqueHeader()), \App\Enums\Page::toValues()); exit;
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label for="title1">{{ __('Titre 1er bloc') }} *</label>
|
||||
<input type="text" id="title1" name="title1" class="form-control" placeholder="{{ __('Titre 1er bloc') }} *" value="{{ old('title1', $advice->title1 ?? '') }}" required>
|
||||
@include('back.modules.input-error', ['inputName'=>'title1'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="text1">{{ __('Texte 1er bloc') }}</label>
|
||||
<textarea class="form-control" id="text1" name="text1" placeholder="{{ __('Texte 1er bloc') }}" style="height: 300px; width: 50%;">{{ old('text1', $advice->text1) }}</textarea>
|
||||
@include('back.modules.input-error', ['inputName'=>'text1'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="picture1">{{ __('Image') }} <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('bo.advice_image_maxwidth') }} px par {{ Config::get('bo.advice_image_maxheight') }} px</small></label><br/>
|
||||
<input type="file" id="picture1" name="picture1" accept="image/png, image/jpeg">
|
||||
@if ($advice->picture1 !== null)
|
||||
<br />
|
||||
<br />
|
||||
<img src="{{$advice->picture1}}" alt="{{$advice->title1}}" style="max-height: 100px;">
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture1'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="title1">{{ __('Titre 1er bloc') }} *</label>
|
||||
<input type="text" id="title1" name="title1" class="form-control" placeholder="{{ __('Titre 1er bloc') }} *" value="{{ old('title1', $advice->title1 ?? '') }}" required>
|
||||
@include('back.modules.input-error', ['inputName'=>'title1'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="text1">{{ __('Texte 1er bloc') }}</label>
|
||||
<textarea class="form-control" id="text1" name="text1" placeholder="{{ __('Texte 1er bloc') }}" style="height: 300px; width: 50%;">{{ old('text1', $advice->text1) }}</textarea>
|
||||
@include('back.modules.input-error', ['inputName'=>'text1'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="picture2">{{ __('Image') }} <small class="text-muted">- JPEG/PNG, 1Mo max. Dimensions {{ Config::get('bo.advice_image_maxwidth') }} px par {{ Config::get('bo.advice_image_maxheight') }} px</small></label><br/>
|
||||
<input type="file" id="picture2" name="picture2" accept="image/png, image/jpeg">
|
||||
@if ($advice->picture2 !== null)
|
||||
<br />
|
||||
<br />
|
||||
<img src="{{$advice->picture2}}" alt="{{$advice->title2}}" style="max-height: 100px;">
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture2'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="picture3">{{ __('Image') }} <small class="text-muted">- JPEG/PNG, 1Mo max. Dimensions {{ Config::get('bo.advice_image_maxwidth') }} px par {{ Config::get('bo.advice_image_maxheight') }} px</small></label><br/>
|
||||
<input type="file" id="picture3" name="picture3" accept="image/png, image/jpeg">
|
||||
@if ($advice->picture3 !== null)
|
||||
<br />
|
||||
<br />
|
||||
<img src="{{$advice->picture3}}" alt="{{$advice->title3}}" style="max-height: 100px;">
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture3'])
|
||||
</div>
|
||||
@include('back.posts.form-inputs')
|
||||
</form>
|
||||
@endsection
|
||||
|
|
|
|||
79
resources/views/back/posts/form-inputs.blade.php
Normal file
79
resources/views/back/posts/form-inputs.blade.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
|
||||
<h2><small class="text-muted">{{ __('Contenu du post') }}</small></h2>
|
||||
</div>
|
||||
<div class="forms-group mb-4 border border-1 border-secondary rounded-2 p-3 bg-light wdt50">
|
||||
<div class="form-group mb-4">
|
||||
<label for="picture_news">{{ __('Image du post') }} <small class="text-muted">- JPEG/PNG, 1Mo max. Dimensions maximum {{ Config::get('bo.post_news_image_maxwidth') }} px par {{ Config::get('bo.post_news_image_maxheight') }} px</small></label><br/>
|
||||
@if ($post->picture_news !== null)
|
||||
<input type="file" id="picture_news" name="picture_news" accept="image/png, image/jpeg">
|
||||
<br/>
|
||||
<br/>
|
||||
<img src="{{$post->picture_news}}" alt="{{$post->title}}" style="max-height: 100px;">
|
||||
@else
|
||||
<input type="file" id="picture_news" name="picture_news" accept="image/png, image/jpeg" required>
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture_news'])
|
||||
</div>
|
||||
<div class="form-group wdt75 mb-4">
|
||||
<label for="title">{{ __('Titre') }} *</label>
|
||||
<input type="text" id="title" name="title" class="form-control" placeholder="{{ __('Titre') }} *" value="{{ old('title', $post->title ?? '') }}" required>
|
||||
@include('back.modules.input-error', ['inputName'=>'title'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="text">{{ __('Texte') }} *</label>
|
||||
<textarea class="form-control" placeholder="{{ __('Texte') }}" id="text" name="text" style="height: 150px;">{{ old('text', $post->text ?? '') }}</textarea>
|
||||
@include('back.modules.input-error', ['inputName'=>'text'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
|
||||
<h2><small class="text-muted">{{ __('Période de publication') }}</small></h2>
|
||||
</div>
|
||||
<div class="d-flex mb-4 border border-1 border-secondary rounded-2 p-3 bg-light wdt50">
|
||||
<div class="form-group col">
|
||||
<label for="date_start_date">{{ __('Début') }} <small class="text-muted">{{ __('de publication') }}</small></label>
|
||||
@if($post->date_start !== null)
|
||||
<input type="date" id="date_start_date" name="date_start_date" class="form-control" value="{{ old('date_start_date', date_format($post->date_start, "Y-m-d")) }}" required>
|
||||
<input type="time" id="date_start_time" name="date_start_time" class="form-control" value="{{ old('date_start_time', date_format($post->date_start, "H:i")) }}" required>
|
||||
@else
|
||||
<input type="date" id="date_start_date" name="date_start_date" class="form-control" value="{{ old('date_start_date') }}" required>
|
||||
<input type="time" id="date_start_time" name="date_start_time" class="form-control" value="{{ old('date_start_time') }}" required>
|
||||
@endif
|
||||
{{-- <small class="text-muted">{{ __('Laisser vide pour un affichage immédiat') }}</small> --}}
|
||||
@include('back.modules.input-error', ['inputName'=>'date_start'])
|
||||
</div>
|
||||
<div class="form-group col">
|
||||
<label for="date_end_date">{{ __('Fin') }} <small class="text-muted">{{ __('de publication') }}</small></label>
|
||||
@if($post->date_end !== null)
|
||||
<input type="date" id="date_end_date" name="date_end_date" class="form-control" value="{{ old('date_end_date', date_format($post->date_end, "Y-m-d")) }}" required>
|
||||
<input type="time" id="date_end_time" name="date_end_time" class="form-control" value="{{ old('date_end_time', date_format($post->date_end, "H:i")) }}" required>
|
||||
@else
|
||||
<input type="date" id="date_end_date" name="date_end_date" class="form-control" value="{{ old('date_end_date') }}" required>
|
||||
<input type="time" id="date_end_time" name="date_end_time" class="form-control" value="{{ old('date_end_time') }}" required>
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'date_end'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
|
||||
<h2><small class="text-muted">{{ __('Affichage sur la Homepage') }}</small></h2>
|
||||
</div>
|
||||
<div class="forms-group border border-1 border-secondary rounded-2 p-3 bg-light wdt50">
|
||||
<div class="form-group mb-4">
|
||||
<label for="picture_home">{{ __('Image de mise en avant') }} <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions maximum {{ Config::get('bo.post_home_image_maxwidth') }} px par {{ Config::get('bo.post_home_image_maxheight') }} px</small></label><br/>
|
||||
@if ($post->picture_home !== null)
|
||||
<input type="file" id="picture_home" name="picture_home" accept="image/png, image/jpeg">
|
||||
<br/>
|
||||
<br/>
|
||||
<img src="{{$post->picture_home}}" alt="{{$post->title}}" style="max-height: 100px;">
|
||||
@else
|
||||
<input type="file" id="picture_home" name="picture_home" accept="image/png, image/jpeg" required>
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture_home'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-check-input" type="checkbox" id="on_top" name="on_top" @if (old('on_top', $post->on_top) === 1 || old('on_top', $post->on_top) === 'on')checked="checked" @endif>
|
||||
<label class="form-check-label" for="on_top">{{ __('A la une') }}</label>
|
||||
@include('back.modules.input-error', ['inputName'=>'on_top'])
|
||||
</div>
|
||||
</div>
|
||||
49
resources/views/back/posts/index.blade.php
Normal file
49
resources/views/back/posts/index.blade.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
@extends('layouts.backend')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">{{ __('Actualités') }} <small class="text-muted">{{ __('Liste') }}</small></h1>
|
||||
|
||||
@if ($errors->any())
|
||||
@foreach($errors->all() as $error)
|
||||
<span class="float-center text-danger">{{ $error }}</span>
|
||||
@endforeach
|
||||
@endif
|
||||
<a href="{{route('bo.posts.create')}}" class="btn btn-primary float-right">{{ __('Créer une actualité') }}</a>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th scope="col">{{ __('Image') }}</th>
|
||||
<th class="wdt50" scope="col">{{ __('Titre') }}</th>
|
||||
<th scope="col">{{ __('A la une') }}</th>
|
||||
<th scope="col">{{ __('Date de publication') }}</th>
|
||||
<th scope="col">{{ __('Date d\'archivage') }}</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($posts as $post)
|
||||
<tr>
|
||||
@if ($post->picture_news !== null)
|
||||
<th>
|
||||
<img src="{{$post->picture_news}}" alt="{{$post->title}}" style="max-height: 50px;">
|
||||
</th>
|
||||
@else
|
||||
<th></th>
|
||||
@endif
|
||||
<td>{{$post->title}}</td>
|
||||
<td>{{$post->on_top ? 'Oui' : 'Non'}}</td>
|
||||
<td>{{date_format($post->date_start, "d/m/Y H:i")}}</td>
|
||||
<td>{{date_format($post->date_end, "d/m/Y H:i")}}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{route('bo.posts.edit', $post->id)}}" class="btn btn-sm btn-primary">{{ __('Éditer') }}</a>
|
||||
<form action="{{route('bo.posts.destroy', $post->id)}}" method="POST" class="d-inline">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
<input type="submit" class="btn btn-sm btn-danger" value="Supprimer" onclick="return confirm('Êtes-vous sûr(e) ?')">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
||||
|
|
@ -40,8 +40,8 @@
|
|||
<td>{!! $slide->text !!}</td>
|
||||
<td><img src="{{ asset($slide->picture) }}" height="50px"></td>
|
||||
<td><a href="{{$slide->link}}" target="_slide">{{ $slide->link_label }}</a></td>
|
||||
<td>{{$slide->date_start}}</td>
|
||||
<td>{{$slide->date_end}}</td>
|
||||
<td>{{date_format($slide->date_start, "d/m/Y H:i")}}</td>
|
||||
<td>{{date_format($slide->date_end, "d/m/Y H:i")}}</td>
|
||||
<td>{{$slide->slider->label}}</td>
|
||||
<td>
|
||||
@if ($loop->first)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<textarea class="form-control" placeholder="{{ __('Titre de la page') }}" id="commentaire" name="commentaire" style="height: 100px">{{ old('commentaire', $slider->commentaire ?? '') }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-check-input" type="checkbox" id="publish" name="published" @if (old('published', $slider->published) !== 0)checked @endif>
|
||||
<input class="form-check-input" type="checkbox" id="publish" name="published" @if (old('published', $slider->published) === 1 || old('published', $slider->published) === 'on')checked="checked" @endif>
|
||||
<label class="form-check-label" for="publish">{{ __('Publié') }}</label>
|
||||
@include('back.modules.input-error', ['inputName'=>'published'])
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<tr>
|
||||
<td>{{$slider->label}}</td>
|
||||
<td>{{$slider->commentaire}}</td>
|
||||
<td>{{$slider->published}}</td>
|
||||
<td>{{$slider->published ? 'Oui' : 'Non'}}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{route('bo.sliders.edit', $slider->id)}}" class="btn btn-sm btn-primary">{{ __('Éditer') }}</a>
|
||||
<form action="{{route('bo.sliders.destroy', $slider->id)}}" method="POST" class="d-inline">
|
||||
|
|
|
|||
|
|
@ -9,15 +9,20 @@
|
|||
@include('back.modules.input-error', ['inputName'=>'text'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="picture">{{ __('Image') }} <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('bo.slide_image_maxwidth') }} px par {{ Config::get('bo.slide_image_maxheight') }} px</small></label></br>
|
||||
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg">
|
||||
<label for="picture">{{ __('Image') }} <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('bo.slide_image_maxwidth') }} px par {{ Config::get('bo.slide_image_maxheight') }} px</small></label><br/>
|
||||
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg" required>
|
||||
@if ($slide->picture !== null)
|
||||
<br />
|
||||
<br />
|
||||
<br/>
|
||||
<br/>
|
||||
<img src="{{$slide->picture}}" alt="{{$slide->title}}" style="max-height: 100px;">
|
||||
@endif
|
||||
@include('back.modules.input-error', ['inputName'=>'picture'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name">{{ __('Text alternatif de l\'image') }} *</label>
|
||||
<input type="text" id="alt_text_picture" name="alt_text_picture" class="form-control" placeholder="{{ __('Texte alternatif de l\'image') }} *" value="{{ old('alt_text_picture', $slide->alt_text_picture ?? '') }}" required>
|
||||
@include('back.modules.input-error', ['inputName'=>'alt_text_picture'])
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col">
|
||||
|
|
|
|||
67
resources/views/back/texts/create.blade.php
Normal file
67
resources/views/back/texts/create.blade.php
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
@extends('layouts.backend')
|
||||
|
||||
@section('content')
|
||||
<form action="{{route('bo.texts.store')}}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">
|
||||
<a href="{{route('bo.home')}}" class="h2 text-decoration-none"> < </a>
|
||||
{{ __('Questions / Réponses') }} <small class="text-muted">{{ __('Création') }}</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('back.texts.form-inputs')
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
var editorConfig = {
|
||||
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
|
||||
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo'],
|
||||
heading: {
|
||||
options: [{
|
||||
model: 'paragraph',
|
||||
title: 'Paragraph',
|
||||
class: 'ck-heading_paragraph'
|
||||
},
|
||||
{
|
||||
model: 'heading1',
|
||||
view: 'h1',
|
||||
title: 'Heading 1',
|
||||
class: 'ck-heading_heading1'
|
||||
},
|
||||
{
|
||||
model: 'heading2',
|
||||
view: 'h2',
|
||||
title: 'Heading 2',
|
||||
class: 'ck-heading_heading2'
|
||||
},
|
||||
{
|
||||
model: 'heading3',
|
||||
view: 'h3',
|
||||
title: 'Heading 3',
|
||||
class: 'ck-heading_heading3'
|
||||
},
|
||||
{
|
||||
model: 'heading4',
|
||||
view: 'h4',
|
||||
title: 'Heading 4',
|
||||
class: 'ck-heading_heading4'
|
||||
}
|
||||
]
|
||||
},
|
||||
table: {
|
||||
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells']
|
||||
}
|
||||
};
|
||||
ClassicEditor
|
||||
.create(document.querySelector('#text'), editorConfig)
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
18
resources/views/back/texts/edit.blade.php
Normal file
18
resources/views/back/texts/edit.blade.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
@extends('layouts.backend')
|
||||
|
||||
@section('content')
|
||||
|
||||
<form action="{{route('bo.texts.update', $text->id)}}" method="POST" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">
|
||||
<a href="{{route('bo.home')}}" class="h2 text-decoration-none"> < </a>
|
||||
{{ __('Questions / Réponses') }} <small class="text-muted">{{ __('Edition') }}</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@include('back.texts.form-inputs')
|
||||
</form>
|
||||
@endsection
|
||||
12
resources/views/back/texts/form-inputs.blade.php
Normal file
12
resources/views/back/texts/form-inputs.blade.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<div class="forms-group">
|
||||
<div class="form-group">
|
||||
<label for="title">{{ __('Titre') }} *</label>
|
||||
<input type="text" id="title" name="title" class="form-control" placeholder="{{ __('Titre') }} *" value="{{ old('title', $text->title ?? '') }}" required>
|
||||
@include('back.modules.input-error', ['inputName'=>'title'])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="text">{{ __('Texte') }} *</label>
|
||||
<textarea class="form-control" placeholder="{{ __('Texte') }}" id="text" name="text" style="height: 150px;" required>{{ old('commentaire', $text->text ?? '') }}</textarea>
|
||||
@include('back.modules.input-error', ['inputName'=>'text'])
|
||||
</div>
|
||||
</div>
|
||||
37
resources/views/back/texts/index.blade.php
Normal file
37
resources/views/back/texts/index.blade.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
@extends('layouts.backend')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">{{ __('Questions / Réponses') }} <small class="text-muted">{{ __('Liste') }}</small></h1>
|
||||
|
||||
@if ($errors->any())
|
||||
@foreach($errors->all() as $error)
|
||||
<span class="float-center text-danger">{{ $error }}</span>
|
||||
@endforeach
|
||||
@endif
|
||||
<a href="{{route('bo.texts.create')}}" class="btn btn-primary float-right">{{ __('Créer une Question / Réponse') }}</a>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th class="wdt25" scope="col">{{ __('Question') }}</th>
|
||||
<th scope="col">{{ __('Réponse') }}</th>
|
||||
<th class="wdt11"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($texts as $text)
|
||||
<tr>
|
||||
<td>{{$text->title}}</td>
|
||||
<td>{{$text->text}}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{route('bo.texts.edit', $text->id)}}" class="btn btn-sm btn-primary">{{ __('Éditer') }}</a>
|
||||
<form action="{{route('bo.texts.destroy', $text->id)}}" method="POST" class="d-inline">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
<input type="submit" class="btn btn-sm btn-danger" value="Supprimer" onclick="return confirm('Êtes-vous sûr(e) ?')">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
||||
|
|
@ -4,16 +4,18 @@
|
|||
|
||||
@section('content')
|
||||
<div class="jumbotron">
|
||||
@if (isset($slider))
|
||||
<div id="carrousel1">
|
||||
@foreach ($slider->slides as $slide)
|
||||
@foreach ($slides as $slide)
|
||||
<div class="item">
|
||||
<div class="item__image">
|
||||
<img class="img-zoom" src="{{ asset($slide->picture) }}" />
|
||||
<img class="img-zoom" src="{{ asset($slide->picture) }}" alt="{{ $slide->alt_text_picture}}"/>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<h1 class="item__title maintitle align-center ttu animate__animated fadeIn animate__slow">{!! clean(nl2br($slider->commentaire)) !!}</h1>
|
||||
@endif
|
||||
<div class="banner">
|
||||
<svg id="Calque_1" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1919.76 59.99">
|
||||
<defs>
|
||||
|
|
@ -86,6 +88,7 @@
|
|||
<img src="{{ asset('assets/images/frise.jpg') }}" alt="" />
|
||||
</div>
|
||||
|
||||
@if (isset($post_home))
|
||||
<div class="container news">
|
||||
<div class="wrapper">
|
||||
<div class="sectiontitle">
|
||||
|
|
@ -93,23 +96,15 @@
|
|||
L'actualité de la marque Doux
|
||||
</h2>
|
||||
</div>
|
||||
<div class="animate__animated fadeInUp animate__slow">
|
||||
<img src="{{ asset('assets/images/burger-fond.jpg') }}" />
|
||||
<div class="align-center animate__animated fadeInUp animate__slow">
|
||||
<img src="{{ asset($post_home->picture_home) }}" alt="{{ $post_home->title}}"/>
|
||||
</div>
|
||||
<h3 class="h2 align-center">
|
||||
Doux innove et propose sa référence iconique en format mini !
|
||||
</h3>
|
||||
<p class="align-justify">
|
||||
Découvrez nos nouveautés : les Mini Chicken Franks Doux. Original ou
|
||||
Cheese, retrouvez vos deux recettes préférées en version mini. Ce
|
||||
format est idéal pour les moments de partage et les repas sur le
|
||||
pouce. Réchauffez les au micro-ondes, elles seront prêtes en
|
||||
quelques minutes seulement. Très pratique et pensées pour vous
|
||||
faciliter la vie ! N'hésitez plus et laissez vous tenter !
|
||||
</p>
|
||||
<h3 class="h2 align-center">{{ $post_home->title}}</h3>
|
||||
<p class="align-justify">{!! clean(nl2br($post_home->text)) !!}</p>
|
||||
<p class="align-center">
|
||||
<a href="{{ route('news') }}" title="" class="cta">En savoir plus</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
|
|
@ -33,20 +33,23 @@
|
|||
</div>
|
||||
<div class="is-flex desk-mt50">
|
||||
<div class="w100 has-chicken-path animate__animated fadeInLeft animate__slow">
|
||||
<img src="{{ asset('assets/images/repas.jpg') }}" alt="photo">
|
||||
<img class="advice-img" src="{{ asset($advice_news->picture1) }}" alt="{{ $advice_news->title1 }}">
|
||||
</div>
|
||||
<div class="animate__animated fadeInRight animate__slow">
|
||||
<h3 class="color-yellow">...Nutritionnels</h3>
|
||||
<p class="align-justify">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
|
||||
<h3 class="color-yellow">{{ $advice_news->title1 }}</h3>
|
||||
<p class="align-justify">{!! clean(nl2br($advice_news->text1)) !!}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="is-flex desk-mt180">
|
||||
<div class="w50 desk-mr18 animate__animated fadeInLeft animate__slow">
|
||||
<img src="{{ asset('assets/images/zoom.jpg') }}" alt="photo">
|
||||
<div class="w25 desk-mr10 animate__animated fadeInLeft animate__slow">
|
||||
<img class="advice-img" src="{{ asset($advice_news->picture2) }}" alt="{{ $advice_news->title2 }}">
|
||||
</div>
|
||||
<div class="w25 desk-mr18 animate__animated fadeInLeft animate__slow">
|
||||
<img class="advice-img" src="{{ asset($advice_news->picture3) }}" alt="{{ $advice_news->title2 }}">
|
||||
</div>
|
||||
<div class="w50 animate__animated fadeInRight animate__slow">
|
||||
<h3 class="color-yellow">...Cuisines</h3>
|
||||
<p class="align-justify">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
|
||||
<h3 class="color-yellow">{{ $advice_news->title2 }}</h3>
|
||||
<p class="align-justify">{!! clean(nl2br($advice_news->text2)) !!}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -66,62 +69,28 @@
|
|||
</div>
|
||||
</div>
|
||||
<ul class="more">
|
||||
@foreach ($texts_news as $text)
|
||||
<li>
|
||||
<p>Peut-on recongeler après décongélation ?</p>
|
||||
<p class="align-justify">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Qu'est-ce qu'un repas équilibré ?</p>
|
||||
<p class="align-justify">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Comment la volaille participe à mon équilibre ?</p>
|
||||
<p class="align-justify">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
|
||||
<p>{{ $text->title}}</p>
|
||||
<p class="align-justify">{!! clean(nl2br($text->text)) !!}</p>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="posts" class="container">
|
||||
<div class="posts-content wrapper">
|
||||
<h2 class="sectiontitle align-center animate__animated fadeInUp animate__slow">Actualité</h2>
|
||||
<h3 class="h2 align-center">Lorem Ipsum</h3>
|
||||
<h2 class="sectiontitle align-center animate__animated fadeInUp animate__slow">{{ $title_newsPosts->title}}</h2>
|
||||
<h3 class="h2 align-center">{{ $title_newsPosts->text}}</h3>
|
||||
<div class="posts-list is-flex">
|
||||
@foreach ($posts as $post)
|
||||
<div class="post-card animate__animated fadeInUp animate__slow">
|
||||
<img src="{{ asset('assets/images/burger.jpg') }}" alt="">
|
||||
<h3 class="post-card__title color-yellow">Lorem ip sum dolor sit amet</h3>
|
||||
<p class="align-justify">Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostr
|
||||
ud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
|
||||
ua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
|
||||
</div>
|
||||
<div class="post-card animate__animated fadeInUp animate__slow">
|
||||
<img src="{{ asset('assets/images/burger.jpg') }}" alt="">
|
||||
<h3 class="post-card__title color-yellow">Lorem ip sum dolor sit amet</h3>
|
||||
<p class="align-justify">Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostr
|
||||
ud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
|
||||
ua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
|
||||
</div>
|
||||
<div class="post-card animate__animated fadeInUp animate__slow">
|
||||
<img src="{{ asset('assets/images/burger.jpg') }}" alt="">
|
||||
<h3 class="post-card__title color-yellow">Lorem ip sum dolor sit amet</h3>
|
||||
<p class="align-justify">Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostr
|
||||
ud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
|
||||
ua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
|
||||
</div>
|
||||
<div class="post-card animate__animated fadeInUp animate__slow">
|
||||
<img src="{{ asset('assets/images/burger.jpg') }}" alt="">
|
||||
<h3 class="post-card__title color-yellow">Lorem ip sum dolor sit amet</h3>
|
||||
<p class="align-justify">Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostr
|
||||
ud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
|
||||
ua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
|
||||
</div>
|
||||
<div class="post-card animate__animated fadeInUp animate__slow">
|
||||
<img src="{{ asset('assets/images/burger.jpg') }}" alt="">
|
||||
<h3 class="post-card__title color-yellow">Lorem ip sum dolor sit amet</h3>
|
||||
<p class="align-justify">Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostr
|
||||
ud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ip sum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
|
||||
ua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
|
||||
<img src="{{ asset($post->picture_news) }}" alt="{{ $post->title }}">
|
||||
<h3 class="post-card__title color-yellow">{{ $post->title }}</h3>
|
||||
<p class="align-justify">{!! clean(nl2br($post->text)) !!}</p>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<img src="{{ asset('assets/images/frise.jpg') }}" alt="">
|
||||
|
|
|
|||
|
|
@ -54,12 +54,7 @@
|
|||
<div class="mb-1">
|
||||
<h6 class="pb-1 mb-1 text-dark border-bottom">{{ __('ENCART DE BAS DE PAGE') }}</h6>
|
||||
<a class="nav-link py-0 ms-4" href="{{route('bo.encarts.edit', $encart_marqueFooter->id)}}">{{ __('Contenu') }}</a>
|
||||
{{-- <a class="nav-link py-0 ms-4" href="{{route('bo.pictos.edit', $picto_marque)}}">{{ __('Pictogrammes') }}</a> --}}
|
||||
</div>
|
||||
{{-- <div class="mb-1">
|
||||
<h6 class="pb-1 mb-1 text-dark border-bottom">{{ __('LES AVANTAGES') }}</h6>
|
||||
<a class="nav-link py-0 ms-4" href="{{route('bo.encartargs.edit', $encartarg_food->id)}}">{{ __('Contenu') }}</a>
|
||||
</div> --}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -74,14 +69,14 @@
|
|||
<div class="accordion-body">
|
||||
<div class="mb-3">
|
||||
<h6 class="pb-1 mb-1 text-dark border-bottom">{{ __('BLOC DES CONSEILS') }}</h6>
|
||||
<a class="nav-link py-0 ms-4" href="{{route('bo.advices.edit', $advices_news->id)}}">{{ __('Contenu') }}</a>
|
||||
<a class="nav-link py-0 ms-4" href="#">{{ __('Questions/Réponses') }}</a>
|
||||
<a class="nav-link py-0 ms-4" href="{{route('bo.advice.edit', $advice_news->id)}}">{{ __('Contenu') }}</a>
|
||||
<a class="nav-link py-0 ms-4" href="{{route('bo.texts.content', $texts_news[0]->page)}}">{{ __('Questions/Réponses') }}</a>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<h6 class="pb-1 mb-1 text-dark border-bottom">{{ __('BLOC ACTUALITES') }}</h6>
|
||||
<a class="nav-link py-0 ms-4" href="{{route('bo.titles.edit', $title_newsPosts->id)}}">{{ __('Entête') }}</a>
|
||||
<a class="nav-link py-0 ms-4" href="#">{{ __('Toutes les actualités') }}</a>
|
||||
<a class="nav-link py-0 ms-4" href="#">{{ __('Ajouter une actualité') }}</a>
|
||||
<a class="nav-link py-0 ms-4" href="{{route('bo.posts.index')}}">{{ __('Toutes les actualités') }}</a>
|
||||
<a class="nav-link py-0 ms-4" href="{{route('bo.posts.create')}}">{{ __('Ajouter une actualité') }}</a>
|
||||
</div>
|
||||
{{-- <div class="mb-1">
|
||||
<h6 class="pb-1 mb-1 text-dark border-bottom">{{ __('LES AVANTAGES') }}</h6>
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@
|
|||
</div>
|
||||
|
||||
<!-- Scripts -->
|
||||
<!-- <script src="{{ asset('js/ldcweb-cn.min.js') }}"></script>
|
||||
<script src="{{ asset('js/caroussel.js') }}"></script> -->
|
||||
<!-- <script src="{{ asset('js/app.js') }}"></script> -->
|
||||
<script src="{{ asset('js/preload-front.js') }}" type="text/javascript"></script>
|
||||
@stack('scripts')
|
||||
|
||||
|
|
|
|||
|
|
@ -11,13 +11,15 @@
|
|||
* phpcs:ignore PEAR.Commenting.FileComment.MissingVersion
|
||||
*/
|
||||
|
||||
use App\Http\Controllers\Bo\AdvicesController;
|
||||
use App\Http\Controllers\Bo\AdviceController;
|
||||
use App\Http\Controllers\Bo\EncartsController;
|
||||
use App\Http\Controllers\Bo\HomeController;
|
||||
use App\Http\Controllers\Bo\PictoBrandsController;
|
||||
use App\Http\Controllers\Bo\PictosController;
|
||||
use App\Http\Controllers\Bo\PostsController;
|
||||
use App\Http\Controllers\Bo\SlidersController;
|
||||
use App\Http\Controllers\Bo\SlidesController;
|
||||
use App\Http\Controllers\Bo\TextsController;
|
||||
use App\Http\Controllers\Bo\TitlesController;
|
||||
use App\Http\Controllers\HomeController as ControllersHomeController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
|
@ -38,7 +40,6 @@ Route::prefix('bo')
|
|||
->name('bo.')
|
||||
->group(
|
||||
function () {
|
||||
//Route::middleware(['throttle:credentials'])
|
||||
Route::middleware([])
|
||||
->group(
|
||||
function () {
|
||||
|
|
@ -55,7 +56,7 @@ Route::prefix('bo')
|
|||
);
|
||||
}
|
||||
);
|
||||
Route::middleware(['auth:web'])
|
||||
Route::middleware(['auth:web', 'init-vars'])
|
||||
->group(
|
||||
function () {
|
||||
Route::get(
|
||||
|
|
@ -74,9 +75,11 @@ Route::prefix('bo')
|
|||
Route::resource('encarts', EncartsController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::resource('pictos', PictosController::class)->except(['show']);
|
||||
Route::resource('posts', PostsController::class)->except(['show']);
|
||||
Route::resource('pictobrands', PictoBrandsController::class)->except(['show']);
|
||||
Route::resource('posts', AdvicesController::class)
|
||||
Route::resource('advice', AdviceController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::resource('texts', TextsController::class)->except(['show']);
|
||||
Route::resource('titles', TitlesController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::get(
|
||||
|
|
@ -87,33 +90,26 @@ Route::prefix('bo')
|
|||
]
|
||||
)->name('slides.change-order');
|
||||
Route::get('/pictos/{page}', [PictosController::class, 'index'])->name('pictos.content');
|
||||
Route::get('/texts/{page}', [TextsController::class, 'index'])->name('texts.content');
|
||||
// Route::get('/posts', [PostsController::class, 'index'])->name('posts');
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
Route::get('/', [ControllersHomeController::class, 'index'])->name('home');
|
||||
Route::view('/la-marque', 'front.a-propos')->name('wasup');
|
||||
Route::view('/le-produit', 'front.product')->name('product');
|
||||
Route::view('/les-produits', 'front.products-list')->name('products');
|
||||
Route::view('/les-gammes', 'front.gammes')->name('gammes');
|
||||
Route::view('/les-categories', 'front.categorie')->name('categories');
|
||||
Route::view('/les-actualites', 'front.news')->name('news');
|
||||
// Route::get(
|
||||
// '/contact',
|
||||
// [
|
||||
// ControllersContactController::class,
|
||||
// 'contact'
|
||||
// ]
|
||||
// )->name('contact');
|
||||
// Route::post(
|
||||
// '/contact',
|
||||
// [
|
||||
// ControllersContactController::class,
|
||||
// 'contactSubmit'
|
||||
// ]
|
||||
// )->name('contact.submit');
|
||||
Route::view('/food-service', 'front.food-service')->name('food');
|
||||
Route::view('/mentions-legales', 'front.legals')->name('cgu');
|
||||
Route::view('/charte-confidentialite', 'front.policy')->name('policy');
|
||||
Route::view('/plan-site', 'front.site-map')->name('site-map');
|
||||
Route::middleware(['init-vars'])
|
||||
->group(
|
||||
function () {
|
||||
Route::get('/', [ControllersHomeController::class, 'index'])->name('home');
|
||||
Route::view('/la-marque', 'front.a-propos')->name('wasup');
|
||||
Route::view('/le-produit', 'front.product')->name('product');
|
||||
Route::view('/les-produits', 'front.products-list')->name('products');
|
||||
Route::view('/les-gammes', 'front.gammes')->name('gammes');
|
||||
Route::view('/les-categories', 'front.categorie')->name('categories');
|
||||
Route::view('/les-actualites', 'front.news')->name('news');
|
||||
Route::view('/food-service', 'front.food-service')->name('food');
|
||||
Route::view('/mentions-legales', 'front.legals')->name('cgu');
|
||||
Route::view('/charte-confidentialite', 'front.policy')->name('policy');
|
||||
Route::view('/plan-site', 'front.site-map')->name('site-map');
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue