mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-05 05:08:08 -06:00
[feature] Allow user to choose "gallery" style web layout
This commit is contained in:
parent
d3c3d34aae
commit
7e689edbe3
82 changed files with 2840 additions and 1154 deletions
|
|
@ -30,6 +30,16 @@
|
|||
it in an appropriate <article></article>!
|
||||
*/ -}}
|
||||
|
||||
{{- /* 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 . }}
|
||||
<header class="status-header">
|
||||
{{- include "status_header.tmpl" . | indent 1 }}
|
||||
|
|
@ -63,7 +73,15 @@
|
|||
</div>
|
||||
{{- end }}
|
||||
{{- if .MediaAttachments }}
|
||||
{{- include "status_attachments.tmpl" . | indent 1 }}
|
||||
<div
|
||||
class="{{- template "galleryClass" .MediaAttachments -}}"
|
||||
role="group"
|
||||
aria-label="{{- template "attachmentsLength" .MediaAttachments -}}"
|
||||
>
|
||||
{{- range $index, $media := .MediaAttachments }}
|
||||
{{- includeIndex "status_attachment.tmpl" $media $index | indent 2 }}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
<aside class="status-info" aria-hidden="true">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue