From b6e481d63eec15191f2717957682c13ee8a68308 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 26 Mar 2025 16:59:39 +0100 Subject: [feature] Allow user to choose "gallery" style layout for web view of profile (#3917) * [feature] Allow user to choose "gallery" style web layout * find a bug and squish it up and all day long you'll have good luck * just a sec * [performance] reindex public timeline + tinker with query a bit * fiddling * should be good now * last bit of finagling, i'm done now i prommy * panic normally --- web/template/status.tmpl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'web/template/status.tmpl') diff --git a/web/template/status.tmpl b/web/template/status.tmpl index 85000fd72..872b784ed 100644 --- a/web/template/status.tmpl +++ b/web/template/status.tmpl @@ -30,6 +30,16 @@ it in an appropriate
! */ -}} +{{- /* Produces something like "1 attachment", "2 attachments", etc */ -}} +{{- define "attachmentsLength" -}} +{{- (len .) }}{{- if eq (len .) 1 }} attachment{{- else }} attachments{{- end -}} +{{- end -}} + +{{- /* Produces something like "media photoswipe-gallery odd single" */ -}} +{{- define "galleryClass" -}} +media photoswipe-gallery {{ (len .) | oddOrEven }} {{ if eq (len .) 1 }}single{{ else if eq (len .) 2 }}double{{ end }} +{{- end -}} + {{- with . }}
{{- include "status_header.tmpl" . | indent 1 }} @@ -63,7 +73,15 @@ {{- end }} {{- if .MediaAttachments }} - {{- include "status_attachments.tmpl" . | indent 1 }} +
+ {{- range $index, $media := .MediaAttachments }} + {{- includeIndex "status_attachment.tmpl" $media $index | indent 2 }} + {{- end }} +
{{- end }}