From 6ba4ff0a930f3a3c053af2553950fcfe5b5ad180 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Thu, 8 Jul 2021 23:15:49 -0700 Subject: changed catalog image to previw image if available --- static/ncatalog.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/ncatalog.html b/static/ncatalog.html index 4c6c589..68bb01a 100644 --- a/static/ncatalog.html +++ b/static/ncatalog.html @@ -67,7 +67,15 @@ img.style = "max-width: 180px; max-height: 180px;" img.setAttribute("id", "img") img.setAttribute("main", "1") - img.setAttribute("src", "{{ proxy (index .Attachment 0).Href }}") + img.setAttribute("enlarge", "0") + img.setAttribute("attachment", "{{ proxy (index .Attachment 0).Href }}") + {{ if .Preview.Href }} + img.setAttribute("src", "{{ proxy .Preview.Href }}") + img.setAttribute("preview", "{{ proxy .Preview.Href }}") + {{ else }} + img.setAttribute("src", "{{ proxy (index .Attachment 0).Href }}") + img.setAttribute("preview", "{{ proxy (index .Attachment 0).Href }}") + {{ end }} media.appendChild(img) } -- cgit v1.2.3