complete story 14.5

This commit is contained in:
Naser Mansour
2026-01-09 17:18:27 +02:00
parent 88961e11b4
commit 49aeceb25c
6 changed files with 319 additions and 18 deletions
+55 -13
View File
@@ -220,19 +220,19 @@ $post->created_at->translatedFormat('j F Y')
## Dev Checklist
- [ ] Determine data passing method (Volt component or route)
- [ ] Create posts section HTML structure
- [ ] Add section heading with translations
- [ ] Implement post card design
- [ ] Query and display 3 latest published posts
- [ ] Add date formatting with translation support
- [ ] Implement excerpt truncation
- [ ] Add "Read More" links to individual posts
- [ ] Add "View All" link to posts index
- [ ] Handle empty state (hide section or show message)
- [ ] Implement responsive grid layout
- [ ] Test RTL layout
- [ ] Verify links work correctly
- [x] Determine data passing method (Volt component or route)
- [x] Create posts section HTML structure
- [x] Add section heading with translations
- [x] Implement post card design
- [x] Query and display 3 latest published posts
- [x] Add date formatting with translation support
- [x] Implement excerpt truncation
- [x] Add "Read More" links to individual posts
- [x] Add "View All" link to posts index
- [x] Handle empty state (hide section or show message)
- [x] Implement responsive grid layout
- [x] Test RTL layout
- [x] Verify links work correctly
## Estimation
@@ -244,3 +244,45 @@ $post->created_at->translatedFormat('j F Y')
- Previous stories for page structure
- Existing Post model
- Posts routes (`posts.index`, `posts.show`)
---
## Dev Agent Record
### Status
Ready for Review
### Agent Model Used
Claude Opus 4.5 (claude-opus-4-5-20251101)
### File List
| File | Action |
|------|--------|
| `resources/views/livewire/pages/home.blade.php` | Created (new Volt component) |
| `resources/views/pages/home.blade.php` | Deleted (replaced by Volt component) |
| `routes/web.php` | Modified (changed to Volt::route) |
| `lang/en/home.php` | Modified (added posts translations) |
| `lang/ar/home.php` | Modified (added posts translations) |
| `tests/Feature/Public/HomePageTest.php` | Modified (added 17 new tests) |
### Change Log
- Converted home page from plain Blade view to Volt component with `with()` method for data fetching
- Added latest posts section that displays 3 most recent published posts
- Implemented responsive grid layout (1 col mobile, 2 col tablet, 3 col desktop)
- Added post cards with title, date, excerpt, and "Read More" links
- Added "View All Articles" button linking to posts index
- Section hidden when no published posts exist (empty state)
- Used Post model's `getTitle()` and `getExcerpt()` methods for bilingual support
- Uses `published_at` for ordering and display, with fallback to `created_at`
- Added wire:navigate for SPA-like navigation
- Added hover effects on cards and title links
### Debug Log References
None - implementation completed without issues
### Completion Notes
- All acceptance criteria met
- 17 new tests added covering posts section functionality
- All 91 home page and posts tests pass
- RTL support inherited from existing layout structure
- Uses existing Post model scope `published()` for filtering