From 3949117be01ac8aca7e41a7179506f27627654e5 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:51:17 +0200 Subject: [feature] Use blurhashes in frontend, tidy up gallery view a bit (#3948) * [feature] Use blurhashes in frontend, tidy up gallery view a bit * weeeeeeeeeeeeeeeee * beep boop --- web/template/page.tmpl | 9 +++++- web/template/status_attachment.tmpl | 63 ++++++++++++++----------------------- 2 files changed, 32 insertions(+), 40 deletions(-) (limited to 'web/template') diff --git a/web/template/page.tmpl b/web/template/page.tmpl index 7dccc7469..0a54e74cb 100644 --- a/web/template/page.tmpl +++ b/web/template/page.tmpl @@ -67,7 +67,9 @@ image/webp {{- include "page_stylesheets.tmpl" . | indent 2 }} {{- range .javascript }} - + {{- if not .Bottom }} + + {{- end }} {{- end }} {{- template "instanceTitle" . -}} @@ -82,5 +84,10 @@ image/webp + {{- range .javascript }} + {{- if .Bottom }} + + {{- end }} + {{- end }} \ No newline at end of file diff --git a/web/template/status_attachment.tmpl b/web/template/status_attachment.tmpl index bdfafa96f..4dda7298f 100644 --- a/web/template/status_attachment.tmpl +++ b/web/template/status_attachment.tmpl @@ -17,33 +17,7 @@ // along with this program. If not, see . */ -}} -{{- define "imagePreview" }} -{{- .Description -}} -{{- end }} - -{{- define "videoPreview" }} -{{- .Description -}} -{{- end }} - -{{- define "audioPreview" }} +{{- define "preview" }} {{- if and .PreviewURL .Meta.Small.Width }} {{- else }}
- + - + - {{- if or (eq .Item.Type "video") (eq .Item.Type "gifv") }} - {{- include "videoPreview" .Item | indent 3 }} - {{- else if eq .Item.Type "image" }} - {{- include "imagePreview" .Item | indent 3 }} - {{- else if eq .Item.Type "audio" }} - {{- include "audioPreview" .Item | indent 3 }} + {{- if and (not (eq .Item.Type "unknown")) .Item.Meta.Small.Width }} +
{{- end }}
{{- if or (eq .Item.Type "video") (eq .Item.Type "gifv") }}