File tree Expand file tree Collapse file tree 8 files changed +57
-42
lines changed Expand file tree Collapse file tree 8 files changed +57
-42
lines changed Original file line number Diff line number Diff line change @@ -84,13 +84,11 @@ public function list(Request $request)
84
84
->orderBy ('id ' , 'desc ' )
85
85
->cursorPaginate (3 );
86
86
87
- $ test = view ('particles.posts.list ' , [
87
+ return view ('particles.posts.list ' , [
88
88
'posts ' => $ posts ,
89
89
'isMyProfile ' => $ request ->has ('user_id ' ) && $ request ->user ()?->id == $ request ->get ('user_id ' ),
90
90
'action ' => $ this ->action
91
91
])->fragmentsIf (!$ request ->isMethodSafe ());
92
-
93
- return $ test ;
94
92
}
95
93
96
94
}
Original file line number Diff line number Diff line change 7
7
use Illuminate \Auth \Access \Response ;
8
8
use Illuminate \Database \Eloquent \Model ;
9
9
10
- trait OwnerPolicy
10
+ trait HasOwner
11
11
{
12
12
use HandlesAuthorization;
13
13
Original file line number Diff line number Diff line change 4
4
5
5
class PostPolicy
6
6
{
7
- use OwnerPolicy;
8
-
7
+ use HasOwner;
9
8
}
Original file line number Diff line number Diff line change @@ -543,3 +543,18 @@ main {
543
543
display : block ;
544
544
}
545
545
546
+
547
+
548
+ @keyframes fade-in {
549
+ 0% {
550
+ opacity : 0 ;
551
+ }
552
+ 100% {
553
+ opacity : 1 ;
554
+ }
555
+ }
556
+
557
+ .hotwire-frame {
558
+ opacity : 0 ;
559
+ animation : fade- in 0.5s ease-in-out forwards ;
560
+ }
Original file line number Diff line number Diff line change 14
14
<div class =" d-sm-flex align-items-start text-center text-sm-start" >
15
15
<div >
16
16
<!-- Avatar -->
17
- <div class =" avatar avatar-xxl mt-n5 mb-3" >
17
+ <div class =" avatar avatar-xxl mt-n5 mb-3 mx-auto " >
18
18
<img class =" avatar-img rounded-circle border border-tertiary-subtle border-3"
19
19
src =" {{ $user -> avatar } }" alt =" " >
20
20
</div >
28
28
<small class =" opacity-75" >На проекте с 23 мая 2022</small >
29
29
</div >
30
30
31
- <div class =" d-flex flex-column my-3 ms-sm-auto " >
31
+
32
+ <div class =" d-flex flex-column my-3 ms-sm-auto" >
32
33
33
34
34
35
@if ($isMyAccount )
35
- <x-logout class =" btn btn-link" formId =" sign-out" >
36
- <x-icon path =" bs.logout" class =" pe-1" />
37
- Выйти из профиля
38
- </x-logout >
39
- <a href =" {{ route (' my.edit' )} }" class =" btn btn-danger" >
40
- <x-icon path =" bs.pencil-fill" class =" pe-1" />
41
- Редактировать
42
- </a >
36
+ <div class =" d-flex" >
37
+ <x-logout class =" btn btn-link" formId =" sign-out" title =" Выйти" >
38
+ <x-icon path =" bs.door-closed" />
39
+ </x-logout >
40
+ <a href =" {{ route (' my.edit' )} }" class =" btn btn-danger" >
41
+ <x-icon path =" bs.pencil-fill" class =" pe-1" />
42
+ Редактировать
43
+ </a >
44
+ </div >
43
45
@else
44
- <a href =" https://github.com/{{ $user -> nickname } }" class =" d-block mb-2 " >
45
- <x-icon path =" bs.github" width =" 1.5em " height =" 1.5em " class = " pe-1 " />
46
+ <a href =" https://github.com/{{ $user -> nickname } }" class =" d-block" >
47
+ <x-icon path =" bs.github" width =" 2em " height =" 2em " />
46
48
</a >
47
-
48
-
49
49
@endif
50
50
</div >
51
51
</div >
52
52
53
+ <div class =" " >
54
+ {!! \Illuminate \Support \Str:: of ($user -> about )-> markdown () ! !}
55
+ </div >
56
+
53
57
</div >
54
58
</div >
55
59
Original file line number Diff line number Diff line change 3
3
@section (' tab' )
4
4
@if ($comments -> isEmpty () )
5
5
@if ($isMyAccount )
6
- <div class =" bg-body-tertiary rounded p-5" >
6
+ <div class =" bg-body-tertiary rounded p-5 rounded " >
7
7
<div class =" p-5" >
8
8
<div class =" text-center mb-3" >
9
9
Вы не написали ни одного комментария
14
14
</div >
15
15
</div >
16
16
@else
17
- <div class =" bg-body-tertiary rounded p-5" >
17
+ <div class =" bg-body-tertiary rounded p-5 rounded " >
18
18
<div class =" p-5" >
19
19
<div class =" text-center mb-3" >
20
20
Этот пользователь не оставил ни одного комментария
24
24
@endif
25
25
@else
26
26
27
-
28
- <turbo-frame id =" comments-frame" >
29
- <x-stream target =" comments" >
30
- <div class =" col-xl-8 col-md-12 mx-auto mt-5 mb-3" >
31
- <div class =" bg-body-tertiary overflow-hidden px-5 py-3" >
32
- @foreach ($comments as $comment )
33
- @include (' pages.profile.tabs.particles.comments.comment' , [
34
- ' comment' => $comment ,
35
- ' edit' => $edit ?? null ,
36
- ] )
37
- @endforeach
38
- </div >
27
+ <turbo-frame id =" comments-frame" >
28
+ <x-stream target =" comments" >
29
+ <div class =" col-xl-8 col-md-12 mx-auto mb-3" >
30
+ <div class =" bg-body-tertiary overflow-hidden px-5 py-3 rounded" >
31
+ @foreach ($comments as $comment )
32
+ @include (' pages.profile.tabs.particles.comments.comment' , [
33
+ ' comment' => $comment ,
34
+ ' edit' => $edit ?? null ,
35
+ ] )
36
+ @endforeach
39
37
</div >
40
- </x-stream >
41
- </turbo-frame >
38
+ </div >
39
+ </x-stream >
40
+ </turbo-frame >
42
41
@endif
43
42
@endsection
Original file line number Diff line number Diff line change 1
1
<turbo-frame id =" posts-frame" data-turbo-temporary >
2
- <x-stream target =" posts" action =" {{ $action } }" class =" col-xl-8 col-md-12 mx-auto" >
2
+ <x-stream target =" posts" action =" {{ $action } }" class =" col-xl-8 col-md-12 mx-auto hotwire-frame " >
3
3
@if ($posts -> isEmpty () )
4
- <div class =" bg-body-tertiary rounded p-5" >
4
+ <div class =" bg-body-tertiary rounded p-5 rounded " >
5
5
<div class =" p-5" >
6
6
@if ($isMyProfile )
7
7
<div class =" text-center mb-3" >
21
21
</div >
22
22
@else
23
23
@foreach ($posts as $post )
24
- <div class =" bg-body-tertiary mb-4 px-5 py-4" >
24
+ <div class =" bg-body-tertiary mb-4 px-5 py-4 rounded " >
25
25
26
26
<div class =" d-flex align-items-center justify-content-between mb-3" >
27
27
<div class =" d-flex align-items-center" >
@@ -59,13 +59,13 @@ class="text-body-secondary text-decoration-none">{{ $post->user->name }}</a>
59
59
</div >
60
60
</div >
61
61
62
- <div class =" position-relative" >
62
+ <div class =" position-relative post " >
63
63
<a href =" {{ route (' post.show' , $post ) } }"
64
64
class =" position-absolute start-0 end-0 top-0 bottom-0" ></a >
65
65
66
66
<h4 class =" mb-3" >{{ $post -> title } } </h4 >
67
67
68
- <p >{{ $post -> preview () } } </p >
68
+ <p >{!! \ Illuminate \ Support \Str :: of ( $post -> content ) -> markdown () ! !} </p >
69
69
</div >
70
70
71
71
<div class =" d-flex align-items-center mt-4" >
Original file line number Diff line number Diff line change 36
36
37
37
<div class =" container my-5" >
38
38
<div class =" row" >
39
- <turbo-frame id =" posts-frame" target =" _top" src =" {{ route (' feed.articles ' ) } }" />
39
+ <turbo-frame id =" posts-frame" target =" _top" src =" {{ route (' posts ' ) } }" />
40
40
</div >
41
41
</div >
42
42
@endsection
You can’t perform that action at this time.
0 commit comments