Skip to content

Commit 3cf9adc

Browse files
feat:[lar-138] lint code , add traduction , move skeleton to file , etc....
1 parent 16fdbff commit 3cf9adc

File tree

12 files changed

+58
-101
lines changed

12 files changed

+58
-101
lines changed

app/Actions/Article/ArticleDeleteAction.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

lang/en/pages/discussion.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@
4141
'min_discussion_length' => '160 characters maximum',
4242
'placeholder' => 'Your comment here...',
4343
'your_discussion' => 'Your discussion',
44-
'write_discussion' => 'Write discussion',
4544

4645
];

lang/en/pages/forum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@
4242
'threads_count' => ':count messages',
4343
'your_thread' => 'Your thread',
4444
'not_thread_created' => "You haven't created any topic yet",
45+
'subject' => 'Subject',
4546

4647
];

lang/fr/pages/discussion.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@
4141
'min_discussion_length' => 'Maximum de 160 caractères.',
4242
'placeholder' => 'Votre commentaire',
4343
'your_discussion' => 'Vos Discussions',
44-
'write_discussion' => 'Rédiger une discussion',
4544

4645
];

lang/fr/pages/forum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@
4242
'threads_count' => ':count messages',
4343
'your_thread' => 'Vos Sujets',
4444
'not_thread_created' => "Vous n'avez pas encore créé de sujet",
45+
'subject' => 'Sujets',
4546

4647
];

resources/views/components/discussions/overview.blade.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
'discussion',
33
'hiddenAuthor' => false,
44
'displayButton' => false,
5-
'displayClass' => true
65
])
76

8-
<div @if($displayClass) class="py-6" @endif >
7+
<div {{ $attributes->get('class', '') }}" >
98
@if ($discussion->tags->isNotEmpty())
109
<div class="flex items-center space-x-2 mb-4">
1110
<div class="flex-1">
@@ -36,7 +35,7 @@
3635
{{ $discussion->title }}
3736
</x-link>
3837
</h2>
39-
<p class="mt-2 text-gray-500 dark:text-white line-clamp-2">
38+
<p class="mt-2 text-gray-500 dark:text-gray-300 line-clamp-2">
4039
{!! $discussion->excerpt(175) !!}
4140
</p>
4241

resources/views/components/forum/thread-channels.blade.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
'displayButton' => false
44
])
55
<div {{ $attributes->twMerge(['class' => 'flex items-center mb-2 flex-wrap gap-1.5']) }}>
6+
67
@if (count($channels = $thread->channels->load('parent')))
7-
@foreach ($channels as $channel)
8-
@php
9-
$color = $channel->parent_id ? $channel->parent->color : $channel->color;
10-
@endphp
11-
<x-link :href="route('forum.channels', $channel)" class="flex gap-2">
12-
<x-forum.channel
13-
:channel="$channel"
14-
class="text-xs is-channel is-{{ $channel->slug }}"
15-
style="--channel-color: {{ $color }}"
16-
/>
17-
</x-link>
18-
@endforeach
8+
@foreach ($channels as $channel)
9+
@php
10+
$color = $channel->parent_id ? $channel->parent->color : $channel->color;
11+
@endphp
12+
<x-link :href="route('forum.channels', $channel)" class="flex gap-2">
13+
<x-forum.channel
14+
:channel="$channel"
15+
class="text-xs is-channel is-{{ $channel->slug }}"
16+
style="--channel-color: {{ $color }}"
17+
/>
18+
</x-link>
19+
@endforeach
1920
@endif
21+
2022
@if($displayButton && isset($this->deleteAction) || isset($this->editAction))
2123
<div class="ml-auto">
2224
@can('update', $thread)
@@ -29,4 +31,5 @@ class="text-xs is-channel is-{{ $channel->slug }}"
2931
<x-filament-actions::modals />
3032
</div>
3133
@endif
34+
3235
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<div class="rounded-xl mb-8 p-6 bg-white transition duration-200 ease-in-out dark:bg-gray-800 animate-pulse">
2+
3+
<div class="flex items-center space-x-2 mb-4">
4+
<div class="h-7 w-20 bg-gray-200 dark:bg-gray-700 rounded-lg"></div>
5+
<div class="h-7 w-24 bg-gray-200 dark:bg-gray-700 rounded-lg"></div>
6+
</div>
7+
8+
<div class="h-7 w-3/4 bg-gray-200 dark:bg-gray-700 rounded-lg mb-4"></div>
9+
10+
<div class="space-y-2">
11+
<div class="h-4 w-full bg-gray-200 dark:bg-gray-700 rounded"></div>
12+
<div class="h-4 w-5/6 bg-gray-200 dark:bg-gray-700 rounded"></div>
13+
</div>
14+
15+
<div class="mt-4 sm:flex sm:justify-between">
16+
<div class="flex items-center">
17+
<div class="h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full"></div>
18+
<div class="ml-2 h-4 w-40 bg-gray-200 dark:bg-gray-700 rounded"></div>
19+
</div>
20+
21+
<div class="hidden sm:flex sm:items-center">
22+
<div class="h-4 w-16 bg-gray-200 dark:bg-gray-700 rounded"></div>
23+
</div>
24+
</div>
25+
</div>

