Files
nuhodds_fi4/resources/views/filament/tables/columns/drag-card.blade.php
T
2026-09-09 08:36:31 +02:00

62 lines
2.9 KiB
PHP

@php
$record = $getRecord();
@endphp
@if ($record['active'])
<div draggable="false"
class="w-140 max-w-140 border dark:border-gray-600 border-gray-200 text-xs my-0.5 py-1 select-none rounded transition-colors flex justify-end content-center items-center gap-1">
<div class="w-86 text-[11px] min-w-86 text-center grid grid-cols-10 content-center items-center gap-1">
<div>{{ $record['gls'] }}</div>
<div>{{ $record['fls'] }}</div>
<div>{{ $record['ofs'] }}</div>
<div>{{ $record['snt'] }}</div>
<div>{{ $record['tsh'] }}</div>
<div>{{ $record['crd'] }}</div>
<div>{{ $record['preferred_foot'] }}</div>
<div>{{ $record['events_played'] }}</div>
<div>{{ $record['everage_minutes'] }}</div>
<div class="bg-black text-white rounded font-bold">{{ $record['position'] }}</div>
</div>
<div class="w-18 font-stretch-ultra-condensed">
<x-filament::badge size="sm" color="{{ $record['player_color'] }}">
{{ ucfirst($record['player_position']) }}
</x-filament::badge>
</div>
<div class="text-left text-sm tracking-tight flex-1 text-red-500">
{{ $record['name'] }}
</div>
<div class="w-8 flex justify-end">
</div>
</div>
@else
<div draggable="true"
x-on:dragstart="e => {
e.dataTransfer.effectAllowed = 'copy';
e.dataTransfer.setData('text/plain', JSON.stringify({ id: {{ $record['id'] }} }));
}"
class="w-140 max-w-140 border dark:border-gray-600 border-gray-200 text-xs my-0.5 mx-0 py-1 select-none cursor-grab active:cursor-grabbing rounded transition-colors flex justify-end content-center items-center gap-1">
<div class="w-86 text-[11px] min-w-86 text-center grid grid-cols-10 content-center items-center gap-1">
<div>{{ $record['gls'] }}</div>
<div>{{ $record['fls'] }}</div>
<div>{{ $record['ofs'] }}</div>
<div>{{ $record['snt'] }}</div>
<div>{{ $record['tsh'] }}</div>
<div>{{ $record['crd'] }}</div>
<div>{{ $record['preferred_foot'] }}</div>
<div>{{ $record['events_played'] }}</div>
<div>{{ $record['everage_minutes'] }}</div>
<div class="bg-black text-white rounded font-bold">{{ $record['position'] }}</div>
</div>
<div class="w-18 font-stretch-ultra-condensed">
<x-filament::badge size="sm" color="{{ $record['player_color'] }}">
{{ ucfirst($record['player_position']) }}
</x-filament::badge>
</div>
<div class="text-left text-sm tracking-tight flex-1">
{{ $record['name'] }}
</div>
<div class="w-8 flex justify-end">
<x-phosphor-dots-six-vertical class="h-5 w-5" />
</div>
</div>
@endif