Commit 30df5032 authored by Andgel Brissaud's avatar Andgel Brissaud
Browse files

feat: add an error page -> take an error message to display it

parent afd7c593
Loading
Loading
Loading
Loading

public/css/error.css

0 → 100644
+54 −0
Original line number Diff line number Diff line
html{
    background-image: url("/images/error.jpg");
    background-repeat: no-repeat;
    background-size: cover;
}

.center-box{
    padding: 30px;
    background-color: rgba(0, 0, 0, 0.22);
    width: 60vw;
    height: auto;
    border-radius: 30px;
    margin: auto;
    margin-top: 7em ;
    display: block;
    text-align: center;
    backdrop-filter: blur(5px);
}

h1{
    font-family: 'Space Grotesk', sans-serif;
    font-size: 55px;
    color: white;
    font-weight: bold;
}

p{
    font-family: 'Montserrat', sans-serif;
    margin-top: 30px;
    font-size: 30px;
    color: white;
}

@media only screen and (max-width: 768px) {
    /* For mobile phones: */

    .center-box{
        padding: 30px;
        background-color: rgba(255, 255, 255, 0.22);
        width: 75vw;
        height: auto;
        border-radius: 30px;
        margin: auto;
        margin-top: 7em ;
        display: block;
        text-align: center;
        backdrop-filter: blur(5px);
    }

    h1{
        font-size: 50px;
    }

  }
 No newline at end of file
+0 −4
Original line number Diff line number Diff line
@@ -6,10 +6,6 @@ html{
    background-image: url("/images/background-homepage.jpg");
}

.background-image{
    filter: blur(5px);
}

.center-box{
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.22);
+186 KiB
Loading image diff...
+11 −0
Original line number Diff line number Diff line
<x-layout>
    <link rel="stylesheet" href="/css/error.css">

    <div class="center-box">
        <h1>OUPS! UNE ERREUR EST SURVENUE</h1>
        <p>
            {{$message}}
        </p>
    </div>

</x-layout>
 No newline at end of file
+10 −21
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
use App\Http\Controllers\DivingSignUpController;
use App\Http\Controllers\DiveSessionCreation;
use App\Http\Controllers\DiveSessionUpdate;
use App\Http\Controllers\DiveSessionDelete;
use App\Http\Controllers\AuthController;
use Illuminate\Support\Facades\Route;

@@ -29,6 +28,13 @@
use App\Models\Boat;
use App\Models\Prerogative;

Route::get('/error', function () {
    $message = 'test';
    return view('error-page' , [
        'message' => $message
    ]);
});


Route::get('/login', function () {
    return view('login', ['wrongPassword' => false]);
@@ -66,19 +72,14 @@
Route::middleware('App\Http\Middleware\rightChecker')
    ->get('/create/dive', function()
{
    return view('create_dive', ['locations' => DivingLocation::all(),  'boats' => Boat::all(), 'levels' => Prerogative::all()->skip(3), 'users' => User::all()]);
    return view('create_dive', ['locations' => DivingLocation::all(),  'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all()]);
})->name('create_dive');

Route::middleware('App\Http\Middleware\rightChecker')
    ->post('/create/dive', function(Request $request)
{
    $pre = DiveSessionCreation::add($request);

    $previousDives = session('previousDives', []);

    session(['previousDives' => $previousDives]);

    return view('create_dive',  ['locations' => DivingLocation::all(),  'boats' => Boat::all(), 'levels' => Prerogative::all()->skip(3), 'users' => User::all(), 'precedent' => $pre, 'previousDives' => $previousDives]);
    return view('create_dive',  ['locations' => DivingLocation::all(),  'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all(), 'precedent' => $pre]);
});

Route::get('/tewst2', function(){
@@ -90,7 +91,7 @@
    return view('update_dive', ['dive' => DivingSession::find($id),
                'locations' => DivingLocation::all(),
                'boats' => Boat::all(),
                'levels' => Prerogative::all()->skip(4),
                'levels' => Prerogative::all(),
                'users' => User::all()]);
});

@@ -105,18 +106,6 @@
    return redirect('/');
});

Route::post('/dive/delete/{id}', function ($id, Request $request) {
    DiveSessionDelete::update($id);

    $previousDives = session('previousDives', []);
    $previousDives = array_filter($previousDives, function ($dive) use ($id) {
        return $dive['id'] != $id;
    });
    session(['previousDives' => $previousDives]);

    return redirect('/create/dive');
});

Route::get('/sessions', [DiversBySession::class,'getAllSessions']);

Route::get('/session/{ds_code}', [DiversBySession::class,'getDiversBySession']);