mirror of
1
Fork 0

template formatting

This commit is contained in:
f0x 2024-11-06 15:52:08 +01:00
parent 7f4d9b689a
commit 4a2c712b3d
36 changed files with 1037 additions and 1039 deletions

View File

@ -3,6 +3,9 @@
"go.lintFlags": [
"--fast"
],
"go.testEnvVars": {
"WAZERO_COMPILATION_CACHE": "~/.cache/wazero"
},
"gopls": {
"analyses": {
"composites": false
@ -19,5 +22,9 @@
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"html.format.wrapLineLength": 0,
"html.format.wrapAttributes": "preserve",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
}

View File

@ -23,10 +23,13 @@ Someone has submitted a new account sign-up to your instance.
They provided the following details:
Email address: {{ .SignupEmail }}
Username: {{ .SignupUsername }}
Email address:
{{ .SignupEmail }}
Username:
{{ .SignupUsername }}
{{- if .SignupReason }}
Reason: {{ .SignupReason }}
Reason:
{{ .SignupReason }}
{{- end }}
To view the sign-up, paste the following link into your browser: {{ .SignupURL }}

View File

@ -26,8 +26,7 @@
href="{{ .URL }}"
class="nounderline"
rel="nofollow noreferrer noopener"
target="_blank"
>
target="_blank">
@{{ .Username }}
</a>
</b>
@ -42,48 +41,47 @@
{{- define "avatarWidth" -}}
{{- with .account }}
{{- if isNil .AvatarAttachment -}}
{{- template "defaultAvatarDimension" . -}}
{{- else -}}
{{- /* Use the avatar's proper dimensions. */ -}}
{{- .AvatarAttachment.Meta.Original.Width -}}
{{- end -}}
{{- if isNil .AvatarAttachment -}}
{{- template "defaultAvatarDimension" . -}}
{{- else -}}
{{- /* Use the avatar's proper dimensions. */ -}}
{{- .AvatarAttachment.Meta.Original.Width -}}
{{- end -}}
{{- end }}
{{- end -}}
{{- define "avatarHeight" -}}
{{- with .account }}
{{- if isNil .AvatarAttachment -}}
{{- template "defaultAvatarDimension" . -}}
{{- else -}}
{{- /* Use the avatar's proper dimensions. */ -}}
{{- .AvatarAttachment.Meta.Original.Height -}}
{{- end -}}
{{- if isNil .AvatarAttachment -}}
{{- template "defaultAvatarDimension" . -}}
{{- else -}}
{{- /* Use the avatar's proper dimensions. */ -}}
{{- .AvatarAttachment.Meta.Original.Height -}}
{{- end -}}
{{- end }}
{{- end -}}
{{- define "avatarAlt" -}}
Avatar for {{ .account.Username -}}
{{- if .account.AvatarDescription }}
{{- /* Add the avatar's image description. */ -}}
: {{ .account.AvatarDescription -}}
{{- end -}}
Avatar for {{ .account.Username -}}
{{- if .account.AvatarDescription }}
{{- /* Add the avatar's image description. */ -}}
: {{ .account.AvatarDescription -}}
{{- end -}}
{{- end -}}
{{- define "headerAlt" -}}
Header for {{ .account.Username -}}
{{- if .account.HeaderDescription }}
{{- /* Add the header's image description. */ -}}
: {{ .account.HeaderDescription -}}
{{- end -}}
Header for {{ .account.Username -}}
{{- if .account.HeaderDescription }}
{{- /* Add the header's image description. */ -}}
: {{ .account.HeaderDescription -}}
{{- end -}}
{{- end -}}
{{- define "avatar" -}}
{{- with . }}
<div
class="media photoswipe-gallery odd single avatar-image-wrapper"
role="group"
>
role="group">
<a
class="photoswipe-slide"
href="{{- .account.Avatar -}}"
@ -92,18 +90,15 @@
data-pswp-height="{{- template "avatarHeight" . -}}px"
data-cropped="true"
alt="{{- template "avatarAlt" . -}}"
title="{{- template "avatarAlt" . -}}"
>
title="{{- template "avatarAlt" . -}}">
<picture
aria-hidden="true"
>
aria-hidden="true">
{{- if .account.AvatarAttachment }}
<source
class="avatar"
srcset="{{- .account.AvatarStatic -}}"
type="{{- .account.AvatarAttachment.PreviewMIMEType -}}"
media="(prefers-reduced-motion: reduce)"
/>
media="(prefers-reduced-motion: reduce)" />
{{- end }}
<img
class="avatar"
@ -111,8 +106,7 @@
alt="{{- template "avatarAlt" . -}}"
title="{{- template "avatarAlt" . -}}"
width="{{- template "avatarWidth" . -}}"
height="{{- template "avatarHeight" . -}}"
/>
height="{{- template "avatarHeight" . -}}" />
</picture>
</a>
</div>
@ -132,14 +126,12 @@
<source
srcset="{{- .account.HeaderStatic -}}"
type="{{- .account.HeaderAttachment.PreviewMIMEType -}}"
media="(prefers-reduced-motion: reduce)"
/>
media="(prefers-reduced-motion: reduce)" />
{{- end }}
<img
src="{{- .account.Header -}}"
alt="{{- template "headerAlt" . -}}"
title="{{- template "headerAlt" . -}}"
/>
title="{{- template "headerAlt" . -}}" />
</picture>
</div>
<div class="basic-info">
@ -163,8 +155,7 @@
<div
class="bot-legend-wrapper"
aria-hidden="true"
title="This is a bot account."
>
title="This is a bot account.">
<i class="bot-icon fa fa-microchip"></i>
<span class="bot-legend">bot</span>
</div>
@ -221,8 +212,7 @@
{{- range .pinned_statuses }}
<article
class="status expanded"
{{- includeAttr "status_attributes.tmpl" . | indentAttr 6 }}
>
{{- includeAttr "status_attributes.tmpl" . | indentAttr 6 }}>
{{- include "status.tmpl" . | indent 6 }}
</article>
{{- end }}
@ -245,8 +235,7 @@
{{- range .statuses }}
<article
class="status expanded"
{{- includeAttr "status_attributes.tmpl" . | indentAttr 6 }}
>
{{- includeAttr "status_attributes.tmpl" . | indentAttr 6 }}>
{{- include "status.tmpl" . | indent 6 }}
</article>
{{- end }}

View File

@ -90,9 +90,8 @@ media photoswipe-gallery {{ (len .) | oddOrEven }} {{ if eq (len .) 1 }}single{{
{{- if .Description }}
alt="{{- $media.Description -}}"
title="{{- $media.Description -}}"
{{- end }}
>
<source type="{{- $media.MIMEType -}}" src="{{- $media.URL -}}"/>
{{- end }}>
<source type="{{- $media.MIMEType -}}" src="{{- $media.URL -}}" />
</video>
{{- else if eq .Type "audio" }}
<video