resources/views/livewire/components/account/articles.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function editAction(): Action
3737
{
3838
return Action::make('edit')
3939
->label(__('actions.edit'))
40-
->color('warning')
40+
->color('gray')
4141
->action(
4242
fn (array $arguments) => $this->dispatch(
4343
'openPanel',
@@ -56,7 +56,7 @@ public function deleteAction(): Action
5656
->action(function (array $arguments): void {
5757
$article = Article::query()->find($arguments['article']);
5858
59-
app(ArticleDeleteAction::class)->execute($article);
59+
$article->delete();
6060
6161
Notification::make()
6262
->success()

resources/views/livewire/components/account/discussions.blade.php

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,40 +35,14 @@ public function discussions(): LengthAwarePaginator
3535
3636
public function placeholder(): string
3737
{
38-
return <<<'HTML'
39-
<div class="rounded-xl mb-8 p-6 bg-white transition duration-200 ease-in-out dark:bg-gray-800 animate-pulse">
40-
41-
<div class="flex items-center space-x-2 mb-4">
42-
<div class="h-7 w-20 bg-gray-200 dark:bg-gray-700 rounded-lg"></div>
43-
<div class="h-7 w-24 bg-gray-200 dark:bg-gray-700 rounded-lg"></div>
44-
</div>
45-
46-
<div class="h-7 w-3/4 bg-gray-200 dark:bg-gray-700 rounded-lg mb-4"></div>
47-
48-
<div class="space-y-2">
49-
<div class="h-4 w-full bg-gray-200 dark:bg-gray-700 rounded"></div>
50-
<div class="h-4 w-5/6 bg-gray-200 dark:bg-gray-700 rounded"></div>
51-
</div>
52-
53-
<div class="mt-4 sm:flex sm:justify-between">
54-
<div class="flex items-center">
55-
<div class="h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full"></div>
56-
<div class="ml-2 h-4 w-40 bg-gray-200 dark:bg-gray-700 rounded"></div>
57-
</div>
58-
59-
<div class="hidden sm:flex sm:items-center">
60-
<div class="h-4 w-16 bg-gray-200 dark:bg-gray-700 rounded"></div>
61-
</div>
62-
</div>
63-
</div>
64-
HTML;
38+
return view('components.skeletons.account');
6539
}
6640
6741
public function editAction(): Action
6842
{
6943
return Action::make('edit')
7044
->label(__('actions.edit'))
71-
->color('warning')
45+
->color('gray')
7246
->action(
7347
fn(array $arguments) => $this->dispatch(
7448
'openPanel',
@@ -123,7 +97,7 @@ class="gap-2 w-full justify-center py-2.5">
12397
<div
12498
class="rounded-xl mb-8 p-6 cursor-pointer bg-white transition duration-200 ease-in-out dark:bg-gray-800 dark:ring-gray-800 dark:hover:bg-white/10 lg:py-5 lg:px-6">
12599
<x-discussions.overview :discussion="$discussion" :hiddenAuthor="false" :displayButton="true"
126-
:displayClass="false" />
100+
class="py-6" />
127101
</div>
128102
@endforeach
129103
</div>

resources/views/livewire/components/account/threads.blade.php

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
1818
new class extends Component implements HasForms, HasActions {
1919
20-
use WithPagination, WithoutUrlPagination;
20+
use WithPagination;
21+
use WithoutUrlPagination;
2122
use InteractsWithActions;
2223
use InteractsWithForms;
2324
@@ -33,40 +34,14 @@ public function threads(): LengthAwarePaginator
3334
3435
public function placeholder(): string
3536
{
36-
return <<<'HTML'
37-
<div class="rounded-xl mb-8 p-6 bg-white transition duration-200 ease-in-out dark:bg-gray-800 animate-pulse">
38-
39-
<div class="flex items-center space-x-2 mb-4">
40-
<div class="h-7 w-20 bg-gray-200 dark:bg-gray-700 rounded-lg"></div>
41-
<div class="h-7 w-24 bg-gray-200 dark:bg-gray-700 rounded-lg"></div>
42-
</div>
43-
44-
<div class="h-7 w-3/4 bg-gray-200 dark:bg-gray-700 rounded-lg mb-4"></div>
45-
46-
<div class="space-y-2">
47-
<div class="h-4 w-full bg-gray-200 dark:bg-gray-700 rounded"></div>
48-
<div class="h-4 w-5/6 bg-gray-200 dark:bg-gray-700 rounded"></div>
49-
</div>
50-
51-
<div class="mt-4 sm:flex sm:justify-between">
52-
<div class="flex items-center">
53-
<div class="h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full"></div>
54-
<div class="ml-2 h-4 w-40 bg-gray-200 dark:bg-gray-700 rounded"></div>
55-
</div>
56-
57-
<div class="hidden sm:flex sm:items-center">
58-
<div class="h-4 w-16 bg-gray-200 dark:bg-gray-700 rounded"></div>
59-
</div>
60-
</div>
61-
</div>
62-
HTML;
37+
return view('components.skeletons.account');
6338
}
6439
6540
public function editAction(): Action
6641
{
6742
return Action::make('edit')
6843
->label(__('actions.edit'))
69-
->color('warning')
44+
->color('gray')
7045
->action(
7146
fn(array $arguments) => $this->dispatch(
7247
'openPanel',

resources/views/user/threads.blade.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@
33
<div>
44
<x-status-message class="mb-5" />
55

6-
<x-user.breadcrumb section="Sujets" />
6+
<x-user.breadcrumb section="{{ __('pages/forum.subject') }}" />
77

8-
<h2 class="font-heading text-xl font-bold leading-7 text-gray-900 sm:truncate sm:text-2xl">Sujets</h2>
8+
<h2 class="font-heading text-xl font-bold leading-7 text-gray-900 sm:truncate sm:text-2xl">{{ __('pages/forum.subject') }}</h2>
99
</div>
1010

1111
<section class="relative mt-8 lg:grid lg:grid-cols-12 lg:gap-12">
1212
<div class="hidden lg:col-span-3 lg:block">
1313
<x-user.sidebar :user="$user" />
1414
</div>
1515
<main class="lg:col-span-9">
16-
<x-user.page-heading title="Vos sujets" url="#" :button="__('Nouveau sujet')" />
16+
<x-user.page-heading title="{{ __('pages/forum.your_thread') }}" url="#"
17+
:button="{{ __('pages/forum.new_thread') }}" />
1718

1819
<div class="flex items-center space-x-3">
1920
@forelse ($threads as $thread)
2021
<x-forum.thread :thread="$thread" />
2122
@empty
22-
<p class="text-base text-gray-500 dark:text-gray-400">Vous n'avez pas encore créé de sujets.</p>
23+
<p class="text-base text-gray-500 dark:text-gray-400">{{ __('pages/forum.not_thread_created') }}</p>
2324
@endforelse
2425

2526
<div class="pt-5">

0 commit comments

Comments
 (0)