Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Commit d2fe5cb

Browse files
committed
adding add button
1 parent 1be85e4 commit d2fe5cb

File tree

3 files changed

+48
-30
lines changed

3 files changed

+48
-30
lines changed

resources/views/permission-ui/permission.blade.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
@if(!$permission->id) {{ __('New') }} @endif
44
{{ __('Permission') }}
55
@if($permission->id): {{ $permission->name }} @endif
6+
@if($permission->id)
7+
<a href="{{ route('permission') }}" class="float-right bg-blue-500 text-white font-bold uppercase text-xs px-4 py-2 rounded shadow hover:shadow-md outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150" type="button">
8+
+ {{ __('New') }}
9+
</a>
10+
@endif
611
</h2>
712
</x-slot>
813
<div class="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">
@@ -13,9 +18,9 @@
1318

1419
<x-slot name="description">
1520
{{ __('Permissions can have a dotted notation') }}
16-
<br/>
21+
<br/>
1722
@verbatim
18-
<br />@can(@endverbatim'{{ $permission->name }}'@verbatim)<br/>
23+
<br/>@can(@endverbatim'{{ $permission->name }}'@verbatim)<br/>
1924
&nbsp;&nbsp;//<br/>
2025
@endcan<br/>
2126
@endverbatim

resources/views/user-ui/role.blade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
@if(!$role->id) {{ __('New') }} @endif
44
{{ __('Role') }}
55
@if($role->id): {{ $role->name }} @endif
6+
@if($role->id)
7+
<a href="{{ route('role.edit') }}" class="float-right bg-blue-500 text-white font-bold uppercase text-xs px-4 py-2 rounded shadow hover:shadow-md outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150" type="button">
8+
+ {{ __('New') }}
9+
</a>
10+
@endif
611
</h2>
712
</x-slot>
813
<div class="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">

resources/views/user-ui/user.blade.php

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
@if(!$user->id) {{ __('New') }} @endif
44
{{ __('User') }}
55
@if($user->id): {{ $user->name }} @endif
6+
@if($user->id)
7+
<a href="{{ route('users.edit') }}" class="float-right bg-blue-500 text-white font-bold uppercase text-xs px-4 py-2 rounded shadow hover:shadow-md outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150" type="button">
8+
+ {{ __('New') }}
9+
</a>
10+
@endif
611
</h2>
712
</x-slot>
813

@@ -28,10 +33,10 @@
2833
<x-jet-input-error for="user.email" class="mt-2"/>
2934
</div>
3035
<div class="col-span-6 sm:col-span-4">
31-
<x-jet-label for="role" value="{{ __('Role') }}"/>
32-
<div class="bg-white rounded-md -space-y-px">
33-
@foreach($roles as $role)
34-
<!-- Checked: "bg-indigo-50 border-indigo-200 z-10", Not Checked: "border-gray-200" -->
36+
<x-jet-label for="role" value="{{ __('Role') }}"/>
37+
<div class="bg-white rounded-md -space-y-px">
38+
@foreach($roles as $role)
39+
<!-- Checked: "bg-indigo-50 border-indigo-200 z-10", Not Checked: "border-gray-200" -->
3540
<label class="@if(in_array($role->id,$userRoles)) bg-indigo-50 border-indigo-200 z-10 @else border-gray-200 @endif @if($loop->first) rounded-tl-md rounded-tr-md @endif @if($loop->last) rounded-bl-md rounded-br-md @endif relative border p-4 flex cursor-pointer">
3641
<input type="checkbox" value="{{ $role->id }}" wire:model="userRoles" class="invisible" aria-labelledby="privacy-setting-{{ $loop->iteration }}-label" aria-describedby="privacy-setting-{{ $loop->iteration }}-description">
3742
<div class="flex flex-col">
@@ -41,22 +46,25 @@
4146
<span id="privacy-setting-{{ $loop->iteration }}-description" class="text-gray-500 block text-sm">{{ $role->description }}</span>
4247
</div>
4348
</label>
44-
@endforeach
45-
</div>
49+
@endforeach
50+
</div>
51+
<x-jet-input-error for="user.email" class="mt-2"/>
4652

4753

4854
<x-jet-input-error for="role" class="mt-2"/>
4955
</div>
5056
</x-slot>
51-
<x-slot name="actions">
52-
<x-jet-action-message class="mr-3" on="saved">
53-
{{ __('Saved.') }}
54-
</x-jet-action-message>
57+
@if($user->id)
58+
<x-slot name="actions">
59+
<x-jet-action-message class="mr-3" on="saved">
60+
{{ __('Saved.') }}
61+
</x-jet-action-message>
5562

56-
<x-jet-button wire:loading.attr="disabled">
57-
{{ __('Save') }}
58-
</x-jet-button>
59-
</x-slot>
63+
<x-jet-button wire:loading.attr="disabled">
64+
{{ __('Save') }}
65+
</x-jet-button>
66+
</x-slot>
67+
@endif
6068
</x-jet-form-section>
6169
<x-jet-section-border/>
6270

@@ -93,21 +101,21 @@
93101
</x-jet-form-section>
94102
<x-jet-section-border/>
95103
@if($showPerks)
96-
<div class="md:grid md:grid-cols-3 md:gap-6">
97-
<x-jet-section-title>
98-
<x-slot name="title">
99-
{{ __('Permissions') }}
100-
</x-slot>
101-
<x-slot name="description">
102-
{{ __('These are the user specific permissions , grayed out permissions are set via a role and cannot be changed for the user.') }}
103-
</x-slot>
104-
</x-jet-section-title>
105-
<div class="mt-5 md:mt-0 md:col-span-2">
106-
<div class="px-4 py-5 bg-white sm:p-6 shadow sm:rounded-md">
107-
@include('LLoadoutInforce-views::user-ui.access')
104+
<div class="md:grid md:grid-cols-3 md:gap-6">
105+
<x-jet-section-title>
106+
<x-slot name="title">
107+
{{ __('Permissions') }}
108+
</x-slot>
109+
<x-slot name="description">
110+
{{ __('These are the user specific permissions , grayed out permissions are set via a role and cannot be changed for the user.') }}
111+
</x-slot>
112+
</x-jet-section-title>
113+
<div class="mt-5 md:mt-0 md:col-span-2">
114+
<div class="px-4 py-5 bg-white sm:p-6 shadow sm:rounded-md">
115+
@include('LLoadoutInforce-views::user-ui.access')
116+
</div>
108117
</div>
109118
</div>
110-
</div>
111-
@endif
119+
@endif
112120

113121
</div>

0 commit comments

Comments
 (0)