# Gallery Page Redesign

**Date:** 2026-07-22  
**Developer:** Jeetendra Maharjan  
**Status:** In Progress

---

## Summary
Redesign `/gallery` so the latest album appears first (title + 4–5 preview photos + “View all {n} photos”), with older galleries listed below as cover + title + photo count.

---

## Changes Made

### 1 — GalleryService from folder scan
- **File(s) affected:** `app/Services/Gallery/GalleryService.php`
- **What was done:** Added service that scans `public/fe/images/gallery_*`, builds slug/title/year/photo lists, and returns latest + others
- **Why:** Drive gallery page from folders (same pattern as ChildrenService)

### 2 — GalleryController index + show
- **File(s) affected:** `app/Http/Controllers/Frontend/Gallery/GalleryController.php`, `routes/web.php`
- **What was done:** Injected GalleryService; index passes latest/others; added `/gallery/{slug}` show route
- **Why:** Thin controller + detail page for “View all {n} photos”

### 3 — Redesigned gallery index
- **File(s) affected:** `resources/views/frontend/gallery.blade.php`
- **What was done:** Latest album with title, preview grid, View all link; archive list of other galleries with cover, title, photo count
- **Why:** Match requested layout

### 4 — Gallery detail page
- **File(s) affected:** `resources/views/frontend/gallery-show.blade.php`
- **What was done:** Full masonry album view with lightbox for a single gallery slug
- **Why:** Support viewing all photos in an album

### 5 — Gallery layout CSS
- **File(s) affected:** `public/fe/assets/css/style.css`
- **What was done:** Styles for latest preview grid (3–5 photos), album list cards, empty/coming-soon states
- **Why:** Support the redesigned UI on desktop and mobile

---

## Decisions & Notes
- Galleries are driven from folders under `public/fe/images/gallery_*`, similar to ChildrenService.
- Empty folders (e.g. 2014 / 2018) still appear in the archive list with a placeholder cover and “Coming soon”.
- Zero-byte image files are ignored when counting photos.
- Slugs: `gallery_recent_2025` → `recent-2025`, `gallery_2018` → `2018`.

---

## Pending / Follow-up
- [ ] Add more photos to historical gallery folders when available
- [ ] Replace empty `ocp-gallery_4.jpeg` with a real image if desired
