diff --git a/app/Livewire/BoardDispatcher.php b/app/Livewire/BoardDispatcher.php index 82134b37..f5ae18f5 100644 --- a/app/Livewire/BoardDispatcher.php +++ b/app/Livewire/BoardDispatcher.php @@ -2,35 +2,29 @@ namespace App\Livewire; +use Illuminate\Support\Facades\Log; use Livewire\Component; class BoardDispatcher extends Component { public array $lists = []; + public array $destLabels = ['DR', 'MR', 'RW', 'DC', 'DM', 'MC', 'AM', 'SW', 'DC', 'DM', 'MC', 'AM', 'SM', 'ST', 'DC', 'DM', 'MC', 'AM', 'DL', 'ML', 'LM']; public string $boardVersion = ''; - public function mount() + public function mount(array $filters) { $this->boardVersion = uniqid(); - $this->lists['source-1'] = [ - ['id' => '1', 'name' => 'Source Item A', 'origin' => 'source-1'], - ['id' => '2', 'name' => 'Source Item B', 'origin' => 'source-1'], - ]; - $this->lists['source-2'] = [ - ['id' => '3', 'name' => 'Source Item C', 'origin' => 'source-2'], - ]; - $this->lists['source-3'] = [ - ['id' => '4', 'name' => 'Source Item D', 'origin' => 'source-3'], - ['id' => '5', 'name' => 'Source Item E', 'origin' => 'source-3'], - ]; - $this->lists['source-4'] = [ - ['id' => '6', 'name' => 'Source Item F', 'origin' => 'source-4'], - ]; + $this->lists = PlayerCalculator::load($filters); - for ($i = 1; $i <= 21; $i++) { - $this->lists["dest-{$i}"] = []; + $active = [2, 4, 6, 9, 10, 11, 12, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 30, 32, 34]; + + for ($i = 1; $i <= 35; $i++) { + if (in_array($i, $active)) + $this->lists["dest-{$i}"] = []; + else + $this->lists["blind-{$i}"] = []; } } @@ -74,6 +68,10 @@ class BoardDispatcher extends Component { $itemId = (string) $itemId; + // Log::info($this->boardVersion); + // Log::info('itemId, currentListId', [$itemId, $currentListId]); + // Log::info('OLD LIST', $this->lists); + if (! isset($this->lists[$currentListId])) { $this->boardVersion = uniqid(); @@ -93,12 +91,15 @@ class BoardDispatcher extends Component if ($foundItem && isset($this->lists[$foundItem['origin']])) { // Nur zurücklegen, wenn die Quelle wirklich frei ist - if (count($this->lists[$foundItem['origin']]) < 1) { - array_unshift($this->lists[$foundItem['origin']], $foundItem); - } else { - // Ausfallsicherheit gegen Datenverlust: Zurück in die Bucht schieben - array_unshift($this->lists[$currentListId], $foundItem); - } + array_unshift($this->lists[$foundItem['origin']], $foundItem); + // if (count($this->lists[$foundItem['origin']]) < 2) { + // Log::info('origin'); + // array_unshift($this->lists[$foundItem['origin']], $foundItem); + // } else { + // // Ausfallsicherheit gegen Datenverlust: Zurück in die Bucht schieben + // array_unshift($this->lists[$currentListId], $foundItem); + // Log::info('box'); + // } } $this->boardVersion = uniqid(); diff --git a/app/Livewire/Mapper/LoadGridPositions.php b/app/Livewire/Mapper/LoadGridPositions.php index 10b5fab7..ed552d40 100644 --- a/app/Livewire/Mapper/LoadGridPositions.php +++ b/app/Livewire/Mapper/LoadGridPositions.php @@ -6,7 +6,7 @@ class LoadGridPositions { public static function load() { - $arr = []; + $arr = ['DR', 'MR', 'RW', 'DC', 'DM', 'MC', 'AM', 'SW', 'DC', 'DM', 'MC', 'AM', 'SM', 'ST', 'DC', 'DM', 'MC', 'AM', 'DL', 'ML', 'LM']; $arr[] = 0; $arr[] = 0; diff --git a/app/Livewire/PlayerCalculator.php b/app/Livewire/PlayerCalculator.php index 1204165b..3b783101 100644 --- a/app/Livewire/PlayerCalculator.php +++ b/app/Livewire/PlayerCalculator.php @@ -88,45 +88,43 @@ class PlayerCalculator extends Component $colorlevel = round($matches->count() / 3); if (in_array($val['player_position'], $positions_map['MIDFIELD'])) { - $position = 'MIDFIELD'; - $position_color = 'info'; + $origin = 'source-midfield'; + $pcolor = 'info'; } elseif (in_array($val['player_position'], $positions_map['DEFENCE'])) { - $position = 'DEFENCE'; - $position_color = 'success'; + $origin = 'source-defence'; + $pcolor = 'success'; } elseif (in_array($val['player_position'], $positions_map['ATTACK'])) { - $position = 'ATTACK'; - $position_color = 'warning'; + $origin = 'source-attack'; + $pcolor = 'warning'; } elseif (in_array($val['player_position'], $positions_map['GOALKEEPER'])) { - $position = 'GOALKEEPER'; - $position_color = 'gray'; + $origin = 'source-goalkeeper'; + $pcolor = 'gray'; } else { - $position = 'NO SPECIFIC POSITION'; - $position_color = ''; + $origin = 'NO SPECIFIC POSITION'; + $pcolor = ''; } $name = $val['player_name']; $preferred_foot = $val['preferred_foot'] ?? '-'; - $everage_minutes = round($minues_played / $events_played).' min'; + $everage_minutes = round($minues_played / $events_played) . ' min'; if ($colorlevel > 1 && $events_played < $colorlevel) { - $color = 'danger'; + $ecolor = 'danger'; } elseif ($events_played < $colorlevel * 2) { - $color = 'info'; + $ecolor = 'info'; } else { - $color = 'success'; + $ecolor = 'success'; } - $result[] = [ - 'player_id' => $player_id, - 'player_name' => $name, - 'position' => $position, - 'type_color' => $position_color, - 'event_color' => $color, - 'info' => 'Ev '.$events_played.', '.$preferred_foot.', '.$everage_minutes, + $result[$origin][] = [ + 'id' => $player_id, + 'name' => $name, + 'origin' => $origin, + 'pcolor' => $pcolor, + 'ecolor' => $ecolor, + 'info' => 'Ev ' . $events_played . ', ' . $preferred_foot . ', ' . $everage_minutes, ]; } - // dd($result); - return $result; } } diff --git a/public/images/soccerfield-all.jpg b/public/images/soccerfield-all.jpg new file mode 100644 index 00000000..87a662f6 Binary files /dev/null and b/public/images/soccerfield-all.jpg differ diff --git a/public/images/soccerfield-middle.jpg b/public/images/soccerfield-middle.jpg new file mode 100644 index 00000000..0c6c8a7b Binary files /dev/null and b/public/images/soccerfield-middle.jpg differ diff --git a/public/images/soccerfield.jpg b/public/images/soccerfield.jpg index d23f6db8..ade04af8 100644 Binary files a/public/images/soccerfield.jpg and b/public/images/soccerfield.jpg differ diff --git a/public/images/soccerfield.png b/public/images/soccerfield.png deleted file mode 100644 index 1a3f3435..00000000 Binary files a/public/images/soccerfield.png and /dev/null differ diff --git a/public/images/soccerfield2.jpg b/public/images/soccerfield2.jpg deleted file mode 100644 index 5e7df2ea..00000000 Binary files a/public/images/soccerfield2.jpg and /dev/null differ diff --git a/public/images/statistiko-d.svg b/public/images/statistiko-d.svg deleted file mode 100644 index 09a925bb..00000000 --- a/public/images/statistiko-d.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/public/svg/soccerfield.png b/public/svg/soccerfield.png new file mode 100644 index 00000000..c62e4247 Binary files /dev/null and b/public/svg/soccerfield.png differ diff --git a/public/svg/soccerfield.svg b/public/svg/soccerfield.svg index 8af850ff..a2397001 100644 --- a/public/svg/soccerfield.svg +++ b/public/svg/soccerfield.svg @@ -1,18 +1,46 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/css/filament/admin/theme.css b/resources/css/filament/admin/theme.css index 188655c2..f551f396 100644 --- a/resources/css/filament/admin/theme.css +++ b/resources/css/filament/admin/theme.css @@ -233,47 +233,4 @@ less padding in table @apply bg-gray-100 dark:bg-gray-600/30 drop-shadow } } -} - -/* 1. Das Element, das am Mauszeiger klebt (Der Mirror) */ -.gu-mirror { - position: fixed !important; - margin: 0 !important; - z-index: 9999 !important; - opacity: 0.95 !important; - pointer-events: none; - /* Verhindert, dass der Klon Maus-Events blockiert */ - - /* Styling für den Klon (Hell-Modus) */ - background-color: rgb(255, 255, 255) !important; - border: 1px solid rgb(226, 232, 240) !important; - box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important; - border-radius: 0.5rem !important; - transform: rotate(3deg); - /* Optionale leichte Drehung für einen dynamischen Look */ - transition: transform 0.15s ease; -} - -/* Dark Mode Anpassung für den Mirror (Wichtig in Filament!) */ -.dark .gu-mirror { - background-color: rgb(31, 41, 55) !important; - border-color: rgb(55, 65, 81) !important; - box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5) !important; -} - -/* 2. Der „Schatten“ am ursprünglichen Platz (Transit-Element) */ -.gu-transit { - opacity: 0.3 !important; - border: 2px dashed rgb(99, 102, 241) !important; - /* Indigo-farbener gestrichelter Rahmen */ - background-color: rgba(99, 102, 241, 0.05) !important; -} - -.dark .gu-transit { - background-color: rgba(99, 102, 241, 0.1) !important; -} - -/* 3. Sicherstellen, dass die Dropzones Platz für das Element bieten */ -/* .drag-box { - @apply flex flex-col gap-0 bg-gray-100/50 border-2 border-dashed border-gray-300 rounded-xl text-xs p-0; -} */ \ No newline at end of file +} \ No newline at end of file diff --git a/resources/views/livewire/board-dispatcher-modal-wrapper.blade.php b/resources/views/livewire/board-dispatcher-modal-wrapper.blade.php index 74667d19..5d50c4ac 100644 --- a/resources/views/livewire/board-dispatcher-modal-wrapper.blade.php +++ b/resources/views/livewire/board-dispatcher-modal-wrapper.blade.php @@ -1,4 +1,3 @@
- - @livewire('board-dispatcher') + @livewire('board-dispatcher', ['filters' => $this->filters])
diff --git a/resources/views/livewire/board-dispatcher.blade.php b/resources/views/livewire/board-dispatcher.blade.php index a0e17f56..333e2888 100644 --- a/resources/views/livewire/board-dispatcher.blade.php +++ b/resources/views/livewire/board-dispatcher.blade.php @@ -1,15 +1,15 @@ -
+
-
+
- + @foreach ($lists as $listId => $items) @if (str_starts_with($listId, 'source-'))
- {{ str_replace('source-', 'S', $listId) }} + {{ str_replace('source-', '', $listId) }} {{ count($items) }} @@ -21,119 +21,90 @@
-
+
+ + + + + + - + - +
-
Available Sources
@foreach ($lists as $listId => $items) @if (str_starts_with($listId, 'source-'))
- - -
+ - @foreach ($items as $item) -
- {{ $item['name'] }} - - - -
- @endforeach -
-
+
+ @foreach ($items as $item) + + {{ $item['name'] }} +
{{ $item['info'] }}
+
+
+ @endforeach +
@endif @endforeach
-
-
Target Destination Slots (21) -
-
+
+
@foreach ($lists as $listId => $items) @if (str_starts_with($listId, 'dest-')) -
-
- Bay - {{ str_replace('dest-', '', $listId) }} - {{ count($items) }} +
+ {{-- {{ $destLabels[str_replace('dest-', '', $listId)] }} --}} + {{ array_shift($destLabels) }}
-
+
@foreach ($items as $item) -
+ class="m-0 p-2 w-full h-full cursor-grab active:cursor-grabbing hover:border-danger-500 transition-all"> - +
{{ $item['name'] }} - - -
- - - - -
-
+ +
+ + {{ ucfirst(str_replace('source-', '', $item['origin'])) }} +
+ + @endforeach
+ @elseif (str_starts_with($listId, 'blind-')) +
@endif @endforeach