Skip to content

Commit

Permalink
fix roles view
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Sep 18, 2023
1 parent 28317c5 commit 03c143a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
17 changes: 13 additions & 4 deletions resources/views/roles/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class="dark:bg-gray-700 dark:border-gray-600 rounded border-gray-300 text-indigo
<span class="ml-2 rtl:mr-2 rtl:ml-0 dark:text-gray-200">{{__('Select All')}}</span>
</label>
</div>
<div class="grid grid-cols-2 gap-4">
<div class="grid grid-cols-1 gap-4">
@foreach($perm as $permissionTable)
<div>
<div class="flex justifiy-between gap-4">
<div class="w-full">
<h3 class="text-md font-bold">{{ucfirst($permissionTable[0]['table'])}}</h3>
<h3 class="text-md font-bold">{{\Illuminate\Support\Str::of($permissionTable[0]['table'])->replace('_', ' ')->ucfirst()}}</h3>
</div>
<div class="flex justifiy-end">
@php
Expand Down Expand Up @@ -58,10 +58,19 @@ class="dark:bg-gray-700 dark:border-gray-600 rounded border-gray-300 text-indigo

</div>
<x-splade-group name="permissions" >
<div class="border p-4 rounded-lg grid grid-cols-2 gap-2 h-60 mt-2">
<div class="border p-4 rounded-lg grid grid-cols-2 gap-2 mt-2 shadow-sm">
@foreach($permissionTable as $permission)
@php
$name = \Illuminate\Support\Str::of($permission['name'])
->remove('admin.')
->remove($permission['table'] . '.')
->replace('-', ' ')
->ucfirst()
->explode('.')
->implode(' ');
@endphp
<x-splade-checkbox
label="{{ucfirst(\Illuminate\Support\Str::replace('.', ' ', \Illuminate\Support\Str::remove($permission['table'].'.', \Illuminate\Support\Str::remove('admin.', $permission['name']))))}}"
label="{{$name}}"
name="permissions[]"
value="{{$permission['name']}}"
/>
Expand Down
19 changes: 14 additions & 5 deletions resources/views/roles/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class="dark:bg-gray-700 dark:border-gray-600 rounded border-gray-300 text-indigo
<span class="ml-2 rtl:mr-2 rtl:ml-0 dark:text-gray-200">{{__('Select All')}}</span>
</label>
</div>
<div class="grid grid-cols-2 gap-4">
<div class="grid grid-cols-1 gap-4">
@foreach($perm as $permissionTable)
<div>
<div class="flex justifiy-between gap-4">
<div class="w-full">
<h3 class="text-md font-bold">{{ucfirst($permissionTable[0]['table'])}}</h3>
<h3 class="text-md font-bold">{{\Illuminate\Support\Str::of($permissionTable[0]['table'])->replace('_', ' ')->ucfirst()}}</h3>
</div>
<div class="flex justifiy-end">
@php
Expand Down Expand Up @@ -58,10 +58,19 @@ class="dark:bg-gray-700 dark:border-gray-600 rounded border-gray-300 text-indigo

</div>
<x-splade-group name="permissions" >
<div class="border p-4 rounded-lg grid grid-cols-2 gap-2 h-60 mt-2">
<div class="border p-4 rounded-lg grid grid-cols-2 gap-2 mt-2 shadow-sm">
@foreach($permissionTable as $permission)
@php
$name = \Illuminate\Support\Str::of($permission['name'])
->remove('admin.')
->remove($permission['table'] . '.')
->replace('-', ' ')
->ucfirst()
->explode('.')
->implode(' ');
@endphp
<x-splade-checkbox
label="{{ucfirst(\Illuminate\Support\Str::replace('.', ' ', \Illuminate\Support\Str::remove($permission['table'].'.', \Illuminate\Support\Str::remove('admin.', $permission['name']))))}}"
label="{{$name}}"
name="permissions[]"
value="{{$permission['name']}}"
/>
Expand All @@ -74,7 +83,7 @@ class="dark:bg-gray-700 dark:border-gray-600 rounded border-gray-300 text-indigo

</x-splade-data>

<div class="flex justify-start gap-2 pt-3">
<div class="flex justify-start gap-2">
<x-tomato-admin-submit label="{{__('Save')}}" :spinner="true" />
<x-tomato-admin-button danger :href="route('admin.roles.destroy', $model->id)"
confirm="{{trans('tomato-admin::global.crud.delete-confirm')}}"
Expand Down

0 comments on commit 03c143a

Please sign in to comment.