Skip to content
Snippets Groups Projects
Verified Commit 1de77bfa authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

feat: Add Terms and Conditions page

- Created a new TermsController to handle the display of active terms.
- Added a terms view with a markdown component for displaying content.
- Updated the generic page header component to allow empty descriptions.
- Modified the footer to include a link to the Terms and Conditions page.
- Added a new route for the Terms and Conditions page.
parent bd3f1200
No related branches found
No related tags found
1 merge request!61Resolve "Créer pages mentions légales et conditions générales de vente"
Pipeline #1063 passed
<?php
namespace App\Http\Controllers\Public;
use App\Http\Controllers\Controller;
use App\Models\TermsSection;
use Illuminate\View\View;
class TermsController extends Controller
{
public function __invoke(): View
{
$activeTermsText = TermsSection::where('active', true)->first();
if (! $activeTermsText) {
abort(404);
}
$activeTermsText = $activeTermsText->contentTranslationKey->getTranslation();
return view('public.terms', compact('activeTermsText'));
}
}
......@@ -36,14 +36,12 @@
<div class="self-stretch text-2xl font-bold">Informations légales</div>
<ul class="flex flex-col gap-2">
<li>
<a href="#" class="text-muted hover:text-primary">Mentions légales</a>
<a href="{{ route('legal-mentions') }}" class="text-muted hover:text-primary">Mentions
légales</a>
</li>
<li>
<a href="#" class="text-muted hover:text-primary">Conditions générales de vente</a>
</li>
<li>
<a href="#" class="text-muted hover:text-primary">Politique de confidentialité</a>
</li>
</ul>
</div>
</div>
......
@props([
'title' => 'Title',
'description' => 'Description',
'description' => '',
])
<div {{ $attributes->class(['relative flex flex-col max-w-2xl gap-3']) }}>
......
@extends('layouts.public', ['title' => "Mentions légales"])
@section('content')
<x-public.navbar class="container mx-auto px-4"/>
<div class="container mx-auto px-4 py-24 flex flex-col gap-16">
<x-public.generic-page-header title="Mentions légales"/>
<div class="">
<x-markdown class="markdown">
{{ $activeTermsText }}
</x-markdown>
</div>
</div>
<x-public.footer/>
@endsection
\ No newline at end of file
......@@ -13,6 +13,7 @@
use App\Http\Controllers\Public\IndexController;
use App\Http\Controllers\Public\PortfolioController;
use App\Http\Controllers\Public\PrestationController as PublicPrestationController;
use App\Http\Controllers\Public\TermsController;
use App\Http\Middleware\CheckPrivateModeMiddleware;
use App\Http\Middleware\RedirectIfUserExistsMiddleware;
use Illuminate\Support\Facades\Route;
......@@ -29,6 +30,7 @@
Route::get('/portfolio/api', [PortfolioController::class, 'api'])->name('portfolio.api');
Route::get('/portfolio/{slug}', [PortfolioController::class, 'show'])->name('portfolio.show');
Route::get('/prestations/{slug}', [PublicPrestationController::class, 'index'])->name('prestations.show');
Route::get('/mentions-legales', TermsController::class)->name('legal-mentions');
Route::view('/maintenance', 'public.maintenance')->name('maintenance');
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment