Skip to content

Commit 9486dde

Browse files
committed
✨ wip sur le tableau de bord de l'administration
1 parent b9f2f1e commit 9486dde

File tree

4 files changed

+110
-5
lines changed

4 files changed

+110
-5
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@props(['user'])
2+
3+
<a href="{{ route('profile', ['username' => $user->username]) }}" class="flex items-start">
4+
<span class="inline-block relative">
5+
<img class="h-8 w-8 rounded-full" src="{{ $user->profile_photo_url }}" alt="{{ $user->name }}">
6+
<span class="absolute bottom-0 right-0 block h-2 w-2 rounded-full ring-2 ring-white bg-green-500"></span>
7+
</span>
8+
<div class="ml-3">
9+
<h4 class="font-medium text-sm leading-5 text-skin-inverted-muted">{{ $user->name }}</h4>
10+
<span class="text-sm leading-5 text-skin-muted">{{ __('Membre depuis :date', ['date' => ucfirst($user->created_at->formatLocalized('%B %Y'))]) }}</span>
11+
</div>
12+
</a>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@props(['article'])
2+
3+
<div class="space-y-8">
4+
<div class="group relative">
5+
<div class="aspect-w-2 aspect-h-1">
6+
<img class="object-cover shadow-md rounded-md" src="{{ $article->getFirstMediaUrl('media') }}" alt="{{ $article->title }}" />
7+
</div>
8+
<span class="absolute inset-x-0 bottom-0 h-1/3 w-full backdrop-blur-md flex justify-between p-6">
9+
<div>
10+
<h4 class="text-white text-sm leading-5">{{ $article->author->name }}</h4>
11+
<time datetime="{{ $article->created_at->format('Y-m-d') }}" class="text-sm leading-5 text-skin-base capitalize">
12+
{{ $article->created_at->isoFormat('LL') }}
13+
</time>
14+
</div>
15+
<div class="flex items-center space-x-3 text-white">
16+
@if ($article->tags->isNotEmpty())
17+
<div class="flex items-center space-x-2">
18+
@foreach ($article->tags as $tag)
19+
<x-tag :tag="$tag" />
20+
@endforeach
21+
</div>
22+
@endif
23+
</div>
24+
</span>
25+
</div>
26+
<div>
27+
<h4 class="text-lg leading-6 font-semibold font-sans text-skin-inverted line-clamp-2 group-hover:text-skin-primary">{{ $article->title }}</h4>
28+
<p class="mt-3 font-normal text-skin-base leading-6 line-clamp-2">
29+
{!! $article->excerpt(100) !!}
30+
</p>
31+
<a href="{{ route('articles.show', $article) }}" class="mt-8 inline-flex items-center text-flag-green hover:text-green-800">
32+
{{ __('Lire l\'article') }}
33+
<x-heroicon-o-external-link class="ml-2.5 h-5 w-5" />
34+
</a>
35+
</div>
36+
</div>

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
<body class="font-sans antialiased bg-skin-body text-skin-base">
4545

4646
<div class="relative overflow-hidden min-h-full">
47-
{{ $slot }}
47+
<x-layouts.admin-menu />
48+
49+
<div class="py-12 lg:pb-20">
50+
{{ $slot }}
51+
</div>
4852
</div>
4953

5054
<x-notifications z-index="z-50" />
Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,62 @@
11
<x-layouts.cp title="Tableau de bord">
2-
<x-layouts.admin-menu />
3-
42
<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>
3+
<div>
4+
<h3 class="text-3xl leading-8 font-medium text-skin-inverted">{{ __('Shalom, :name', ['name' => auth()->user()->name]) }}</h3>
5+
<div class="mt-6 lg:grid lg:grid-cols-5 lg:gap-8">
6+
<div class="lg:col-span-4"></div>
7+
<div class="mt-10 lg:mt-0 lg:col-span-1">
8+
9+
</div>
10+
</div>
11+
</div>
12+
<div class="mt-8">
13+
<div class="pb-5 border-b border-skin-base">
14+
<h3 class="text-lg leading-6 font-medium text-skin-inverted">{{ __('Créer un nouveau contenu') }}</h3>
15+
</div>
16+
<div class="mt-6 lg:grid lg:grid-cols-5 lg:gap-8">
17+
<div class="space-y-8 lg:col-span-4">
18+
<div class="grid gap-5 sm:grid-cols-2 sm:gap-6">
19+
<a href="{{ route('discussions.new') }}" class="group flex p-5 border border-skin-base rounded-md bg-skin-card hover:border-green-300">
20+
<span class="inline-flex items-center justify-center bg-green-50 text-green-800 h-10 w-10 rounded-full">
21+
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24">
22+
<path d="M8 7h8m-4 0v10m-4.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
23+
</svg>
24+
</span>
25+
<div class="ml-3">
26+
<p class="text-base leading-6 font-medium text-skin-inverted-muted group-hover:text-green-600">{{ __('Démarrer une discussion') }}</p>
27+
<p class="mt-0.5 text-sm leading-5 text-skin-muted">{{ __('Partager des sujets qui animent la communauté.') }}</p>
28+
</div>
29+
</a>
30+
<a href="{{ route('articles.new') }}" class="group flex p-5 border border-skin-base rounded-md bg-skin-card hover:border-green-300">
31+
<span class="inline-flex items-center justify-center bg-green-50 text-green-800 h-10 w-10 rounded-full">
32+
<x-heroicon-o-newspaper class="h-5 w-5" />
33+
</span>
34+
<div class="ml-3">
35+
<p class="text-base leading-6 font-medium text-skin-inverted-muted group-hover:text-green-600">{{ __('Créer un nouvel article') }}</p>
36+
<p class="mt-0.5 text-sm leading-5 text-skin-muted">{{ __('Donnez des informations à propos de Laravel, etc.') }}</p>
37+
</div>
38+
</a>
39+
</div>
40+
<div>
41+
<div class="pb-5 border-b border-skin-base">
42+
<h3 class="text-lg leading-6 font-medium text-skin-inverted">{{ __('Derniers articles') }}</h3>
43+
</div>
44+
<div class="mt-6 grid gap-5 sm:grid-cols-2 sm:gap-6">
45+
@foreach($latestArticles as $article)
46+
<x-admin.recent-post :article="$article" />
47+
@endforeach
48+
</div>
49+
</div>
50+
</div>
51+
<div class="lg:col-span-1">
52+
<h5 class="text-sm leading-5 text-skin-base font-medium">{{ __('Nouveaux membres') }}</h5>
53+
<div class="mt-6 space-y-5">
54+
@foreach($users as $user)
55+
<x-admin.new-member :user="$user" />
56+
@endforeach
57+
</div>
58+
</div>
59+
</div>
760
</div>
861
</x-container>
962
</x-layouts.cp>

0 commit comments

Comments
 (0)