|
2 | 2 |
|
3 | 3 | <li x-data="{ open: @entangle('isUpdating') }" @class(['sm:-mx-4 p-4 border border-green-500 rounded-md relative z-10' => $isSolution])>
|
4 | 4 | <div class="sm:flex sm:space-x-3" id="reply-{{ $reply->id }}">
|
5 |
| - <div class="flex items-center font-sans"> |
| 5 | + <div class="flex items-center font-sans sm:items-start"> |
6 | 6 | <div class="flex-shrink-0">
|
7 | 7 | <img class="h-10 w-10 rounded-full" src="{{ $reply->author->profile_photo_url }}" alt="Avatar de {{ $reply->author->username }}">
|
8 | 8 | </div>
|
|
14 | 14 | </div>
|
15 | 15 | </div>
|
16 | 16 | <div x-show="!open" class="flex-1">
|
17 |
| - <div class="hidden sm:flex sm:items-start"> |
18 |
| - <div class="flex items-center flex-1 text-sm space-x-2 font-sans"> |
| 17 | + <div class="flex items-start"> |
| 18 | + <div class="hidden sm:flex sm:items-center flex-1 text-sm space-x-2 font-sans"> |
19 | 19 | <a href="{{ route('profile', $reply->author->username) }}" class="font-medium text-skin-inverted">
|
20 | 20 | {{ $reply->author->name }} <span class="inline-flex text-skin-muted">{{ '@' . $reply->author->username }}</span>
|
21 | 21 | </a>
|
|
31 | 31 | </div>
|
32 | 32 | @endcan
|
33 | 33 | </div>
|
34 |
| - @if ($isSolution) |
35 |
| - <span class="absolute -top-3 z-20 right-3 ml-4 inline-flex items-center px-3 py-0.5 rounded-full text-sm font-medium bg-green-500 text-green-900"> |
36 |
| - <x-heroicon-o-check-circle class="h-4 w-4 mr-1.5" /> |
37 |
| - Réponse acceptée |
38 |
| - </span> |
39 |
| - @else |
40 |
| - @can(App\Policies\ThreadPolicy::UPDATE, $thread) |
41 |
| - <div class="ml-4"> |
| 34 | + @can(App\Policies\ThreadPolicy::UPDATE, $thread) |
| 35 | + @if ($isSolution) |
| 36 | + <div class="mt-2 flex items-center sm:mt-0 sm:ml-4 sm:-mt-3"> |
| 37 | + <button wire:click="UnMarkAsSolution" type="button" class="inline-flex items-center justify-center p-2.5 bg-red-500 bg-opacity-10 text-red-600 text-sm leading-5 rounded-full focus:outline-none transform hover:scale-125 transition-all"> |
| 38 | + <x-heroicon-s-x-circle class="w-6 h-6" /> |
| 39 | + </button> |
| 40 | + <span class="ml-2 text-sm font-sans text-red-500 sm:hidden">Retirer comme solution</span> |
| 41 | + </div> |
| 42 | + @else |
| 43 | + <div class="mt-2 flex items-center sm:mt-0 sm:ml-4 sm:-mt-3"> |
42 | 44 | <button wire:click="markAsSolution" type="button" class="inline-flex items-center justify-center p-2.5 bg-green-500 bg-opacity-10 text-green-600 text-sm leading-5 rounded-full focus:outline-none transform hover:scale-125 transition-all">
|
43 | 45 | <x-heroicon-s-check-circle class="w-6 h-6" />
|
44 | 46 | </button>
|
| 47 | + <span class="ml-2 text-sm font-sans text-green-500 sm:hidden">Marquer comme solution</span> |
45 | 48 | </div>
|
46 |
| - @endcan |
47 |
| - @endif |
| 49 | + @endif |
| 50 | + @else |
| 51 | + @if($isSolution) |
| 52 | + <span class="absolute -top-3 z-20 right-3 ml-4 inline-flex items-center px-3 py-0.5 rounded-full text-sm font-medium bg-green-500 text-green-900"> |
| 53 | + <x-heroicon-o-check-circle class="h-4 w-4 mr-1.5" /> |
| 54 | + Réponse acceptée |
| 55 | + </span> |
| 56 | + @endif |
| 57 | + @endcan |
48 | 58 | </div>
|
49 | 59 | <div class="mt-1 font-normal prose sm:prose-base prose-green text-skin-base overflow-x-auto sm:max-w-none">
|
50 | 60 | <x-markdown-content :content="$reply->body" />
|
|
0 commit comments