Files
kopalnia_2026/resources/views/catalog/aggregates/edit.blade.php
T
2026-09-03 12:21:17 +02:00

47 lines
2.9 KiB
PHP

<x-app-layout :active="'aggregates.index'" title="SoftSPM 2 - Przypisanie silników">
<div class="max-w-3xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('aggregates.show', $pump) }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Silniki dla pompy: {{ $pump->PUP_NAME }}</h1>
</div>
<form method="POST" action="{{ route('aggregates.update', $pump) }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
@csrf
@method('PUT')
<table class="w-full text-left">
<thead class="bg-secondary/10 border-b border-outline-variant/40">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-4 py-2 w-12"></th>
<th class="px-4 py-2">Typ silnika</th>
<th class="px-4 py-2 text-right">Napięcie [V]</th>
<th class="px-4 py-2 text-right">Moc [kW]</th>
<th class="px-4 py-2">Producent</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@foreach ($allEngines as $e)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-2">
<input type="checkbox" name="engines[]" value="{{ $e->ENG_ID }}"
{{ in_array((int) $e->ENG_ID, $assigned, true) ? 'checked' : '' }}
class="w-4 h-4 accent-secondary">
</td>
<td class="px-4 py-2 font-semibold text-on-surface">{{ $e->ENG_NAME }}</td>
<td class="px-4 py-2 text-right font-data-label">{{ $e->ENG_VOLTAGE }}</td>
<td class="px-4 py-2 text-right font-data-label">{{ $e->ENG_POWER }}</td>
<td class="px-4 py-2">{{ $e->manufacturer?->MCF_NAME }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="flex items-center gap-2 p-card-inner-padding border-t border-outline-variant/40">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz</button>
<a href="{{ route('aggregates.show', $pump) }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>