diff --git a/app/Services/MonthlyReportService.php b/app/Services/MonthlyReportService.php index 216ca74..63ca74b 100644 --- a/app/Services/MonthlyReportService.php +++ b/app/Services/MonthlyReportService.php @@ -191,7 +191,7 @@ class MonthlyReportService ], 'datasets' => [[ 'data' => [$free, $paid], - 'backgroundColor' => ['#4A4A42', '#C9C4BA'], + 'backgroundColor' => ['#8AB357', '#A5C87A'], ]], ], 'options' => [ @@ -249,8 +249,8 @@ class MonthlyReportService 'datasets' => [[ 'label' => __('report.consultations', [], $locale), 'data' => $data, - 'borderColor' => '#4A4A42', - 'backgroundColor' => 'rgba(74, 74, 66, 0.1)', + 'borderColor' => '#8AB357', + 'backgroundColor' => 'rgba(138, 179, 87, 0.1)', 'fill' => true, 'tension' => 0.3, ]], diff --git a/docs/stories/story-12.5-pdf-template-color-update.md b/docs/stories/story-12.5-pdf-template-color-update.md index 4cb4d8b..eb12874 100644 --- a/docs/stories/story-12.5-pdf-template-color-update.md +++ b/docs/stories/story-12.5-pdf-template-color-update.md @@ -155,21 +155,21 @@ $chartColors = [ ## Dev Checklist -- [ ] Update `users-export.blade.php` colors -- [ ] Update `users-export.blade.php` logo -- [ ] Update `consultations-export.blade.php` colors -- [ ] Update `consultations-export.blade.php` logo -- [ ] Update `timelines-export.blade.php` colors -- [ ] Update `timelines-export.blade.php` logo -- [ ] Update `monthly-report.blade.php` colors -- [ ] Update `monthly-report.blade.php` logo -- [ ] Update `MonthlyReportService.php` chart colors -- [ ] Review `monthly-report.blade.php` Livewire component -- [ ] Test Users PDF export -- [ ] Test Consultations PDF export -- [ ] Test Timelines PDF export -- [ ] Test Monthly Report PDF generation -- [ ] Verify logo displays correctly in all PDFs +- [x] Update `users-export.blade.php` colors +- [x] Update `users-export.blade.php` logo +- [x] Update `consultations-export.blade.php` colors +- [x] Update `consultations-export.blade.php` logo +- [x] Update `timelines-export.blade.php` colors +- [x] Update `timelines-export.blade.php` logo +- [x] Update `monthly-report.blade.php` colors +- [x] Update `monthly-report.blade.php` logo +- [x] Update `MonthlyReportService.php` chart colors +- [x] Review `monthly-report.blade.php` Livewire component +- [x] Test Users PDF export +- [x] Test Consultations PDF export +- [x] Test Timelines PDF export +- [x] Test Monthly Report PDF generation +- [x] Verify logo displays correctly in all PDFs - [ ] Test print preview for readability - [ ] Test grayscale printing @@ -182,3 +182,45 @@ $chartColors = [ - Story 12.1 (Logo Deployment) must be completed for logo files - Story 12.2 (Core CSS) should be completed for color reference consistency + +--- + +## Dev Agent Record + +### Status +Ready for Review + +### Agent Model Used +Claude Opus 4.5 + +### File List + +**Modified:** +- `resources/views/pdf/users-export.blade.php` - Updated colors from charcoal to olive green, added square logo +- `resources/views/pdf/consultations-export.blade.php` - Updated colors from charcoal to olive green, added square logo +- `resources/views/pdf/timelines-export.blade.php` - Updated colors from charcoal to olive green, added square logo +- `resources/views/pdf/monthly-report.blade.php` - Updated colors from charcoal to olive green, added square logo (header + cover page) +- `app/Services/MonthlyReportService.php` - Updated chart colors for pie and line charts +- `resources/views/livewire/admin/reports/monthly-report.blade.php` - Updated inline color styles for TOC badges +- `tests/Feature/Admin/PdfBrandColorsTest.php` - Updated tests to check for new olive green colors instead of old charcoal + +### Change Log + +| Date | Change | Reason | +|------|--------|--------| +| 2026-01-04 | Updated all PDF templates with olive green colors | Story 12.5 requirement | +| 2026-01-04 | Added square logo to all PDF headers | Story 12.5 requirement | +| 2026-01-04 | Updated chart colors in MonthlyReportService | Story 12.5 AC5 | +| 2026-01-04 | Updated Livewire component inline colors | Consistency with PDF changes | +| 2026-01-04 | Updated PdfBrandColorsTest to verify new colors | Tests should validate current state | + +### Debug Log References +None - Implementation completed without issues + +### Completion Notes +- All PDF templates updated with olive green palette (`#8AB357` primary, `#A5C87A` accent) +- Square logo (50x50px) added to all PDF headers using `public_path('images/logo.png')` +- Monthly report cover page uses larger logo (100x100px) +- Chart colors in MonthlyReportService updated for pie and line charts +- All 76 related tests pass (6 PDF color tests + 70 export tests) +- Print preview and grayscale testing should be done manually by QA diff --git a/resources/views/livewire/admin/reports/monthly-report.blade.php b/resources/views/livewire/admin/reports/monthly-report.blade.php index f02a830..a747d7d 100644 --- a/resources/views/livewire/admin/reports/monthly-report.blade.php +++ b/resources/views/livewire/admin/reports/monthly-report.blade.php @@ -87,27 +87,27 @@ new class extends Component {{ __('report.table_of_contents') }}
- 1 + 1 {{ __('report.executive_summary') }}
- 2 + 2 {{ __('report.user_statistics') }}
- 3 + 3 {{ __('report.consultation_statistics') }}
- 4 + 4 {{ __('report.timeline_statistics') }}
- 5 + 5 {{ __('report.post_statistics') }}
- 6 + 6 {{ __('report.trends_chart') }}
diff --git a/resources/views/pdf/consultations-export.blade.php b/resources/views/pdf/consultations-export.blade.php index 91f0a16..b540d14 100644 --- a/resources/views/pdf/consultations-export.blade.php +++ b/resources/views/pdf/consultations-export.blade.php @@ -22,7 +22,7 @@ left: 0; right: 0; height: 70px; - border-bottom: 3px solid #C9C4BA; + border-bottom: 3px solid #A5C87A; padding-bottom: 10px; } @@ -47,7 +47,7 @@ .brand-name { font-size: 22px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } .brand-subtitle { @@ -59,7 +59,7 @@ .report-title { font-size: 14px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } footer { @@ -68,7 +68,7 @@ left: 0; right: 0; height: 50px; - border-top: 2px solid #C9C4BA; + border-top: 2px solid #A5C87A; padding-top: 10px; font-size: 9px; color: #666; @@ -98,7 +98,7 @@ .filters-section { background-color: #E8E4DC; - border: 1px solid #C9C4BA; + border: 1px solid #A5C87A; border-radius: 4px; padding: 10px 15px; margin-bottom: 20px; @@ -106,7 +106,7 @@ .filters-title { font-weight: bold; - color: #4A4A42; + color: #8AB357; margin-bottom: 5px; } @@ -118,11 +118,11 @@ .summary { margin-bottom: 15px; - color: #4A4A42; + color: #8AB357; } .summary strong { - color: #4A4A42; + color: #8AB357; } table { @@ -132,8 +132,8 @@ } th { - background-color: #4A4A42; - color: #fff; + background-color: #8AB357; + color: #E8E4DC; padding: 10px 8px; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; font-weight: bold; @@ -143,7 +143,7 @@ td { padding: 8px; - border-bottom: 1px solid #C9C4BA; + border-bottom: 1px solid #A5C87A; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; font-size: 9px; } @@ -220,8 +220,7 @@
-
Libra
-
{{ __('export.libra_law_firm', [], $locale) }}
+ LIBRA for Rights
{{ __('export.consultations_export_title', [], $locale) }}
diff --git a/resources/views/pdf/monthly-report.blade.php b/resources/views/pdf/monthly-report.blade.php index c6b0e1e..4b4d6dc 100644 --- a/resources/views/pdf/monthly-report.blade.php +++ b/resources/views/pdf/monthly-report.blade.php @@ -23,7 +23,7 @@ left: 0; right: 0; height: 70px; - border-bottom: 3px solid #C9C4BA; + border-bottom: 3px solid #A5C87A; padding-bottom: 10px; } @@ -48,7 +48,7 @@ .brand-name { font-size: 24px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } .brand-subtitle { @@ -68,7 +68,7 @@ left: 0; right: 0; height: 50px; - border-top: 2px solid #C9C4BA; + border-top: 2px solid #A5C87A; padding-top: 10px; font-size: 9px; color: #666; @@ -105,7 +105,7 @@ .cover-brand { font-size: 48px; font-weight: bold; - color: #4A4A42; + color: #8AB357; margin-bottom: 10px; } @@ -118,13 +118,13 @@ .cover-title { font-size: 28px; font-weight: bold; - color: #4A4A42; + color: #8AB357; margin-bottom: 20px; } .cover-period { font-size: 22px; - color: #4A4A42; + color: #8AB357; margin-bottom: 60px; } @@ -141,8 +141,8 @@ .section-title { font-size: 18px; font-weight: bold; - color: #4A4A42; - border-bottom: 2px solid #C9C4BA; + color: #8AB357; + border-bottom: 2px solid #A5C87A; padding-bottom: 8px; margin-bottom: 20px; margin-top: 30px; @@ -165,7 +165,7 @@ display: table-cell; width: 30px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } .toc-title { @@ -176,7 +176,7 @@ display: table-cell; width: 40px; text-align: {{ $locale === 'ar' ? 'left' : 'right' }}; - color: #4A4A42; + color: #8AB357; } /* Stats Grid */ @@ -199,7 +199,7 @@ .stat-box { background-color: #E8E4DC; - border: 1px solid #C9C4BA; + border: 1px solid #A5C87A; border-radius: 4px; padding: 15px; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; @@ -215,11 +215,11 @@ .stat-value { font-size: 24px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } .stat-value-gold { - color: #4A4A42; + color: #8AB357; } /* Data Table */ @@ -230,8 +230,8 @@ } .data-table th { - background-color: #4A4A42; - color: #fff; + background-color: #8AB357; + color: #E8E4DC; padding: 10px 12px; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; font-weight: bold; @@ -241,7 +241,7 @@ .data-table td { padding: 10px 12px; - border-bottom: 1px solid #C9C4BA; + border-bottom: 1px solid #A5C87A; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; } @@ -252,7 +252,7 @@ /* Highlights */ .highlight-box { background-color: #E8E4DC; - border: 1px solid #C9C4BA; + border: 1px solid #A5C87A; border-radius: 4px; padding: 15px; margin-bottom: 20px; @@ -260,7 +260,7 @@ .highlight-item { padding: 5px 0; - border-bottom: 1px solid rgba(201, 196, 186, 0.5); + border-bottom: 1px solid rgba(165, 200, 122, 0.5); } .highlight-item:last-child { @@ -268,7 +268,7 @@ } .highlight-bullet { - color: #4A4A42; + color: #8AB357; font-weight: bold; margin-{{ $locale === 'ar' ? 'left' : 'right' }}: 8px; } @@ -294,14 +294,14 @@ margin: 20px 0; padding: 15px; background-color: #fff; - border: 1px solid #C9C4BA; + border: 1px solid #A5C87A; border-radius: 4px; } .chart-title { font-size: 12px; font-weight: bold; - color: #4A4A42; + color: #8AB357; margin-bottom: 15px; } @@ -359,8 +359,7 @@
-
Libra
-
{{ __('report.libra_law_firm', [], $locale) }}
+ LIBRA for Rights
@@ -384,7 +383,7 @@
-
Libra
+ LIBRA for Rights
{{ __('report.libra_law_firm', [], $locale) }}
{{ __('report.report_title', [], $locale) }}
{{ $period }}
diff --git a/resources/views/pdf/timelines-export.blade.php b/resources/views/pdf/timelines-export.blade.php index 2da20f2..b4e6ad7 100644 --- a/resources/views/pdf/timelines-export.blade.php +++ b/resources/views/pdf/timelines-export.blade.php @@ -22,7 +22,7 @@ left: 0; right: 0; height: 70px; - border-bottom: 3px solid #C9C4BA; + border-bottom: 3px solid #A5C87A; padding-bottom: 10px; } @@ -47,7 +47,7 @@ .brand-name { font-size: 22px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } .brand-subtitle { @@ -59,7 +59,7 @@ .report-title { font-size: 14px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } footer { @@ -68,7 +68,7 @@ left: 0; right: 0; height: 50px; - border-top: 2px solid #C9C4BA; + border-top: 2px solid #A5C87A; padding-top: 10px; font-size: 9px; color: #666; @@ -98,7 +98,7 @@ .filters-section { background-color: #E8E4DC; - border: 1px solid #C9C4BA; + border: 1px solid #A5C87A; border-radius: 4px; padding: 10px 15px; margin-bottom: 20px; @@ -106,7 +106,7 @@ .filters-title { font-weight: bold; - color: #4A4A42; + color: #8AB357; margin-bottom: 5px; } @@ -118,11 +118,11 @@ .summary { margin-bottom: 15px; - color: #4A4A42; + color: #8AB357; } .summary strong { - color: #4A4A42; + color: #8AB357; } table { @@ -132,8 +132,8 @@ } th { - background-color: #4A4A42; - color: #fff; + background-color: #8AB357; + color: #E8E4DC; padding: 10px 8px; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; font-weight: bold; @@ -143,7 +143,7 @@ td { padding: 8px; - border-bottom: 1px solid #C9C4BA; + border-bottom: 1px solid #A5C87A; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; font-size: 9px; } @@ -166,13 +166,13 @@ background-color: #E8E4DC; padding: 10px; margin: 5px 0; - border-{{ $locale === 'ar' ? 'right' : 'left' }}: 3px solid #C9C4BA; + border-{{ $locale === 'ar' ? 'right' : 'left' }}: 3px solid #8AB357; } .update-entry { margin-bottom: 8px; padding-bottom: 8px; - border-bottom: 1px dashed #C9C4BA; + border-bottom: 1px dashed #A5C87A; } .update-entry:last-child { @@ -208,8 +208,7 @@
-
Libra
-
{{ __('export.libra_law_firm', [], $locale) }}
+ LIBRA for Rights
{{ __('export.timelines_export_title', [], $locale) }}
diff --git a/resources/views/pdf/users-export.blade.php b/resources/views/pdf/users-export.blade.php index 2f2100c..eaaf4e9 100644 --- a/resources/views/pdf/users-export.blade.php +++ b/resources/views/pdf/users-export.blade.php @@ -22,7 +22,7 @@ left: 0; right: 0; height: 70px; - border-bottom: 3px solid #C9C4BA; + border-bottom: 3px solid #A5C87A; padding-bottom: 10px; } @@ -47,7 +47,7 @@ .brand-name { font-size: 22px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } .brand-subtitle { @@ -59,7 +59,7 @@ .report-title { font-size: 14px; font-weight: bold; - color: #4A4A42; + color: #8AB357; } footer { @@ -68,7 +68,7 @@ left: 0; right: 0; height: 50px; - border-top: 2px solid #C9C4BA; + border-top: 2px solid #A5C87A; padding-top: 10px; font-size: 9px; color: #666; @@ -98,7 +98,7 @@ .filters-section { background-color: #E8E4DC; - border: 1px solid #C9C4BA; + border: 1px solid #A5C87A; border-radius: 4px; padding: 10px 15px; margin-bottom: 20px; @@ -106,7 +106,7 @@ .filters-title { font-weight: bold; - color: #4A4A42; + color: #8AB357; margin-bottom: 5px; } @@ -118,11 +118,11 @@ .summary { margin-bottom: 15px; - color: #4A4A42; + color: #8AB357; } .summary strong { - color: #4A4A42; + color: #8AB357; } table { @@ -132,8 +132,8 @@ } th { - background-color: #4A4A42; - color: #fff; + background-color: #8AB357; + color: #E8E4DC; padding: 10px 8px; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; font-weight: bold; @@ -143,7 +143,7 @@ td { padding: 8px; - border-bottom: 1px solid #C9C4BA; + border-bottom: 1px solid #A5C87A; text-align: {{ $locale === 'ar' ? 'right' : 'left' }}; font-size: 9px; } @@ -184,8 +184,7 @@
-
Libra
-
{{ __('export.libra_law_firm', [], $locale) }}
+ LIBRA for Rights
{{ __('export.users_export_title', [], $locale) }}
diff --git a/tests/Feature/Admin/PdfBrandColorsTest.php b/tests/Feature/Admin/PdfBrandColorsTest.php index 4d45dbd..a673ef7 100644 --- a/tests/Feature/Admin/PdfBrandColorsTest.php +++ b/tests/Feature/Admin/PdfBrandColorsTest.php @@ -4,87 +4,87 @@ // PDF Template Brand Color Tests // =========================================== // Verifies that all PDF templates use the new brand colors: -// - Charcoal: #4A4A42 (primary/header background) -// - Warm Gray: #C9C4BA (accent/borders) +// - Olive Green: #8AB357 (primary/header background) +// - Light Olive: #A5C87A (accent/borders) // - Light Background: #E8E4DC // - Deep Black: #1A1A1A (text) test('users-export PDF template uses new brand colors', function () { $template = file_get_contents(resource_path('views/pdf/users-export.blade.php')); - // Should contain new colors - expect($template)->toContain('#4A4A42'); // Charcoal - expect($template)->toContain('#C9C4BA'); // Warm Gray + // Should contain new olive green colors + expect($template)->toContain('#8AB357'); // Olive Green + expect($template)->toContain('#A5C87A'); // Light Olive expect($template)->toContain('#E8E4DC'); // Light Background expect($template)->toContain('#1A1A1A'); // Deep Black text // Should NOT contain old colors - expect($template)->not->toContain('#0A1F44'); // Old Navy - expect($template)->not->toContain('#D4AF37'); // Old Gold + expect($template)->not->toContain('#4A4A42'); // Old Charcoal + expect($template)->not->toContain('#C9C4BA'); // Old Warm Gray }); test('consultations-export PDF template uses new brand colors', function () { $template = file_get_contents(resource_path('views/pdf/consultations-export.blade.php')); - // Should contain new colors - expect($template)->toContain('#4A4A42'); // Charcoal - expect($template)->toContain('#C9C4BA'); // Warm Gray + // Should contain new olive green colors + expect($template)->toContain('#8AB357'); // Olive Green + expect($template)->toContain('#A5C87A'); // Light Olive expect($template)->toContain('#E8E4DC'); // Light Background expect($template)->toContain('#1A1A1A'); // Deep Black text // Should NOT contain old colors - expect($template)->not->toContain('#0A1F44'); // Old Navy - expect($template)->not->toContain('#D4AF37'); // Old Gold + expect($template)->not->toContain('#4A4A42'); // Old Charcoal + expect($template)->not->toContain('#C9C4BA'); // Old Warm Gray }); test('timelines-export PDF template uses new brand colors', function () { $template = file_get_contents(resource_path('views/pdf/timelines-export.blade.php')); - // Should contain new colors - expect($template)->toContain('#4A4A42'); // Charcoal - expect($template)->toContain('#C9C4BA'); // Warm Gray + // Should contain new olive green colors + expect($template)->toContain('#8AB357'); // Olive Green + expect($template)->toContain('#A5C87A'); // Light Olive expect($template)->toContain('#E8E4DC'); // Light Background expect($template)->toContain('#1A1A1A'); // Deep Black text // Should NOT contain old colors - expect($template)->not->toContain('#0A1F44'); // Old Navy - expect($template)->not->toContain('#D4AF37'); // Old Gold + expect($template)->not->toContain('#4A4A42'); // Old Charcoal + expect($template)->not->toContain('#C9C4BA'); // Old Warm Gray }); test('monthly-report PDF template uses new brand colors', function () { $template = file_get_contents(resource_path('views/pdf/monthly-report.blade.php')); - // Should contain new colors - expect($template)->toContain('#4A4A42'); // Charcoal - expect($template)->toContain('#C9C4BA'); // Warm Gray + // Should contain new olive green colors + expect($template)->toContain('#8AB357'); // Olive Green + expect($template)->toContain('#A5C87A'); // Light Olive expect($template)->toContain('#E8E4DC'); // Light Background expect($template)->toContain('#1A1A1A'); // Deep Black text // Should NOT contain old colors - expect($template)->not->toContain('#0A1F44'); // Old Navy - expect($template)->not->toContain('#D4AF37'); // Old Gold + expect($template)->not->toContain('#4A4A42'); // Old Charcoal + expect($template)->not->toContain('#C9C4BA'); // Old Warm Gray }); test('MonthlyReportService uses new brand colors for charts', function () { $service = file_get_contents(app_path('Services/MonthlyReportService.php')); - // Should contain new colors for charts - expect($service)->toContain('#4A4A42'); // Charcoal - expect($service)->toContain('#C9C4BA'); // Warm Gray + // Should contain new olive green colors for charts + expect($service)->toContain('#8AB357'); // Olive Green + expect($service)->toContain('#A5C87A'); // Light Olive // Should NOT contain old colors - expect($service)->not->toContain('#0A1F44'); // Old Navy - expect($service)->not->toContain('#D4AF37'); // Old Gold + expect($service)->not->toContain('#4A4A42'); // Old Charcoal + expect($service)->not->toContain('#C9C4BA'); // Old Warm Gray }); test('monthly-report Livewire component uses new brand colors', function () { $template = file_get_contents(resource_path('views/livewire/admin/reports/monthly-report.blade.php')); - // Should contain new colors - expect($template)->toContain('#4A4A42'); // Charcoal - expect($template)->toContain('#C9C4BA'); // Warm Gray + // Should contain new olive green colors + expect($template)->toContain('#8AB357'); // Olive Green + expect($template)->toContain('#A5C87A'); // Light Olive // Should NOT contain old colors - expect($template)->not->toContain('#0A1F44'); // Old Navy - expect($template)->not->toContain('#D4AF37'); // Old Gold + expect($template)->not->toContain('#4A4A42'); // Old Charcoal + expect($template)->not->toContain('#C9C4BA'); // Old Warm Gray });