|
| 1 | +<div> |
| 2 | + @if ($usersWithPermission->isNotEmpty()) |
| 3 | + <div class="mb-6"> |
| 4 | + <h3 class="text-xs font-semibold tracking-wide text-gray-500 uppercase">{{ __('Users with permission') }}</h3> |
| 5 | + <ul role="list" class="grid grid-cols-1 gap-4 mt-4 sm:grid-cols-3"> |
| 6 | + @foreach ($usersWithPermission as $user) |
| 7 | + <x-permissions::user :user="$user"> |
| 8 | + <button |
| 9 | + class="rounded-full hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green" |
| 10 | + wire:click.prevent="revoke('{{ $user->id }}')" |
| 11 | + > |
| 12 | + <!-- Heroicon name: solid/trash --> |
| 13 | + <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> |
| 14 | + <path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" /> |
| 15 | + </svg> |
| 16 | + </button> |
| 17 | + </x-permissions::user> |
| 18 | + @endforeach |
| 19 | + </ul> |
| 20 | + </div> |
| 21 | + @endif |
| 22 | + |
| 23 | + <div class="block"> |
| 24 | + <p class="mt-1 text-sm text-gray-500"> |
| 25 | + {{ __('Search for an e-mail or user name.') }} |
| 26 | + </p> |
| 27 | + <div class="sm:flex sm:items-center"> |
| 28 | + <label for="emails" class="sr-only">@lang('Search for')</label> |
| 29 | + <div class="relative sm:min-w-0 sm:flex-1"> |
| 30 | + <input type="text" name="emails" id="emails" class="rounded-md shadow-sm block w-full pr-32 border-gray-300 focus:ring-green-500 focus:border-green-500 sm:text-sm" wire:model="query" placeholder="Enter a name or email"> |
| 31 | + </div> |
| 32 | + <div class="mt-3 sm:mt-0 sm:ml-4 sm:flex-shrink-0"> |
| 33 | + <button |
| 34 | + type="submit" |
| 35 | + wire:click.prevent="search" |
| 36 | + wire:loading.attr="disabled" |
| 37 | + class="block w-full px-4 py-2 text-sm font-medium text-center text-white bg-green border border-transparent rounded-md shadow-sm hover:bg-green focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500" |
| 38 | + > |
| 39 | + {{ __('Find') }} |
| 40 | + </button> |
| 41 | + </div> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + |
| 45 | + @if ($eligebleForPermission->isNotEmpty()) |
| 46 | + <div class="mt-10"> |
| 47 | + <h3 class="text-xs font-semibold tracking-wide text-gray-500 uppercase">{{ __('Users found') }}</h3> |
| 48 | + <ul role="list" class="grid grid-cols-1 gap-4 mt-4 sm:grid-cols-2"> |
| 49 | + @foreach ($eligebleForPermission as $user) |
| 50 | + <x-permissions::user :user="$user"> |
| 51 | + <button |
| 52 | + class="rounded-full hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green" |
| 53 | + wire:click.prevent="grant('{{ $user->id }}')" |
| 54 | + > |
| 55 | + <!-- Heroicon name: solid/plus --> |
| 56 | + <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> |
| 57 | + <path fill-rule="evenodd" d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z" clip-rule="evenodd" /> |
| 58 | + </svg> |
| 59 | + </button> |
| 60 | + </x-permissions::user> |
| 61 | + @endforeach |
| 62 | + </ul> |
| 63 | + </div> |
| 64 | + @elseif($isSearching) |
| 65 | + <x-permissions::empty-list /> |
| 66 | + @endif |
| 67 | +</div> |
0 commit comments