diff --git a/modules/shared/auth/ui/home.php b/modules/shared/auth/ui/home.php index 75f6fb5..f4325e1 100644 --- a/modules/shared/auth/ui/home.php +++ b/modules/shared/auth/ui/home.php @@ -87,6 +87,20 @@ function auth_market_status_signal_class(string $status): string ][$status] ?? ''; } +function auth_large_table_default_width(int $columnCount): string +{ + return rtrim(rtrim(number_format(100 / max(1, $columnCount), 4, '.', ''), '0'), '.') . '%'; +} + +function auth_large_table_resize_handle(string $label, int $columnIndex, int $columnCount): string +{ + if ($columnIndex >= $columnCount - 1) { + return ''; + } + + return ''; +} + function auth_render_markets_large_table(array $marketTable): string { $rows = $marketTable['rows'] ?? $marketTable; @@ -107,14 +121,14 @@ function auth_render_markets_large_table(array $marketTable): string $html = []; $html[] = '
'; $html[] = '
'; - $html[] = '
'; + $html[] = '
'; $html[] = '
'; $html[] = '
Marktdurchführungen
'; $html[] = ''; $html[] = ''; $html[] = ''; $html[] = ''; - $html[] = '
'; + $html[] = ''; $html[] = '
'; $headerIndex = 0; foreach ($sortColumns as $column => $label) { @@ -123,10 +137,10 @@ function auth_render_markets_large_table(array $marketTable): string $iconDirection = $isActive ? strtolower($sortDirection) : 'ascending'; $targetDirection = $isActive ? ($sortDirection === 'ASC' ? 'DESC' : 'ASC') : ($column === 'earliest_date' ? 'ASC' : 'ASC'); $ariaLabel = $isActive ? $label . ' ' . ($sortDirection === 'ASC' ? 'aufsteigend sortiert' : 'absteigend sortiert') : $label . ' sortieren'; - $html[] = '
'; + $html[] = '
' . auth_large_table_resize_handle($label, $headerIndex, 6) . '
'; $headerIndex++; } - $html[] = '
Verkaufte Produkte
'; + $html[] = '
Verkaufte Produkte
'; $html[] = '
'; foreach ($rows as $index => $row) { @@ -183,11 +197,12 @@ function auth_render_market_definitions_content(array $marketTable): string $html = []; $html[] = '
'; $html[] = '
'; - $html[] = '
'; - $html[] = '
Märkte
'; + $html[] = '
'; + $html[] = '
Märkte
'; $html[] = '
'; - foreach (['Markt', 'Kategorie', 'Veranstalter', 'Website', 'Durchführungen', 'Status'] as $label) { - $html[] = '
' . auth_escape_html($label) . '
'; + $definitionColumns = ['Markt', 'Kategorie', 'Veranstalter', 'Website', 'Durchführungen', 'Status']; + foreach ($definitionColumns as $index => $label) { + $html[] = '
' . auth_escape_html($label) . '' . auth_large_table_resize_handle($label, $index, count($definitionColumns)) . '
'; } $html[] = '
'; foreach ($rows as $index => $row) { @@ -244,7 +259,7 @@ function auth_render_bestellungen_large_table(array $bestellungenTable): string $html = []; $html[] = '
'; - $html[] = '
'; + $html[] = '
'; $html[] = '
'; $html[] = '
Bestellungen
'; $html[] = ''; @@ -253,6 +268,7 @@ function auth_render_bestellungen_large_table(array $bestellungenTable): string $html[] = ''; $html[] = ''; $html[] = ''; + $html[] = ''; $html[] = '
'; $html[] = '
'; @@ -269,11 +285,11 @@ function auth_render_bestellungen_large_table(array $bestellungenTable): string : ($column === 'order_date' ? 'DESC' : 'ASC'); $amountHeaderClass = $column === 'total_amount' ? ' sg-large-table__cell--amount' : ''; - $html[] = '
'; + $html[] = '
'; $html[] = ''; + $html[] = '' . auth_large_table_resize_handle($label, $headerIndex, 4); $html[] = '
'; $headerIndex++; } @@ -388,11 +404,11 @@ function auth_render_lager_table(string $title, array $rows, array $columns, str return ['text' => $text, 'warning' => $warning, 'mhdWarning' => $mhdWarning]; }; $html = []; - $html[] = '
'; - $html[] = '
' . auth_escape_html($title) . '
'; + $html[] = '
'; + $html[] = '
' . auth_escape_html($title) . '
'; $html[] = '
'; - foreach ($columns as $label) { - $html[] = '
' . auth_escape_html($label) . '
'; + foreach ($columns as $index => $label) { + $html[] = '
' . auth_escape_html($label) . '' . auth_large_table_resize_handle($label, $index, count($columns)) . '
'; } $html[] = '
'; @@ -932,10 +948,13 @@ function render_auth_home_page(array $user, array $otcProducts = [], array $otcM echo ''; echo ''; echo ''; + echo ''; echo '