Skip to content

Commit 9ff4489

Browse files
committed
breakdown into components
1 parent 4d5185f commit 9ff4489

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p class="text-center text-sm text-gray-500 my-6">{{ __('No user found') }}</p>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<li>
2+
<div class="flex items-center justify-between w-full p-2 space-x-3 text-left border border-gray-300 rounded-full shadow-sm group">
3+
<span class="flex items-center flex-1 min-w-0 space-x-3">
4+
<span class="flex-shrink-0 block">
5+
<x-backstate::avatar.single
6+
class="h-10 w-10 rounded-full"
7+
:title="$user->name"
8+
:label="$user->initials"
9+
:photoUrl="$user->profile_photo_url"
10+
/>
11+
</span>
12+
<span class="flex-1 block min-w-0">
13+
<span class="block text-sm font-medium text-gray-900 truncate">{{ $user->name }}</span>
14+
<span class="block text-sm font-medium text-gray-500 truncate">{{ $user->tagline }}</span>
15+
</span>
16+
</span>
17+
<span class="inline-flex items-center justify-center flex-shrink-0 w-10 h-10">
18+
{{ $slot }}
19+
</span>
20+
</div>
21+
</li>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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

Comments
 (0)