Add Spareparts module with CRUD functionality and UI components.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<section>
|
||||
<x-header>
|
||||
{{ __('Spareparts') }}
|
||||
|
||||
<x-slot name="headerleft">
|
||||
<input type="text" placeholder="Search..." wire:model.live="search" class="bg-black/10 border-white/20 rounded text-gray-50 placeholder:text-gray-200 focus:border-white/50 focus:ring-white/50" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button wire:click="create" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 transition ease-in-out hover:cursor-pointer">Create Sparepart</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
</div>
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<x-table>
|
||||
<x-slot name="tableheader">
|
||||
<x-table.header class="w-[50px]">ID</x-table.header>
|
||||
<x-table.header>Name</x-table.header>
|
||||
<x-table.header>Manufacturer</x-table.header>
|
||||
<x-table.header class="w-[150px]">Actions</x-table.header>
|
||||
</x-slot>
|
||||
|
||||
@foreach ($spareparts as $sparepart)
|
||||
<tr wire:key="{{ $sparepart->id }}" class="text-gray-200 border-b border-white/50 hover:bg-white/10 transition duration-150 ease-in-out">
|
||||
<x-table.item><p class="p-4 px-3 pl-6">{{ $sparepart->id }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3 font-bold">{{ $sparepart->name }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">
|
||||
@if ($sparepart->manufacturer_id !== 0)
|
||||
<a href="{{ route('manufacturer.show', $sparepart->manufacturer_id) }}" class="flex items-center gap-2">
|
||||
{{ App\Models\Manufacturer::find($sparepart->manufacturer_id)->name }}
|
||||
<flux:icon name="arrow-right" variant="mini"></flux:icon>
|
||||
</a>
|
||||
@endif
|
||||
</p></x-table.item>
|
||||
<x-table.item>
|
||||
<div class="flex flex-row gap-4 justify-end pr-8">
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-cornflower hover:shadow hover:text-gray-950 hover:cursor-pointer" wire:click="show({{ $sparepart->id }})" icon="magnifying-glass"></flux:button>
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-gold-drop hover:shadow hover:text-gray-950 hover:cursor-pointer" wire:click="edit({{ $sparepart->id }})" icon="pencil"></flux:button>
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-red-700 hover:shadow hover:cursor-pointer" wire:click="delete({{ $sparepart->id }})" icon="trash"></flux:button>
|
||||
</div>
|
||||
</x-table.item>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<x-slot name="pagination">
|
||||
{{ $spareparts->links() }}
|
||||
</x-slot>
|
||||
</x-table>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user