package templates
import (
"fmt"
"time"
"technical.kiwi/website/internal/gallery"
)
templ GalleryGrid(images []gallery.Image) {
if len(images) == 0 {
No images for this filter.
} else {
for _, img := range images {
}
}
}
templ ImageModal(img gallery.Image, prevPath, nextPath string) {
if !img.Date.IsZero() {
{ modalCaption(img) }
}
}
func formatDate(t time.Time) string {
if t.IsZero() {
return ""
}
return t.Format("2 Jan 2006")
}
func modalCaption(img gallery.Image) string {
if img.Collection != "" {
return img.Collection + " — " + formatDate(img.Date)
}
if img.Album != "" {
return gallery.AlbumLabel(img.Album) + " — " + formatDate(img.Date)
}
return formatDate(img.Date)
}