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

Commit

Permalink
feat: Add admin panel main menu
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanViknar committed Apr 16, 2024
1 parent 0c55b8e commit e6ae666
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 0 deletions.
45 changes: 45 additions & 0 deletions public/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* Grid */
div#admin_menu {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 4vw;
margin: 2vw;

min-height: 100%;
max-width: 100%;
}
/* Mobile version */
@media (max-width: 768px) {
div#admin_menu {
grid-template-columns: 1fr;
}
}

/* Buttons */
main a {
background-image: url("../img/widget.png");
background-size: 100% 100%;
font-family: 'Minecraft', sans-serif;
cursor: pointer;
color: white;

text-align: center;
justify-content: center;

display: flex;
flex-direction: column;
padding: 1vw;
}

main a img {
margin-bottom: 2vw;
margin-left: auto;
margin-right: auto;
max-width: 70%;
max-height: 12vw;
}

main a:hover{
background-image: url("../img/widgetclicked.png");
border-color: white;
}
2 changes: 2 additions & 0 deletions public/css/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ footer p.please_dont_see_this {
opacity: 0.5;
}

/* Default form styles */

input[type=submit]{
background-image: url("../img/widget.png");
background-size: 100% 100%;
Expand Down
Binary file added public/img/Book_JE2_BE2.webp
Binary file not shown.
Binary file added public/img/Plains_Villager_Base.webp
Binary file not shown.
Binary file added public/img/admin_user.webp
Binary file not shown.
15 changes: 15 additions & 0 deletions resources/views/admin.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h1>Panel de gestion administrateur</h1>
<div id="admin_menu">
<a href="/admin/users">
<img src="{{ asset('img/admin_user.webp') }}"/>
Gestionnaire Utilisateurs
</a>
<a href="/admin/products">
<img src="{{ asset('img/Plains_Villager_Base.webp') }}"/>
Gestionnaire Produits & Catégories
</a>
<a href="/admin/contact">
<img src="{{ asset('img/Book_JE2_BE2.webp') }}"/>
Gestionnaire Contacts
</a>
</div>
4 changes: 4 additions & 0 deletions resources/views/application.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
@auth
<a href="/profile">Compte</a>
<a href="/cart">Panier</a>
<!-- If user is admin, add admin link -->
@if(Auth::user()->is_admin)
<a href="/admin">Admin</a>
@endif
@endauth
<a href="/contact">Contact</a>
</div>
Expand Down
4 changes: 4 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
Route::fallback(function () {return view('application', ["page_to_load" => "error", "title" => "Erreur"]);});

// Admin-only
Route::get('/admin', function () {return view('application', [
"page_to_load" => "admin",
"title" => "Panel Admin"
]);})->middleware("admin");
Route::get('/admin/products', function () {return view('application', [
"page_to_load" => "admin_products",
"title" => "Gestion produits"
Expand Down

0 comments on commit e6ae666

Please sign in to comment.