Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
feat: Add dynamic main view
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanViknar committed Mar 27, 2024
1 parent 1552ba3 commit 9957a1d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 46 deletions.
Empty file added public/css/about.css
Empty file.
4 changes: 4 additions & 0 deletions public/css/error.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
main i {
font-size: 1em;
color: rgb(255, 0, 0);
}
Empty file added public/css/home.css
Empty file.
42 changes: 0 additions & 42 deletions public/css/homepage.css

This file was deleted.

2 changes: 2 additions & 0 deletions resources/views/about.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>A propos de HurrShop...</h1>
<p>Je n'ai pas été assez imaginatif pour placer un placeholder drole ici, donc prenez ce message.</p>
5 changes: 4 additions & 1 deletion resources/views/application.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<meta charset="utf-8">
<link rel="stylesheet" href="{{ asset('css/application.css') }}">
<link href="https://fonts.cdnfonts.com/css/minecraft-4" rel="stylesheet">

<!-- Style de la zone main -->
<link rel="stylesheet" href="{{ asset('css/'.($page_to_load ?? "error").'.css') }}">
</head>
<!-- Contenu de la page -->
<body>
Expand Down Expand Up @@ -43,7 +46,7 @@
</ul>
</nav>
<main>
@include('home_content')
@include($page_to_load ?? "error")
</main>
</div>

Expand Down
2 changes: 2 additions & 0 deletions resources/views/error.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Erreur !</h1>
<p>Hurr. Huh. Pin ! Puh ! Puh ! <i>Pwuh !</i></p>
File renamed without changes.
6 changes: 3 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
|
*/

Route::get('/', function () {
return view('application');
});
Route::get('/', function () {return view('application', ["page_to_load" => "home"]);});
Route::get('/about', function () {return view('application', ["page_to_load" => "about"]);});
Route::get('/404_test', function () {return view('application');});

Route::post("/auth/login", [AuthController::class, "login"]);
Route::post("/auth/logout", [AuthController::class, "logout"]);
Expand Down

0 comments on commit 9957a1d

Please sign in to comment.