Skip to content

Commit b9f2f1e

Browse files
committed
💄 configuration du layout admin
1 parent a41c2df commit b9f2f1e

File tree

7 files changed

+50
-21
lines changed

7 files changed

+50
-21
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<div class="bg-skin-menu divide-y divide-skin-light">
2+
<x-layouts.header />
3+
<div class="max-w-7xl mx-auto px-2 py-3 sm:px-4">
4+
<nav class="flex items-center space-x-3" aria-label="Global">
5+
<a href="{{ route('cpanel.home') }}" class="text-sm font-medium rounded-md py-2 px-3 inline-flex items-center {{ active(['cpanel.home'], 'bg-green-50 text-green-800', 'text-skin-base hover:bg-skin-card-muted hover:text-skin-inverted') }}" aria-current="page" x-state:on="Current" x-state:off="Default">
6+
{{ __('Tableau de bord') }}
7+
</a>
8+
<a href="#" class="text-sm font-medium rounded-md py-2 px-3 inline-flex items-center {{ active(['users*'], 'bg-green-50 text-green-800', 'text-skin-base hover:bg-skin-card-muted hover:text-skin-inverted') }}">
9+
{{ __('Utilisateurs') }}
10+
</a>
11+
<a href="#" class="text-sm font-medium rounded-md py-2 px-3 inline-flex items-center {{ active(['categories*'], 'bg-green-50 text-green-800', 'text-skin-base hover:bg-skin-card-muted hover:text-skin-inverted') }}">
12+
{{ __('Catégories') }}
13+
</a>
14+
<a href="#" class="inline-flex text-sm font-medium rounded-md py-2 px-3 inline-flex items-center {{ active(['submissions*'], 'bg-green-50 text-green-800', 'text-skin-base hover:bg-skin-card-muted hover:text-skin-inverted') }}">
15+
{{ __('Soumissions') }} <span class="ml-2 text-sm leading-5 text-skin-inverted-muted">4</span>
16+
</a>
17+
<a href="#" class="inline-flex text-sm font-medium rounded-md py-2 px-3 inline-flex items-center {{ active(['analytics*'], 'bg-green-50 text-green-800', 'text-skin-base hover:bg-skin-card-muted hover:text-skin-inverted') }}">
18+
{{ __('Analytics') }}
19+
</a>
20+
</nav>
21+
</div>
22+
</div>

resources/views/layouts/cp.blade.php renamed to resources/views/components/layouts/cp.blade.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
@props(['title'])
2+
13
<!DOCTYPE html>
2-
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="scroll-smooth">
4+
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="scroll-smooth {{ get_current_theme() }}">
35
<head>
46
<meta charset="utf-8">
57
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -39,15 +41,16 @@
3941

4042
@include('layouts._favicons')
4143
</head>
42-
<body class="antialiased font-sans bg-white dark:bg-gray-900">
44+
<body class="font-sans antialiased bg-skin-body text-skin-base">
4345

4446
<div class="relative overflow-hidden min-h-full">
45-
@yield('content')
47+
{{ $slot }}
4648
</div>
4749

4850
<x-notifications z-index="z-50" />
4951

5052
@livewire('livewire-ui-modal')
53+
@livewire('livewire-ui-spotlight')
5154
@stack('scripts')
5255
</body>
5356
</html>

resources/views/layouts/_nav.blade.php renamed to resources/views/components/layouts/header.blade.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<nav x-data="{ open: false, flyoutMenu: false }" class="relative z-10 bg-skin-menu header">
1+
<nav x-data="{ open: false, flyoutMenu: false }" {{ $attributes->merge(['class' => 'relative z-10 bg-skin-menu']) }}>
22
<div class="max-w-7xl mx-auto px-2 sm:px-4">
33
<div class="flex justify-between h-16">
44
<div class="flex px-2 lg:px-0">
@@ -237,13 +237,17 @@ class="origin-top-right absolute right-0 mt-2 w-60 rounded-md shadow-lg py-1 bg-
237237
{{ Auth::user()->email }}
238238
</p>
239239
</div>
240-
<div class="py-1.5 px-3.5" role="none">
241-
@if(Auth::user()->hasRole(['admin', 'moderator']))
240+
@if(Auth::user()->hasRole(['admin', 'moderator']))
241+
<div class="py-1.5 px-3.5" role="none">
242242
<a href="{{ route('cpanel.home') }}" class="group flex items-center py-1.5 text-sm text-skin-base hover:text-skin-primary font-normal" role="menuitem" tabindex="-1" id="user-menu-item-0">
243-
<x-heroicon-o-chart-square-bar class="flex-none h-5 w-5 mr-3 text-skin-muted group-hover:text-skin-primary" />
244-
{{ __('Cpanel') }}
243+
<svg class="flex-none h-5 w-5 mr-3 text-skin-muted group-hover:text-skin-primary" fill="none" viewBox="0 0 24 24">
244+
<path d="M15 17v4H9v-4m-3.8 0h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 15.48 22 14.92 22 13.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 17 4.08 17 5.2 17Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
245+
</svg>
246+
{{ __('Administration') }}
245247
</a>
246-
@endif
248+
</div>
249+
@endif
250+
<div class="py-1.5 px-3.5" role="none">
247251
<a href="{{ route('dashboard') }}" class="group flex items-center py-1.5 text-sm text-skin-base hover:text-skin-primary font-normal" role="menuitem" tabindex="-1" id="user-menu-item-0">
248252
<x-heroicon-o-view-grid class="flex-none h-5 w-5 mr-3 text-skin-muted group-hover:text-skin-primary" />
249253
{{ __('Dashboard') }}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@extends('layouts.cp')
2-
3-
@title('Tableau de bord')
4-
5-
@section('content')
6-
7-
<h1>Tableau de bord</h1>
8-
9-
@stop
1+
<x-layouts.cp title="Tableau de bord">
2+
<x-layouts.admin-menu />
3+
4+
<x-container class="max-w-7xl mx-auto px-4 sm:px-6">
5+
<div class="py-10 sm:py-12">
6+
<h1>Tableau de bord</h1>
7+
</div>
8+
</x-container>
9+
</x-layouts.cp>

resources/views/layouts/default.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@section('content')
44

5-
@include('layouts._nav')
5+
<x-layouts.header class="header" />
66

77
<x-container class="py-10 max-w-7xl mx-auto px-4">
88
@yield('body')

resources/views/layouts/large.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@section('content')
44

5-
@include('layouts._nav')
5+
<x-layouts.header class="header" />
66

77
<x-container>
88
@yield('body')

resources/views/layouts/master.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="{{ get_current_theme() }}">
2+
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="scroll-smooth {{ get_current_theme() }}">
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">

0 commit comments

Comments
 (0)