mapper ok

This commit is contained in:
salam committed 2026-01-06 13:09:18 +01:00
1 parent 2e57e49f08
commit c617935e2f
18 files changed
+227 -97

No files matched your search

@@ -21,8 +21,7 @@
@endif
</div>
@include('filament.tables.columns.parts.search-button', [
'target' => 'input-2',
@include('filament.tables.columns.parts.search-button-left', [
'find' => $record->home->name,
])
@@ -32,9 +31,9 @@
<div>{{ $record->id }}</div>
</div>
<div class="flex justify-center space-x-4">
<div class="text-right font-bold">{{ $record->home->name }}</div>
<div class="text-right font-bold text-wrap">{{ $record->home->name }}</div>
<div class="w-6 text-center">-</div>
<div class="text-left font-bold">{{ $record->away->name }}</div>
<div class="text-left font-bold text-wrap">{{ $record->away->name }}</div>
</div>
<div class="flex justify-center space-x-4 text-gray-600 dark:text-gray-500">
<div>{{ $record->country?->name }}</div>
@@ -43,8 +42,7 @@
</div>
@include('filament.tables.columns.parts.search-button', [
'target' => 'input-2',
@include('filament.tables.columns.parts.search-button-left', [
'find' => $record->away->name,
])
@@ -16,8 +16,7 @@
@include('filament.tables.columns.parts.move-botton')
@include('filament.tables.columns.parts.search-button', [
'target' => 'input-1',
@include('filament.tables.columns.parts.search-button-right', [
'find' => $record->home,
])
@@ -27,9 +26,9 @@
<div>{{ $record->event_id }}</div>
</div>
<div class="flex justify-center space-x-4">
<div class="text-right font-bold">{{ $record->home }}</div>
<div class="text-right font-bold text-wrap">{{ $record->home }}</div>
<div class="w-6 text-center">-</div>
<div class="text-left font-bold">{{ $record->away }}</div>
<div class="text-left font-bold text-wrap">{{ $record->away }}</div>
</div>
<div class="flex justify-center space-x-4 text-gray-600 dark:text-gray-500">
<div>{{ $record->country }}</div>
@@ -38,8 +37,7 @@
</div>
</div>
@include('filament.tables.columns.parts.search-button', [
'target' => 'input-1',
@include('filament.tables.columns.parts.search-button-right', [
'find' => $record->away,
])
@@ -0,0 +1,3 @@
<div class="my-auto">
<x-filament::button icon="phosphor-magnifying-glass" size="xs" x-on:click="search_right='{{ $find }}';" />
</div>
@@ -0,0 +1,3 @@
<div class="my-auto">
<x-filament::button icon="phosphor-magnifying-glass" size="xs" x-on:click="search_left='{{ $find }}'; " />
</div>
@@ -1,5 +0,0 @@
<div class="my-auto">
<x-filament::button icon="phosphor-magnifying-glass" color="gray" size="xs"
x-on:click="document.getElementById('{{ $target }}').focus();
document.getElementById('{{ $target }}').value = '{{ $find }}';" />
</div>
@@ -2,22 +2,12 @@
use Illuminate\Support\Carbon;
$e = Carbon::parse($event->starttime);
$m = Carbon::parse($mapper->starttime);
$seconds = $e->diffInSeconds($m);
$diff = gmdate('H:i:s', $seconds);
if ($seconds == 0) {
$color = 1;
} elseif ($seconds < 1800) {
$color = 2;
} elseif ($seconds < 7200) {
$color = 3;
} else {
$color = 4;
}
$seconds = $m->diffInSeconds($e);
$text = $m->diffForHumans($e, ['parts' => 4], true);
@endphp
<div>
@@ -26,23 +16,15 @@
<div>Startime Difference</div>
<div></div>
<div class="bg-gray-100 p-1 border rounded-lg">{{ $e->format('d-m-y H:i') }}</div>
@switch($color)
@case(1)
<div class="bg-green-100 text-green-500 p-1 border rounded-lg">{{ $diff }}</div>
@break
@case(2)
<div class="bg-blue-100 text-blue-500 p-1 border rounded-lg">{{ $diff }}</div>
@break
@case(3)
<div class="bg-amber-100 text-amber-500 p-1 border rounded-lg">{{ $diff }}</div>
@break
@case(4)
<div class="bg-red-100 text-red-500 p-1 border rounded-lg">{{ $diff }}</div>
@break
@endswitch
@if ($seconds == 0)
<div class="bg-green-100 text-green-500 p-1 border rounded-lg">Starttime is matching</div>
@elseif ($seconds < 1800 && $seconds > -1800)
<div class="bg-blue-100 text-blue-500 p-1 border rounded-lg">{{ $text }}</div>
@elseif ($seconds < 7200 && $seconds > -7200)
<div class="bg-amber-100 text-amber-500 p-1 border rounded-lg">{{ $text }}</div>
@else
<div class="bg-red-100 text-red-500 p-1 border rounded-lg">{{ $text }}</div>
@endif
<div class="bg-gray-100 p-1 border rounded-lg">{{ $m->format('d-m-y H:i') }}</div>
<div class="col-span-3 flex justify-center gap-2 mt-6">
<div>
@@ -74,10 +74,10 @@
{{-- Event Mapper --}}
<x-filament::modal width="7xl" icon="heroicon-o-squares-2x2" :close-by-clicking-away="false" :close-by-escaping="false"
<x-filament::modal width="7xl" icon="phosphor-arrows-in-line-horizontal" :close-by-clicking-away="false" :close-by-escaping="false"
:close-button="true">
<x-slot name="trigger">
<x-filament::button outlined icon="heroicon-o-squares-2x2" color="gray">
<x-filament::button outlined icon="phosphor-arrows-in-line-horizontal" color="gray">
Event Mapper
</x-filament::button>
</x-slot>
@@ -156,7 +156,9 @@
</div>
</x-slot>
<div id="mapper" class="grid grid-cols-2 gap-4 drag-and-drop text-sm" x-data="{ event_id: 0, match_id: 0, overleftcolumn: false, overrightcolumn: false }">
<div id="mapper" class="grid grid-cols-2 gap-4 drag-and-drop text-sm" x-data="{ search_left: '', search_right: '', event_id: 0, match_id: 0, overleftcolumn: false, overrightcolumn: false }"
x-init="$watch('search_left', value => Livewire.dispatch('search_left', value));
$watch('search_right', value => Livewire.dispatch('search_right', value));">
<div>
@livewire('mapper-left')
</div>
@@ -253,16 +255,18 @@
@if (auth()->user()->hasRole('konto_switch'))
<x-filament::dropdown>
<x-slot name="trigger">
<x-filament::button icon="phosphor-user">
<x-filament::button icon="phosphor-play">
{{ $client }}
</x-filament::button>
</x-slot>
<x-filament::dropdown.list>
@foreach ($clients as $id => $name)
<x-filament::dropdown.list.item wire:click="swop({{ $id }})" icon="phosphor-key">
{{ $name }}
</x-filament::dropdown.list.item>
@if ($name != $client)
<x-filament::dropdown.list.item wire:click="swop({{ $id }})" icon="phosphor-play">
{{ $name }}
</x-filament::dropdown.list.item>
@endif
@endforeach
</x-filament::dropdown.list>
</x-filament::dropdown>