diff --git a/src/State/WorkHourDayExportProvider.php b/src/State/WorkHourDayExportProvider.php index f95ba44..4312dbf 100644 --- a/src/State/WorkHourDayExportProvider.php +++ b/src/State/WorkHourDayExportProvider.php @@ -66,6 +66,7 @@ class WorkHourDayExportProvider implements ProviderInterface $siteMeta[$siteId] ??= [ 'name' => $site->getName(), 'order' => $site->getDisplayOrder(), + 'color' => $site->getColor(), ]; } @@ -82,7 +83,7 @@ class WorkHourDayExportProvider implements ProviderInterface if ([] === $rows) { continue; } - $groups[] = ['siteName' => $meta['name'], 'rows' => $rows]; + $groups[] = ['siteName' => $meta['name'], 'siteColor' => $meta['color'], 'rows' => $rows]; } $options = new Options(); diff --git a/templates/work-hour-day-export/print.html.twig b/templates/work-hour-day-export/print.html.twig index d5b9e04..9278425 100644 --- a/templates/work-hour-day-export/print.html.twig +++ b/templates/work-hour-day-export/print.html.twig @@ -9,14 +9,14 @@ .title-bar { position: relative; margin: 0 0 3mm 0; } h1 { text-align: center; font-size: 15px; margin: 0; } .export-date { position: absolute; top: 0; right: 0; font-size: 8px; color: #333; padding-top: 4px; } - h2 { font-size: 11px; margin: 3mm 0 1mm 0; padding: 2px 6px; background: #e8e8e8; } - table { width: 100%; border-collapse: collapse; table-layout: auto; border: 2px solid #0a0a0a; } - th, td { border: 1px solid #0a0a0a; padding: 1px 3px; vertical-align: middle; white-space: nowrap; text-align: center; } - th { font-weight: 700; background: #f0f0f0; } + table { width: 100%; border-collapse: collapse; table-layout: fixed; border: 2px solid #0a0a0a; } + th, td { border: 1px solid #0a0a0a; padding: 1px 2px; vertical-align: middle; text-align: center; overflow: hidden; } + th { font-weight: 700; background: #f0f0f0; white-space: normal; } + td { white-space: nowrap; } td.name { text-align: left; } + tr.site-title td { font-weight: bold; font-size: 11px; text-transform: uppercase; text-align: left; padding: 2px 6px; white-space: nowrap; } tr.weekend td { background: #c0c0c0; } td.statut { background: #b3e5fc; } - .site-block { page-break-inside: auto; } @@ -25,44 +25,57 @@
Édité le {{ exportedAt }}
- {% for group in groups %} -
-

{{ group.siteName }}

- - - - - - - - - - - - - - +
NomStatutDébut matinFin matinDébut après-midiFin après-midiDébut soirFin soirJourNuitTotal
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% for group in groups %} + + + + {% for row in group.rows %} + + + + + + + + + + + + - - - {% for row in group.rows %} - - - - - - - - - - - - - - {% endfor %} - -
NomStatutDébut matinFin matinDébut après-midiFin après-midiDébut soirFin soirJourNuitTotal
{{ group.siteName }}
{{ row.employeeName }}{{ row.statut }}{{ row.morningFrom }}{{ row.morningTo }}{{ row.afternoonFrom }}{{ row.afternoonTo }}{{ row.eveningFrom }}{{ row.eveningTo }}{{ row.dayHours }}{{ row.nightHours }}{{ row.total }}
{{ row.employeeName }}{{ row.statut }}{{ row.morningFrom }}{{ row.morningTo }}{{ row.afternoonFrom }}{{ row.afternoonTo }}{{ row.eveningFrom }}{{ row.eveningTo }}{{ row.dayHours }}{{ row.nightHours }}{{ row.total }}
-
- {% endfor %} + {% endfor %} + {% endfor %} + +