wip add claculator button

This commit is contained in:
salam committed 2026-09-12 19:29:47 +02:00
1 parent 0857d11011
commit 4ac7ce108b
2 files changed
+13 -25

No files matched your search

+12 -6
View File
@@ -237,12 +237,14 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
Action::make('close') Action::make('close')
->size(Size::Small) ->size(Size::Small)
->tooltip('Close application') ->tooltip('Close application')
->color('success')
->hiddenLabel() ->hiddenLabel()
->icon('phosphor-x') ->icon('phosphor-x')
->close(), ->close(),
Action::make('lineups') Action::make('lineups')
->size(Size::Small) ->size(Size::Small)
->tooltip('Lineup abbreviation explanation') ->tooltip('Lineup abbreviation explanation')
->color('success')
->hiddenLabel() ->hiddenLabel()
->icon('phosphor-question-mark') ->icon('phosphor-question-mark')
->slideOver() ->slideOver()
@@ -257,6 +259,12 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
->tooltip('Remove all players from field') ->tooltip('Remove all players from field')
->icon('phosphor-arrows-clockwise') ->icon('phosphor-arrows-clockwise')
->action(fn () => $this->clearResultTable()), ->action(fn () => $this->clearResultTable()),
Action::make('calculate')
->tooltip('Calculate')
->hiddenLabel()
->size(Size::Small)
->icon('phosphor-calculator')
->action(fn () => $this->calculateAspg()),
Action::make('copy_results') Action::make('copy_results')
->tooltip('Copy results for pasting into a spread sheet') ->tooltip('Copy results for pasting into a spread sheet')
->hiddenLabel() ->hiddenLabel()
@@ -381,7 +389,6 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
} }
} }
public function storePlacement() public function storePlacement()
{ {
$store = []; $store = [];
@@ -472,9 +479,9 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
foreach ($this->calculationVariables as $row) { foreach ($this->calculationVariables as $row) {
if ($copystring == '') { if ($copystring == '') {
$keys = array_keys($row); $keys = array_keys($row);
$copystring .= implode(";", $keys) . "\n"; $copystring .= implode(';', $keys)."\n";
} }
$copystring .= implode(";", $row) . "\n"; $copystring .= implode(';', $row)."\n";
} }
$this->js("navigator.clipboard.writeText(`$copystring`)"); $this->js("navigator.clipboard.writeText(`$copystring`)");
@@ -490,7 +497,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
return; return;
} }
$header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'snt', 'tsh', 'crd']; $header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'snt', 'tsh', 'crd'];
$copystring = implode(";", $header) . "\n"; $copystring = implode(';', $header)."\n";
foreach ($this->sourceRecords as $row) { foreach ($this->sourceRecords as $row) {
$tmp = []; $tmp = [];
$tmp[] = $row['name']; $tmp[] = $row['name'];
@@ -510,7 +517,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
$tmp[] = $row['tsh']; $tmp[] = $row['tsh'];
$tmp[] = $row['crd']; $tmp[] = $row['crd'];
$copystring .= implode(",", $tmp) . "\n"; $copystring .= implode(',', $tmp)."\n";
} }
$this->js("navigator.clipboard.writeText(`$copystring`)"); $this->js("navigator.clipboard.writeText(`$copystring`)");
@@ -687,7 +694,6 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
} }
} }
// Calcolare la Somma di tutte le AT (colonna G della Tabella) // Calcolare la Somma di tutte le AT (colonna G della Tabella)
// Considerare la ATR calcolata allo Step 1 (colonna I della Tabella) // Considerare la ATR calcolata allo Step 1 (colonna I della Tabella)
// Aspettativa per Player: AP = AT * ATR / TOT AT // Aspettativa per Player: AP = AT * ATR / TOT AT
@@ -1,21 +1,3 @@
{{--
"id" => 1218016
"name" => "Walter Nuñez"
"pos" => "LW"
"foot" => "Right"
"tot_evt" => 2
"tot_min" => 102
"ave_min" => 51
"gls" => 0
"fls" => 3
"ofs" => 0
"crd" => 0
"snt" => 0
"tsh" => 0
"color_evt" => "success"
"area" => "attack"
"color_pos" => "warning"
--}}
<div class="relative w-full"> <div class="relative w-full">
<div class="fixed left-0 top-0 h-screen dispatcher-board-root w-146 max-w-146 overflow-y-auto no-scrollbar"> <div class="fixed left-0 top-0 h-screen dispatcher-board-root w-146 max-w-146 overflow-y-auto no-scrollbar">
{{ $this->table }} {{ $this->table }}
@@ -43,7 +25,7 @@
</div> </div>
</div> </div>
<div class="bg-green-500 border-2 mx-3 p-3 rounded col-span-5 grid grid-cols-7 grid-rows-5 gap-2 bg-cover bg-center bg-no-repeat aspect-7/5" <div class="bg-green-500 border-2 mx-3 p-3 rounded col-span-5 grid grid-cols-7 grid-rows-5 gap-2 bg-cover bg-center bg-no-repeat aspect-7/5"
style="background-image: url({{ asset('images/soccerfield-trans.png') }});"> style="background-image: url({{ asset('images/soccerfield-cleand.jpg') }});">
@foreach ($beschriftung as $boxNumber => $benennung) @foreach ($beschriftung as $boxNumber => $benennung)
@if ($benennung) @if ($benennung)
@if (in_array($boxNumber, $lineup)) @if (in_array($boxNumber, $lineup))