-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite Entity add and delete operators to new EntityOperatorControll…
…er.php
- Loading branch information
Showing
8 changed files
with
195 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<form x-data="{ open: false }" id="add_operators" action="{{ route('entities.operators.store', $entity) }}" method="post"> | ||
@csrf | ||
<div class="dark:bg-transparent overflow-x-auto bg-gray-100 border rounded-lg"> | ||
<table class="min-w-full border-b border-gray-300"> | ||
<thead> | ||
<tr> | ||
<th | ||
class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg-gray-100 border-b"> | ||
| ||
</th> | ||
<th | ||
class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg-gray-100 border-b"> | ||
{{ __('common.name') }} | ||
</th> | ||
<th | ||
class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg-gray-100 border-b"> | ||
{{ __('common.email') }} | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody class="divide-y divide-gray-200"> | ||
@forelse ($users as $user) | ||
<tr x-data class="bg-white" role="button" | ||
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked"> | ||
<td class="px-6 py-3 text-sm"> | ||
<input @click.stop class="rounded" type="checkbox" name="operators[]" | ||
value="{{ $user->id }}"> | ||
</td> | ||
<td class="whitespace-nowrap px-6 py-3 text-sm"> | ||
{{ $user->name }} | ||
</td> | ||
<td class="px-6 py-3 text-sm"> | ||
<a class="hover:underline text-blue-500" | ||
href="mailto:{{ $user->email }}">{{ $user->email }}</a> | ||
</td> | ||
</tr> | ||
@empty | ||
<tr> | ||
<td class="px-6 py-3 font-bold text-center bg-white" colspan="4"> | ||
{{ __('common.no_operators') }}</td> | ||
</tr> | ||
@endforelse | ||
</tbody> | ||
</table> | ||
{{ $users->links() }} | ||
@if (count($users)) | ||
<div class="px-4 py-3 bg-gray-100"> | ||
<x-button @click.prevent="open = !open">{{ __('common.add_operators') }} | ||
</x-button> | ||
|
||
<x-modal> | ||
<x-slot:title> | ||
{{ __('common.confirm_add_operators') }} | ||
</x-slot:title> | ||
{{ __('common.confirm_add_operators_body') }} | ||
</x-modal> | ||
</div> | ||
@endif | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<form x-data="{ open: false }" id="delete_operators" action="{{ route('entities.operators.destroy', $entity) }}" method="post"> | ||
@csrf | ||
@method('DELETE') | ||
<div class="dark:bg-transparent overflow-x-auto bg-gray-100 border rounded-lg"> | ||
<table class="min-w-full border-b border-gray-300"> | ||
<thead> | ||
<tr> | ||
<th | ||
class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg-gray-100 border-b"> | ||
| ||
</th> | ||
<th | ||
class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg-gray-100 border-b"> | ||
{{ __('common.name') }} | ||
</th> | ||
<th | ||
class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg-gray-100 border-b"> | ||
{{ __('common.email') }} | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody class="divide-y divide-gray-200"> | ||
@forelse ($operators->sortBy('name') as $operator) | ||
<tr x-data class="bg-white" role="button" | ||
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked"> | ||
<td class="px-6 py-3 text-sm"> | ||
<input @click.stop class="rounded" type="checkbox" name="operators[]" | ||
value="{{ $operator->id }}"> | ||
</td> | ||
<td class="whitespace-nowrap px-6 py-3 text-sm"> | ||
{{ $operator->name }} | ||
</td> | ||
<td class="px-6 py-3 text-sm"> | ||
<a class="hover:underline text-blue-500" | ||
href="mailto:{{ $operator->email }}">{{ $operator->email }}</a> | ||
</td> | ||
</tr> | ||
@empty | ||
<tr> | ||
<td class="px-6 py-3 font-bold text-center bg-white" colspan="4"> | ||
{{ __('common.no_operators') }}</td> | ||
</tr> | ||
@endforelse | ||
</tbody> | ||
</table> | ||
{{ $operators->links() }} | ||
@if (count($operators)) | ||
<div class="px-4 py-3 bg-gray-100"> | ||
<x-button @click.prevent="open = !open" color="red">{{ __('common.delete_operators') }} | ||
</x-button> | ||
|
||
<x-modal> | ||
<x-slot:title> | ||
{{ __('common.confirm_delete_operators') }} | ||
</x-slot:title> | ||
{{ __('common.confirm_delete_operators_body') }} | ||
</x-modal> | ||
</div> | ||
@endif | ||
</div> | ||
</form> |
Oops, something went wrong.