preview: add minimal preview for albums with no images
This commit is contained in:
parent
0a22d1ca8a
commit
b146db9d0a
@ -136,16 +136,15 @@ html, body {
|
||||
return
|
||||
}
|
||||
|
||||
if len(childIDs) == 0 {
|
||||
log.Printf("Failed to parse album '%s': no entries in album", fileID)
|
||||
http.Error(w, "Internal error", 500)
|
||||
return
|
||||
albumThumb := `/nothumb_340.png`
|
||||
if len(childIDs) > 0 {
|
||||
albumThumb = `/thumb/m/` + childIDs[0]
|
||||
}
|
||||
|
||||
tmpl += `
|
||||
<div class="entry">
|
||||
<div class="thumbnail">
|
||||
<a href="` + html.EscapeString(`/p/`+strings.Join(childIDs, `-`)) + `"><img loading="lazy" src="` + html.EscapeString(`/thumb/m/`+childIDs[0]) + `"></a>
|
||||
<a href="` + html.EscapeString(`/p/`+strings.Join(childIDs, `-`)) + `"><img loading="lazy" src="` + html.EscapeString(albumThumb) + `"></a>
|
||||
<div class="thumbnail-overlay">` + fmt.Sprintf("%d", len(childIDs)) + ` image(s)</div>
|
||||
</div>
|
||||
<div class="properties">
|
||||
|
Loading…
Reference in New Issue
Block a user