| 
1 | 1 | @props(['thread'])  | 
2 | 2 | 
 
  | 
3 |  | -@canany([App\Policies\ThreadPolicy::UPDATE, App\Policies\ThreadPolicy::DELETE], $thread)  | 
4 |  | -    <div class="flex items-center gap-x-3">  | 
5 |  | -        <div class="relative -mr-3" x-data="{ open: false }" @click.outside="open = false">  | 
6 |  | -            <button  | 
7 |  | -                class="p-2 rounded hover:bg-gray-100"  | 
8 |  | -                @click="open = !open"  | 
9 |  | -            >  | 
10 |  | -                <x-heroicon-o-ellipsis-horizontal class="w-6 h-6" />  | 
11 |  | -            </button>  | 
 | 3 | +@canany([App\Policies\ThreadPolicy::LOCK, App\Policies\ThreadPolicy::UPDATE, App\Policies\ThreadPolicy::DELETE], $thread)  | 
 | 4 | +    <div class="relative flex items-center -mr-3" x-data="{ open: false }" @click.outside="open = false">  | 
 | 5 | +        <button  | 
 | 6 | +            class="inline-block p-2 rounded hover:bg-gray-100"  | 
 | 7 | +            @click="open = !open"  | 
 | 8 | +        >  | 
 | 9 | +            <x-heroicon-o-ellipsis-horizontal class="w-6 h-6" />  | 
 | 10 | +        </button>  | 
12 | 11 | 
 
  | 
13 |  | -            <div  | 
14 |  | -                x-cloak  | 
15 |  | -                x-show="open"  | 
16 |  | -                class="absolute top-12 right-1 flex flex-col bg-white rounded shadow w-48"  | 
17 |  | -            >  | 
18 |  | -                @can(App\Policies\ThreadPolicy::LOCK, $thread)  | 
19 |  | -                    <x-buk-form-button class="flex gap-x-2 p-3 w-full rounded hover:bg-gray-100" action="{{ route('threads.lock', $thread->slug()) }}">  | 
20 |  | -                        @if ($thread->isLocked())  | 
21 |  | -                            <x-heroicon-o-lock-closed class="w-6 h-6"/>  | 
22 |  | -                            Unlock  | 
23 |  | -                        @else  | 
24 |  | -                            <x-heroicon-o-lock-open class="w-6 h-6"/>  | 
25 |  | -                            Lock  | 
26 |  | -                        @endif  | 
27 |  | -                    </x-buk-form-button>  | 
28 |  | -                @endcan  | 
 | 12 | +        <div  | 
 | 13 | +            x-cloak  | 
 | 14 | +            x-show="open"  | 
 | 15 | +            class="absolute top-12 right-1 flex flex-col bg-white rounded shadow w-48"  | 
 | 16 | +        >  | 
 | 17 | +            @can(App\Policies\ThreadPolicy::LOCK, $thread)  | 
 | 18 | +                <x-buk-form-button class="flex gap-x-2 p-3 w-full rounded hover:bg-gray-100" action="{{ route('threads.lock', $thread->slug()) }}">  | 
 | 19 | +                    @if ($thread->isLocked())  | 
 | 20 | +                        <x-heroicon-o-lock-closed class="w-6 h-6"/>  | 
 | 21 | +                        Unlock  | 
 | 22 | +                    @else  | 
 | 23 | +                        <x-heroicon-o-lock-open class="w-6 h-6"/>  | 
 | 24 | +                        Lock  | 
 | 25 | +                    @endif  | 
 | 26 | +                </x-buk-form-button>  | 
 | 27 | +            @endcan  | 
29 | 28 | 
 
  | 
30 |  | -                @can(App\Policies\ThreadPolicy::UPDATE, $thread)  | 
31 |  | -                    <a class="flex gap-x-2 p-3 rounded hover:bg-gray-100" href="{{ route('threads.edit', $thread->slug()) }}">  | 
32 |  | -                        <x-heroicon-o-pencil class="w-6 h-6"/>  | 
33 |  | -                        Edit  | 
34 |  | -                    </a>  | 
35 |  | -                @endcan  | 
 | 29 | +            @can(App\Policies\ThreadPolicy::UPDATE, $thread)  | 
 | 30 | +                <a class="flex gap-x-2 p-3 rounded hover:bg-gray-100" href="{{ route('threads.edit', $thread->slug()) }}">  | 
 | 31 | +                    <x-heroicon-o-pencil class="w-6 h-6"/>  | 
 | 32 | +                    Edit  | 
 | 33 | +                </a>  | 
 | 34 | +            @endcan  | 
36 | 35 | 
 
  | 
37 |  | -                @can(App\Policies\ThreadPolicy::DELETE, $thread)  | 
38 |  | -                    <button class="flex gap-x-2 p-3 rounded hover:bg-gray-100" @click="activeModal = 'deleteThread'">  | 
39 |  | -                        <x-heroicon-o-trash class="w-6 h-6 text-red-500"/>  | 
40 |  | -                        Delete  | 
41 |  | -                    </button>  | 
42 |  | -                @endcan  | 
43 |  | -            </div>  | 
 | 36 | +            @can(App\Policies\ThreadPolicy::DELETE, $thread)  | 
 | 37 | +                <button class="flex gap-x-2 p-3 rounded hover:bg-gray-100" @click="activeModal = 'deleteThread'">  | 
 | 38 | +                    <x-heroicon-o-trash class="w-6 h-6 text-red-500"/>  | 
 | 39 | +                    Delete  | 
 | 40 | +                </button>  | 
 | 41 | +            @endcan  | 
44 | 42 |         </div>  | 
45 | 43 |     </div>  | 
46 | 44 | 
 
  | 
 | 
0 commit comments