|
18 | 18 | <div class="container mx-auto px-4 pt-4"> |
19 | 19 | <div class="flex flex-wrap"> |
20 | 20 | <div class="w-full md:w-3/4 md:pr-3"> |
21 | | - <div class="reply bg-white p-4 border rounded"> |
22 | | - <div> |
23 | | - <reply :content="{{ json_encode(md_to_html($thread->body())) }}"/> |
24 | | - </div> |
25 | | - |
26 | | - <div class="flex flex-col md:flex-row md:items-center text-sm pt-5 border-t mt-4"> |
| 21 | + <div class="reply bg-white border rounded"> |
| 22 | + <div class="flex flex-col md:flex-row md:items-center text-sm p-4 border-b"> |
27 | 23 | <div class="flex mb-4 md:mb-0"> |
28 | 24 | @include('forum.threads.info.avatar', ['user' => $thread->author()]) |
29 | 25 |
|
|
35 | 31 |
|
36 | 32 | @include('forum.threads.info.tags') |
37 | 33 | </div> |
38 | | - |
| 34 | + <div class="p-4"> |
| 35 | + <reply :content="{{ json_encode(md_to_html($thread->body())) }}"/> |
| 36 | + </div> |
| 37 | + <div class="border-t"> |
| 38 | + @include('forum.threads.info.likes', [ |
| 39 | + 'like'=> ['threads.like', $thread->slug()], |
| 40 | + 'unlike' => ['threads.unlike', $thread->slug()], |
| 41 | + 'likeable' => $thread |
| 42 | + ]) |
| 43 | + </div> |
39 | 44 | </div> |
40 | 45 |
|
41 | 46 | <div class="mt-4"> |
|
51 | 56 | </div> |
52 | 57 | @endif |
53 | 58 |
|
54 | | - <div class="p-4"> |
55 | | - <div> |
56 | | - <reply :content="{{ json_encode(md_to_html($reply->body())) }}"/> |
57 | | - </div> |
58 | | - <div class="flex flex-col md:flex-row md:items-center text-sm pt-5 border-t mt-4"> |
59 | | - <div class="flex flex-wrap mb-4 md:mb-0 justify-between w-full"> |
| 59 | + <div> |
| 60 | + <div class="flex flex-col md:flex-row md:items-center text-sm p-4 border-b"> |
| 61 | + <div class="flex flex-wrap mb-4 md:mb-0 justify-between w-full items-center"> |
60 | 62 | <div class="flex"> |
61 | 63 | @include('forum.threads.info.avatar', ['user' => $reply->author()]) |
62 | 64 |
|
|
108 | 110 | </div> |
109 | 111 | </div> |
110 | 112 | </div> |
111 | | - @endcan |
112 | | - <div class="thread-info-likes"> |
113 | | - @if(!$reply->isLikedBy(auth()->user())) |
114 | | - {{ Form::open(['route' => ['replies.like', $reply], 'method' => 'PUT']) }} |
115 | | - <span>{{$reply->likes_count}}</span> |
116 | | - {{ Form::submit('like', ['class' => 'btn btn-xs btn-success']) }} |
117 | | - {{ Form::close() }} |
118 | | - @else |
119 | | - {{ Form::open(['route' => ['replies.dislike', $reply], 'method' => 'DELETE']) }} |
120 | | - <span>{{$reply->likes_count}}</span> |
121 | | - {{ Form::submit('dislike', ['class' => 'btn btn-xs btn-danger']) }} |
122 | | - {{ Form::close() }} |
123 | | - @endif |
124 | | - </div> |
125 | | - @endcan |
126 | | - @auth |
127 | | - <div class="thread-info-likes"> |
128 | | - <like></like> |
| 113 | + <div class="p-4"> |
| 114 | + <reply :content="{{ json_encode(md_to_html($reply->body())) }}"/> |
| 115 | + </div> |
| 116 | + <div class="border-t"> |
| 117 | + @include('forum.threads.info.likes', [ |
| 118 | + 'like'=> ['replies.like', $reply], |
| 119 | + 'unlike' => ['replies.unlike', $reply], |
| 120 | + 'likeable' => $reply |
| 121 | + ]) |
129 | 122 | </div> |
130 | | - @endauth |
| 123 | + </div> |
131 | 124 | </div> |
132 | 125 |
|
133 | 126 | @include('_partials._delete_modal', [ |
|
0 commit comments