refactor/split css, templates

This commit is contained in:
f0x 2024-11-05 15:53:22 +01:00
commit 70342681c1
54 changed files with 1371 additions and 1600 deletions

View file

@ -42,7 +42,7 @@
{{- end }}
</ol>
{{- else }}
<p>No preferred languages have yet been set for this instance.</p>
<p>No preferred languages have yet been set for this instance.</p>
{{- end }}
{{- end -}}
@ -60,7 +60,8 @@
{{- end -}}
{{- define "customCSSLimits" -}}
<a href="https://docs.gotosocial.org/en/latest/user_guide/settings/#custom-css" target="_blank" rel="noopener noreferrer">Custom CSS</a> is&nbsp;
<a href="https://docs.gotosocial.org/en/latest/user_guide/settings/#custom-css" target="_blank"
rel="noopener noreferrer">Custom CSS</a> is&nbsp;
{{- if .instance.Configuration.Accounts.AllowCustomCSS -}}
<b>enabled</b>
{{- else -}}
@ -82,43 +83,43 @@ Polls can have up to
{{- end -}}
{{- with . }}
<main class="about">
<nav class="about-section" aria-labelledby="toc">
<h3 id="toc">Table of Contents</h3>
<div class="about-section-contents">
<ol>
<li><a href="#about">About {{ .instance.Title -}}</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#features">Features</a></li>
<li><a href="#languages">Languages</a></li>
<li><a href="#signup">Register an Account on {{ .instance.Title -}}</a></li>
<li><a href="#rules">Rules</a></li>
<li><a href="#terms">Terms and Conditions</a></li>
<li><a href="#moderated-servers">Moderated Servers</a></li>
</ol>
</div>
</nav>
<section class="about-section" role="region" aria-labelledby="about">
<h3 id="about">About {{ .instance.Title -}}</h3>
<div class="about-section-contents">
<nav class="sidebar" aria-labelledby="toc">
<h2 id="toc">Table of Contents</h2>
<div>
<ol>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#features">Features</a></li>
<li><a href="#languages">Languages</a></li>
<li><a href="#signup">Register an Account</a></li>
<li><a href="#rules">Rules</a></li>
<li><a href="#terms">Terms and Conditions</a></li>
<li><a href="#moderated-servers">Moderated Servers</a></li>
</ol>
</div>
</nav>
<main class="single-page">
<section role="region" aria-labelledby="about">
<h2 id="about">About {{ .instance.Title -}}</h2>
<div>
{{- with . }}
{{- include "description" . | indent 3 }}
{{- end }}
</div>
</section>
<section class="about-section" role="region" aria-labelledby="contact">
<h3 id="contact">Admin Contact</h3>
<div class="about-section-contents">
<section role="region" aria-labelledby="contact">
<h2 id="contact">Admin Contact</h2>
<div>
{{- if .instance.ContactAccount }}
<a href="{{- .instance.ContactAccount.URL -}}" class="account-card">
<img class="avatar" src="{{- .instance.ContactAccount.Avatar -}}" alt=""/>
<h3>
<img class="avatar" src="{{- .instance.ContactAccount.Avatar -}}" alt="" />
<b>
{{- if .instance.ContactAccount.DisplayName -}}
{{- emojify .instance.ContactAccount.Emojis (escape .instance.ContactAccount.DisplayName) -}}
{{- else -}}
{{- .instance.ContactAccount.Username -}}
{{- end -}}
</h3>
</b>
<span>@{{- .instance.ContactAccount.Username -}}</span>
</a>
{{- else }}
@ -131,9 +132,9 @@ Polls can have up to
{{- end }}
</div>
</section>
<section class="about-section" role="region" aria-labelledby="features">
<h3 id="features">Instance Features</h3>
<div class="about-section-contents">
<section role="region" aria-labelledby="features">
<h2 id="features">Instance Features</h2>
<div>
<ul>
<li>{{- template "statusLimits" . -}}</li>
<li>{{- template "pollLimits" . -}}</li>
@ -141,34 +142,34 @@ Polls can have up to
</ul>
</div>
</section>
<section class="about-section" role="region" aria-labelledby="languages">
<h3 id="languages">Languages</h3>
<div class="about-section-contents">
<section role="region" aria-labelledby="languages">
<h2 id="languages">Languages</h2>
<div>
{{- with . }}
{{- include "languages" . | indent 3 }}
{{- end }}
</div>
</section>
{{- include "index_register.tmpl" . | indent 1 }}
<section class="about-section" role="region" aria-labelledby="rules">
<h3 id="rules">Instance Rules</h3>
<div class="about-section-contents">
<section role="region" aria-labelledby="rules">
<h2 id="rules">Instance Rules</h2>
<div>
{{- with . }}
{{- include "rules" . | indent 3 }}
{{- end }}
</div>
</section>
<section class="about-section" role="region" aria-labelledby="terms">
<h3 id="terms">Terms and Conditions</h3>
<div class="about-section-contents">
<section role="region" aria-labelledby="terms">
<h2 id="terms">Terms and Conditions</h2>
<div>
{{- with . }}
{{- include "termsAndConditions" . | indent 3 }}
{{- end }}
</div>
</section>
<section class="about-section" role="region" aria-labelledby="moderated-servers">
<h3 id="moderated-servers">Moderated servers</h3>
<div class="about-section-contents">
<section role="region" aria-labelledby="moderated-servers">
<h2 id="moderated-servers">Moderated servers</h2>
<div>
<p>
ActivityPub instances federate with other instances by exchanging data with them over the network.
Exchanged data includes things like accounts, statuses, likes, boosts, and media attachments.
@ -176,8 +177,10 @@ Polls can have up to
by an instance admin. When an instance is domain blocked by another instance:
</p>
<ul>
<li>Any existing data from the blocked instance is deleted from the storage of the instance doing the blocking.</li>
<li>Interaction between the two instances is cut off in both directions; neither instance can interact with the other.</li>
<li>Any existing data from the blocked instance is deleted from the storage of the instance doing the
blocking.</li>
<li>Interaction between the two instances is cut off in both directions; neither instance can interact
with the other.</li>
<li>No new data from the blocked instance will be created on the instance that blocks it.</li>
</ul>
<p>
@ -190,4 +193,4 @@ Polls can have up to
</div>
</section>
</main>
{{- end }}
{{- end }}

View file

@ -23,4 +23,4 @@ Hello moderator of {{ .InstanceName }} ({{ .InstanceURL }})!
{{- else if .ReportTargetDomain }}Someone from your instance has reported a user from {{ .ReportTargetDomain }}.
{{- else }}Someone from your instance has reported another user from your instance.{{ end }}
To view the report, paste the following link into your browser: {{ .ReportURL }}
To view the report, paste the following link into your browser: {{ .ReportURL }}

View file

@ -31,19 +31,14 @@
</p>
<div class="labelinput">
<label for="username">
Username (lowercase a-z, numbers, and underscores; max 64 characters).<br/>
<small>Your username will be part of your fediverse handle, and cannot be changed later, so choose thoughtfully!</small>
Username (lowercase a-z, numbers, and underscores; max 64 characters).<br />
<small>Your username will be part of your fediverse handle, and cannot be changed later, so choose
thoughtfully!</small>
</label>
<input
id="username"
type="text"
name="username"
required
placeholder="Please enter your desired username"
pattern="^[a-z0-9_]{1,64}$"
<input id="username" type="text" name="username" required
placeholder="Please enter your desired username" pattern="^[a-z0-9_]{1,64}$"
title="lowercase a-z, numbers, and underscores; max 64 characters"
value="{{- .preferredUsername -}}"
>
value="{{- .preferredUsername -}}">
</div>
<input type="hidden" name="name" value="{{- .name -}}">
<button type="submit" class="btn btn-success">Submit</button>

View file

@ -26,10 +26,10 @@
{{- end -}}
{{- with . }}
<main class="about">
<section class="about-section" role="region" aria-labelledby="about">
<h3 id="about">About this instance</h3>
<div class="about-section-contents">
<main class="index-page sectioned">
<section role="region" aria-labelledby="about">
<h2 id="about">About this instance</h2>
<div>
{{- include "shortDescription" . | indent 3 }}
<a href="/about">See more details</a>
</div>

View file

@ -18,11 +18,11 @@
*/ -}}
{{- with . }}
<section role="region" class="about-section apps" aria-labelledby="apps">
<h3 id="apps">Client applications</h3>
<div class="about-section-contents">
<section role="region" class="apps" aria-labelledby="apps">
<h2 id="apps">Client applications</h2>
<div>
<p>
Have an account on this instance and want to log in?
Have an account on this instance and want to log in?
GoToSocial does not provide its own webclient, but implements the Mastodon client API.
You can use a variety of clients to log in to your account here:
</p>
@ -30,87 +30,51 @@
<li class="applist-entry">
<div class="applist-text">
<p><strong>Semaphore</strong> is a web client designed for speed and simplicity.</p>
<a
href="https://semaphore.social/"
rel="nofollow noreferrer noopener"
target="_blank"
>
<a href="https://semaphore.social/" rel="nofollow noreferrer noopener" target="_blank">
Use Semaphore
</a>
</div>
<svg
role="img"
aria-labelledby="semaphore-title semaphore-desc"
class="applist-logo redraw"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 146 120"
width="100"
height="100"
>
<svg role="img" aria-labelledby="semaphore-title semaphore-desc" class="applist-logo redraw"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 146 120" width="100" height="100">
<title id="semaphore-title">The Semaphore logo</title>
<desc id="semaphore-desc">A waving flag</desc>
<path d="M68.13 0C53.94 0 42.81 20 13.9 27.1l-2.23-5.29a6.5 6.5 0 0 0-5.17-10.4 6.5 6.5 0 0 0-.81 12.95L46.2 120l5.99-2.5-14.42-33.33c22.8-6.86 32.51-22.16 49.83-20.58 9.9.9 4.87 19.56 8.11 17.93 16.22-8.15 32.44-11.41 50.29-11.41-7.96-9.78-17.38-20.55-22.71-31.74L120.8 32c-2.32-7.33-2.56-14.75.87-22.22-9.74-3.26-21.1 0-32.45 4.9C82.2 9.77 79.5 0 68.13 0zM15.26 30.42c8.95 6.63 13.63 13.86 16.07 20.94l1.62 6.32c1.24 6.58 1.07 12.8 1.27 18.03z"></path>
<path
d="M68.13 0C53.94 0 42.81 20 13.9 27.1l-2.23-5.29a6.5 6.5 0 0 0-5.17-10.4 6.5 6.5 0 0 0-.81 12.95L46.2 120l5.99-2.5-14.42-33.33c22.8-6.86 32.51-22.16 49.83-20.58 9.9.9 4.87 19.56 8.11 17.93 16.22-8.15 32.44-11.41 50.29-11.41-7.96-9.78-17.38-20.55-22.71-31.74L120.8 32c-2.32-7.33-2.56-14.75.87-22.22-9.74-3.26-21.1 0-32.45 4.9C82.2 9.77 79.5 0 68.13 0zM15.26 30.42c8.95 6.63 13.63 13.86 16.07 20.94l1.62 6.32c1.24 6.58 1.07 12.8 1.27 18.03z">
</path>
</svg>
</li>
<li class="applist-entry">
<div class="applist-text">
<p><strong>Tusky</strong> is a lightweight mobile client for Android.</p>
<a
href="https://tusky.app"
rel="nofollow noreferrer noopener"
target="_blank"
>
<a href="https://tusky.app" rel="nofollow noreferrer noopener" target="_blank">
Get Tusky
</a>
</div>
<img
class="applist-logo"
src="/assets/tusky.svg"
<img class="applist-logo" src="/assets/tusky.svg"
alt="The Tusky mascot, a cartoon elephant tooting happily"
title="The Tusky mascot, a cartoon elephant tooting happily"
width="100"
height="100"
/>
title="The Tusky mascot, a cartoon elephant tooting happily" width="100" height="100" />
</li>
<li class="applist-entry">
<div class="applist-text">
<p><strong>Feditext</strong> (beta) is a beautiful client for iOS, iPadOS and macOS.</p>
<a
href="https://github.com/feditext/feditext"
rel="nofollow noreferrer noopener"
target="_blank"
>
<a href="https://github.com/feditext/feditext" rel="nofollow noreferrer noopener" target="_blank">
Get Feditext
</a>
</div>
<img
class="applist-logo"
src="/assets/feditext.svg"
<img class="applist-logo" src="/assets/feditext.svg"
alt="The Feditext logo, the characters 'ft' at a slight angle"
title="The Feditext logo, the characters 'ft' at a slight angle"
width="100"
height="100"
/>
title="The Feditext logo, the characters 'ft' at a slight angle" width="100" height="100" />
</li>
<li class="applist-entry">
<div class="applist-text">
<p>Or try one of the <strong>Mastodon clients</strong> listed on the official Mastodon page.</p>
<a
href="https://joinmastodon.org/apps"
rel="nofollow noreferrer noopener"
target="_blank"
>
<a href="https://joinmastodon.org/apps" rel="nofollow noreferrer noopener" target="_blank">
Get Mastodon apps
</a>
</div>
<img
class="applist-logo"
src="/assets/mastodon.svg"
<img class="applist-logo" src="/assets/mastodon.svg"
alt="The Mastodon logo, the character 'M' in a speech bubble"
title="The Mastodon logo, the character 'M' in a speech bubble"
width="100"
height="100"
/>
title="The Mastodon logo, the character 'M' in a speech bubble" width="100" height="100" />
</li>
</ul>
</div>

View file

@ -20,19 +20,20 @@
{{- define "registrationLimits" -}}
New account registration is currently&nbsp;
{{- if .instance.Registrations -}}
<b>open</b>.
<b>open</b>.
{{- else -}}
<b>closed</b>.
<b>closed</b>.
{{- end -}}
{{- end -}}
{{- with . }}
<section class="about-section" role="region" aria-labelledby="signup">
<h3 id="signup">Register an Account on {{ .instance.Title -}}</h3>
<div class="about-section-contents">
<section role="region" aria-labelledby="signup">
<h2 id="signup">Register an Account on {{ .instance.Title -}}</h2>
<div>
<p>{{- template "registrationLimits" . -}}</p>
{{- if .instance.Registrations }}
<p>To register a new account, please first read the <a href="/about#rules">rules</a> and <a href="/about#terms">terms</a>.</p>
<p>To register a new account, please first read the <a href="/about#rules">rules</a> and <a
href="/about#terms">terms</a>.</p>
<p>Then, use the <a href="/signup">sign-up page</a> to register an account.</p>
<p>Manual admin approval is <b>required</b> for new accounts.</p>
{{- end }}

View file

@ -18,34 +18,24 @@
*/ -}}
{{- with . }}
<section role="region" class="about-section what-is-this" aria-labelledby="what-is-this">
<h3 id="what-is-this">What is this?</h3>
<div class="about-section-contents">
<section role="region" class="what-is-this" aria-labelledby="what-is-this">
<h2 id="what-is-this">What is this?</h2>
<div>
<p>
The web page you're reading right now is served by an instance of GoToSocial,
a federated, distributed, open-source microblogging software which connects
to other instances across a network known as the "fediverse".
</p>
<h4 id="what-is-an-instance">What is an "instance"?</h4>
<h3 id="what-is-an-instance">What is an "instance"?</h3>
<p>
"Instance" is a term commonly used for one node in the fediverse. Each instance
has its own web address, user(s), culture, rules, and settings. Instances exchange
data by "talking" to each other over the internet using a protocol called ActivityPub.
</p>
<a
class="activitypub-logo-wrapper"
href="https://activitypub.rocks/"
rel="nofollow noreferrer noopener"
target="_blank"
>
<img
class="activitypub-logo"
src="/assets/activitypub_light.svg"
alt="ActivityPub logo by mray, CC0 1.0"
title="ActivityPub logo by mray, CC0 1.0"
width="250"
height="65"
/>
<a class="activitypub-logo-wrapper" href="https://activitypub.rocks/" rel="nofollow noreferrer noopener"
target="_blank">
<img class="activitypub-logo" src="/assets/activitypub_light.svg" alt="ActivityPub logo by mray, CC0 1.0"
title="ActivityPub logo by mray, CC0 1.0" width="250" height="65" />
Learn more about ActivityPub (opens in a new tab).
</a>
<p>
@ -55,7 +45,7 @@
<p>
There are thousands of fediverse instances, connecting millions of people together.
</p>
<h4 id="how-do-i-join-the-fediverse">How do I join the fediverse?</h4>
<h3 id="how-do-i-join-the-fediverse">How do I join the fediverse?</h3>
<p>
You can join the fediverse by running your own instance of an ActivityPub software,
or by finding an existing instance that aligns with your values and expectations,
@ -65,8 +55,10 @@
To help you find an instance that suits you, you can try one of the following tools:
</p>
<ul>
<li><a href="https://fediverse.observer" rel="nofollow noreferrer noopener" target="_blank">Fediverse Observer (opens in a new tab)</a></li>
<li><a href="https://fedidb.org/network" rel="nofollow noreferrer noopener" target="_blank">FediDB (opens in a new tab)</a></li>
<li><a href="https://fediverse.observer" rel="nofollow noreferrer noopener" target="_blank">Fediverse
Observer (opens in a new tab)</a></li>
<li><a href="https://fedidb.org/network" rel="nofollow noreferrer noopener" target="_blank">FediDB (opens in
a new tab)</a></li>
</ul>
{{- if .instance.Registrations }}
<p>Or, just <a href="signup">register for an account on this instance</a>!</p>

View file

@ -22,7 +22,7 @@
If some if/else macro is used multiple times, declare it once here instead.
When invoking these nested templates, remember to pass in the values passed
to the executing template, ie., use '{{ template "example" . }}' not
'{{ template "example" }}', otherwise you'll end up with empty variables.
'{{ template "example" }}', otherwise you'll end up with empty variables.
*/ -}}
{{- define "thumbnailType" -}}
@ -43,43 +43,47 @@ image/webp
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="{{- if .robotsMeta -}}{{- .robotsMeta -}}{{- else -}}noindex, nofollow{{- end -}}">
{{- if .ogMeta }}
{{- include "page_ogmeta.tmpl" . | indent 2 }}
{{- else }}
{{- end }}
{{- if .rssFeed }}
<link rel="alternate" type="application/rss+xml" href="{{- .rssFeed -}}" title="{{- template "instanceTitle" . -}}">
{{- else }}
{{- end }}
{{- if .account }}
<link rel="alternate" type="application/activity+json" href="/users/{{- .account.Username -}}">
{{- else if .status }}
<link rel="alternate" type="application/activity+json" href="/users/{{- .status.Account.Username -}}/statuses/{{- .status.ID -}}">
{{- else }}
{{- end }}
<link rel="icon" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
<link rel="apple-touch-icon" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
<link rel="apple-touch-startup-image" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
{{- include "page_stylesheets.tmpl" . | indent 2 }}
{{- range .javascript }}
<script type="text/javascript" src="{{- . -}}" async="" defer=""></script>
{{- end }}
<title>{{- template "instanceTitle" . -}}</title>
</head>
<body class="page">
<header class="page-header">
{{- include "page_header.tmpl" . | indent 3 }}
</header>
<div class="page-content">
{{- include .pageContent . | indent 3 | outdentPre }}
</div>
<footer class="page-footer">
{{- include "page_footer.tmpl" . | indent 3 }}
</footer>
</body>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="{{- if .robotsMeta -}}{{- .robotsMeta -}}{{- else -}}noindex, nofollow{{- end -}}">
{{- if .ogMeta }}
{{- include "page_ogmeta.tmpl" . | indent 2 }}
{{- else }}
{{- end }}
{{- if .rssFeed }}
<link rel="alternate" type="application/rss+xml" href="{{- .rssFeed -}}" title="{{- template "instanceTitle" . -}}">
{{- else }}
{{- end }}
{{- if .account }}
<link rel="alternate" type="application/activity+json" href="/users/{{- .account.Username -}}">
{{- else if .status }}
<link rel="alternate" type="application/activity+json"
href="/users/{{- .status.Account.Username -}}/statuses/{{- .status.ID -}}">
{{- else }}
{{- end }}
<link rel="icon" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
<link rel="apple-touch-icon" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
<link rel="apple-touch-startup-image" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
{{- include "page_stylesheets.tmpl" . | indent 2 }}
{{- range .javascript }}
<script type="text/javascript" src="{{- . -}}" async="" defer=""></script>
{{- end }}
<title>{{- template "instanceTitle" . -}}</title>
</head>
<body class="page{{if .pageType}} {{.pageType}}{{end}}">
<header class="page-header{{if .largeHeader}} large{{end}}">
{{- include "page_header.tmpl" . | indent 3 }}
</header>
<div class="page-content">
{{- include .pageContent . | indent 3 | outdentPre }}
</div>
<footer class="page-footer">
{{- include "page_footer.tmpl" . | indent 3 }}
</footer>
</body>
</html>

View file

@ -21,43 +21,29 @@
<nav>
<ul class="nodot">
<li id="about">
<a
href="/about"
class="nounderline"
>
<a href="/about" class="nounderline">
About {{ .instance.Title }}
</a>
</li>
<li id="version">
<a
href="https://github.com/superseriousbusiness/gotosocial"
class="nounderline"
rel="nofollow noreferrer noopener"
target="_blank"
>
<a href="https://github.com/superseriousbusiness/gotosocial" class="nounderline"
rel="nofollow noreferrer noopener" target="_blank">
<span aria-hidden="true">🦥</span>
Source - GoToSocial {{ .instance.Version }}
<span aria-hidden="true">🦥</span>
</a>
</li>
{{- if .instance.ContactAccount }}
{{- if .instance.ContactAccount }}
<li id="contact">
<a
href="/@{{- .instance.ContactAccount.Username -}}"
class="nounderline"
>
<a href="/@{{- .instance.ContactAccount.Username -}}" class="nounderline">
Contact account - {{ .instance.ContactAccount.Username }}
</a>
</li>
{{- end }}
{{- if .instance.Email }}
{{- if .instance.Email }}
<li id="email">
<a
href="mailto:{{- .instance.Email -}}"
class="nounderline"
rel="nofollow noreferrer noopener"
target="_blank"
>
<a href="mailto:{{- .instance.Email -}}" class="nounderline" rel="nofollow noreferrer noopener"
target="_blank">
Email - {{ .instance.Email }}
</a>
</li>

View file

@ -27,31 +27,31 @@ Instance Logo
{{- define "strapUsers" -}}
{{- with deref .instance.Stats.user_count -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> user
{{- else -}}
<span class="count">{{- . -}}</span> users
{{- end -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> user
{{- else -}}
<span class="count">{{- . -}}</span> users
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "strapPosts" -}}
{{- with deref .instance.Stats.status_count -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> post
{{- else -}}
<span class="count">{{- . -}}</span> posts
{{- end -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> post
{{- else -}}
<span class="count">{{- . -}}</span> posts
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "strapInstances" -}}
{{- with deref .instance.Stats.domain_count -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> other instance
{{- else -}}
<span class="count">{{- . -}}</span> other instances
{{- end -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> other instance
{{- else -}}
<span class="count">{{- . -}}</span> other instances
{{- end -}}
{{- end -}}
{{- end -}}
@ -59,21 +59,16 @@ Instance Logo
<a aria-label="{{- .instance.Title -}}. Go to instance homepage" href="/" class="nounderline">
<picture>
{{- if .instance.ThumbnailStatic }}
<source
srcset="{{- .instance.ThumbnailStatic -}}"
type="{{- .instance.ThumbnailStaticType -}}"
media="(prefers-reduced-motion: reduce)"
/>
<source srcset="{{- .instance.ThumbnailStatic -}}" type="{{- .instance.ThumbnailStaticType -}}"
media="(prefers-reduced-motion: reduce)" />
{{- end }}
<img
src="{{- .instance.Thumbnail -}}"
alt="{{- template "thumbnailDescription" . -}}"
title="{{- template "thumbnailDescription" . -}}"
/>
<img src="{{- .instance.Thumbnail -}}" alt="{{- template "thumbnailDescription" . -}}"
title="{{- template "thumbnailDescription" . -}}" />
</picture>
<h1>{{- .instance.Title -}}</h1>
</a>
{{- if .showStrap }}
<aside>home to {{ template "strapUsers" . }} who wrote {{ template "strapPosts" . }}, federating with {{ template "strapInstances" . }}</aside>
<aside>home to {{ template "strapUsers" . }} who wrote {{ template "strapPosts" . }}, federating with
{{ template "strapInstances" . }}</aside>
{{- end }}
{{- end }}

View file

@ -27,70 +27,40 @@
<form action="/signup" method="POST">
<div class="labelinput">
<label for="email">Email</label>
<input
id="email"
type="email"
name="email"
required
placeholder="Email address"
>
<input id="email" type="email" name="email" required placeholder="Email address">
</div>
<div class="labelinput">
<label for="password">Password</label>
<input
id="password"
type="password"
name="password"
required
placeholder="Please enter your desired password"
autocomplete="new-password"
>
<input id="password" type="password" name="password" required
placeholder="Please enter your desired password" autocomplete="new-password">
</div>
<div class="labelinput">
<label for="username">
Username (lowercase a-z, numbers, and underscores; max 64 characters).<br/>
<small>Your username will be part of your fediverse handle, and cannot be changed later, so choose thoughtfully!</small>
Username (lowercase a-z, numbers, and underscores; max 64 characters).<br />
<small>Your username will be part of your fediverse handle, and cannot be changed later, so choose
thoughtfully!</small>
</label>
<input
id="username"
type="text"
name="username"
required
placeholder="Please enter your desired username"
pattern="^[a-z0-9_]{1,64}$"
autocapitalize="off"
spellcheck="false"
title="lowercase a-z, numbers, and underscores; max 64 characters"
>
<input id="username" type="text" name="username" required
placeholder="Please enter your desired username" pattern="^[a-z0-9_]{1,64}$" autocapitalize="off"
spellcheck="false" title="lowercase a-z, numbers, and underscores; max 64 characters">
</div>
{{- if .reasonRequired }}
<div class="labelinput">
<label for="reason">
Reason you want to join {{ .instance.Title }} (40-500 characters).<br/>
Reason you want to join {{ .instance.Title }} (40-500 characters).<br />
<small>The admin(s) will use this text to decide whether or not to approve your sign-up.</small>
</label>
<textarea
id="reason"
name="reason"
required
<textarea id="reason" name="reason" required
placeholder="Enter a few sentences about why you want to join this instance. If you know someone on the instance already, you may want to mention them here. You might want to link to any other accounts you have elsewhere too."
rows="8"
minlength="40"
maxlength="500"
autocapitalize="sentences"
title="40-500 characters"
></textarea>
rows="8" minlength="40" maxlength="500" autocapitalize="sentences"
title="40-500 characters"></textarea>
</div>
{{- end }}
<div class="checkbox">
<label for="agreement">I have read and accept the <a href="/about#terms">terms and conditions</a> of {{ .instance.Title }}, and I agree to abide by the <a href="/about#rules">instance rules</a>.</label>
<input
id="agreement"
type="checkbox"
name="agreement"
required
value="true"
>
<label for="agreement">I have read and accept the <a href="/about#terms">terms and conditions</a> of
{{ .instance.Title }}, and I agree to abide by the <a href="/about#rules">instance
rules</a>.</label>
<input id="agreement" type="checkbox" name="agreement" required value="true">
</div>
<input type="hidden" name="locale" value="en">
<button type="submit" class="btn btn-success">Submit</button>

View file

@ -22,7 +22,7 @@
<section aria-labelledby="signed-up">
<h2 id="signed-up">Thanks for signing up to {{ .instance.Title -}}!</h2>
<p>Hi <b>{{- .username -}}</b>!</p>
<p>Your sign-up has been registered, and a confirmation email has been sent to <b>{{- .email -}}</b>.<p>
<p>Your sign-up has been registered, and a confirmation email has been sent to <b>{{- .email -}}</b>.</p>
<p>Please check your email inbox and click the link to confirm your email.</p>
<p>Once an admin has approved your sign-up, you will be able to log in and use your account.</p>
</section>

View file

@ -38,7 +38,8 @@
{{- if .SpoilerText }}
<details class="text-spoiler">
<summary>
<span class="spoiler-text" lang="{{- .LanguageTag.TagStr -}}">{{- emojify .Emojis (escape .SpoilerText) -}}</span>
<span class="spoiler-text"
lang="{{- .LanguageTag.TagStr -}}">{{- emojify .Emojis (escape .SpoilerText) -}}</span>
<span class="button" role="button" tabindex="0">Toggle visibility</span>
</summary>
<div class="text">
@ -64,26 +65,16 @@
{{- include "status_attachments.tmpl" . | indent 1 }}
{{- end }}
</div>
<aside class="status-info" aria-hidden="true">
<aside class="status-info">
{{- include "status_info.tmpl" . | indent 1 }}
</aside>
{{- if .Local }}
<a
href="{{- .URL -}}"
class="status-link"
data-nosnippet
title="Open thread at this post"
>
<a href="{{- .URL -}}" class="status-link" data-nosnippet title="Open thread at this post">
Open thread at this post
</a>
{{- else }}
<a
href="{{- .URL -}}"
class="status-link"
data-nosnippet
rel="nofollow noreferrer noopener" target="_blank"
title="Open remote post (opens in a new window)"
>
<a href="{{- .URL -}}" class="status-link" data-nosnippet rel="nofollow noreferrer noopener" target="_blank"
title="Open remote post (opens in a new window)">
Open remote post (opens in a new window)
</a>
{{- end }}

View file

@ -23,54 +23,23 @@
*/ -}}
{{- define "imagePreview" }}
<img
src="{{- .PreviewURL -}}"
loading="lazy"
{{- if .Description }}
alt="{{- .Description -}}"
title="{{- .Description -}}"
{{- end }}
width="{{- .Meta.Original.Width -}}"
height="{{- .Meta.Original.Height -}}"
/>
<img src="{{- .PreviewURL -}}" loading="lazy" {{- if .Description }} alt="{{- .Description -}}"
title="{{- .Description -}}" {{- end }} width="{{- .Meta.Original.Width -}}"
height="{{- .Meta.Original.Height -}}" />
{{- end }}
{{- define "videoPreview" }}
<img
src="{{- .PreviewURL -}}"
loading="lazy"
{{- if .Description }}
alt="{{- .Description -}}"
title="{{- .Description -}}"
{{- end }}
width="{{- .Meta.Small.Width -}}"
height="{{- .Meta.Small.Height -}}"
/>
<img src="{{- .PreviewURL -}}" loading="lazy" {{- if .Description }} alt="{{- .Description -}}"
title="{{- .Description -}}" {{- end }} width="{{- .Meta.Small.Width -}}" height="{{- .Meta.Small.Height -}}" />
{{- end }}
{{- define "audioPreview" }}
{{- if and .PreviewURL .Meta.Small.Width }}
<img
src="{{- .PreviewURL -}}"
loading="lazy"
{{- if .Description }}
alt="{{- .Description -}}"
title="{{- .Description -}}"
{{- end }}
width="{{- .Meta.Small.Width -}}"
height="{{- .Meta.Small.Height -}}"
/>
<img src="{{- .PreviewURL -}}" loading="lazy" {{- if .Description }} alt="{{- .Description -}}"
title="{{- .Description -}}" {{- end }} width="{{- .Meta.Small.Width -}}" height="{{- .Meta.Small.Height -}}" />
{{- else }}
<img
src="/assets/logo.webp"
loading="lazy"
{{- if .Description }}
alt="{{- .Description -}}"
title="{{- .Description -}}"
{{- end }}
width="518"
height="460"
/>
<img src="/assets/logo.webp" loading="lazy" {{- if .Description }} alt="{{- .Description -}}"
title="{{- .Description -}}" {{- end }} width="518" height="460" />
{{- end }}
{{- end }}
@ -85,11 +54,7 @@ media photoswipe-gallery {{ (len .) | oddOrEven }} {{ if eq (len .) 1 }}single{{
{{- end -}}
{{- with .MediaAttachments }}
<div
class="{{- template "galleryClass" . -}}"
role="group"
aria-label="{{- template "attachmentsLength" . -}}"
>
<div class="{{- template "galleryClass" . -}}" role="group" aria-label="{{- template "attachmentsLength" . -}}">
{{- range $index, $media := . }}
<div class="media-wrapper">
<details class="{{- $media.Type -}}-spoiler media-spoiler" {{- if not $media.Sensitive }} open{{- end -}}>
@ -139,48 +104,25 @@ media photoswipe-gallery {{ (len .) | oddOrEven }} {{ if eq (len .) 1 }}single{{
{{- if and $media.PreviewURL $media.Meta.Small.Width }}
poster="{{- .PreviewURL -}}"
data-pswp-width="{{- $media.Meta.Small.Width -}}px"
data-pswp-height="{{- $media.Meta.Small.Height -}}px"
{{- else }}
poster="/assets/logo.webp"
width="518px"
height="460px"
{{- end }}
{{- if .Description }}
alt="{{- $media.Description -}}"
title="{{- $media.Description -}}"
{{- end }}
>
<source type="{{- $media.MIMEType -}}" src="{{- $media.URL -}}"/>
data-pswp-height="{{- $media.Meta.Small.Height -}}px" {{- else }} poster="/assets/logo.webp"
width="518px" height="460px" {{- end }} {{- if .Description }} alt="{{- $media.Description -}}"
title="{{- $media.Description -}}" {{- end }}>
<source type="{{- $media.MIMEType -}}" src="{{- $media.URL -}}" />
</video>
{{- else if eq .Type "image" }}
<a
class="photoswipe-slide"
href="{{- $media.URL -}}"
target="_blank"
<a class="photoswipe-slide" href="{{- $media.URL -}}" target="_blank"
data-pswp-width="{{- $media.Meta.Original.Width -}}px"
data-pswp-height="{{- $media.Meta.Original.Height -}}px"
data-cropped="true"
{{- if .Description }}
alt="{{- $media.Description -}}"
title="{{- $media.Description -}}"
{{- end }}
>
data-pswp-height="{{- $media.Meta.Original.Height -}}px" data-cropped="true" {{- if .Description }}
alt="{{- $media.Description -}}" title="{{- $media.Description -}}" {{- end }}>
{{- with $media }}
{{- include "imagePreview" . | indent 4 }}
{{- end }}
</a>
{{- else }}
<a
class="unknown-attachment"
href="{{- $media.RemoteURL -}}"
rel="nofollow noreferrer noopener"
target="_blank"
{{- if .Description }}
title="Open external media: {{ $media.Description -}}&#10;&#13;{{- $media.RemoteURL -}}"
{{- else }}
title="Open external media.&#10;&#13;{{- $media.RemoteURL -}}"
{{- end }}
>
<a class="unknown-attachment" href="{{- $media.RemoteURL -}}" rel="nofollow noreferrer noopener"
target="_blank" {{- if .Description }}
title="Open external media: {{ $media.Description -}}&#10;&#13;{{- $media.RemoteURL -}}" {{- else }}
title="Open external media.&#10;&#13;{{- $media.RemoteURL -}}" {{- end }}>
<div class="placeholder" aria-hidden="true">
<i class="placeholder-external-link fa fa-external-link"></i>
<i class="placeholder-icon fa fa-file-text"></i>

View file

@ -20,31 +20,31 @@
{{- define "ariaLabel" -}}
@{{ .Account.Acct -}}, {{ timestamp .CreatedAt -}}
{{- if .LanguageTag -}}
, language {{ .LanguageTag.DisplayStr -}}
, language {{ .LanguageTag.DisplayStr -}}
{{- end -}}
{{- if .MediaAttachments -}}
, has media
, has media
{{- end -}}
{{- if .RepliesCount -}}
{{- if eq .RepliesCount 1 -}}
, 1 reply
{{- else -}}
, {{ .RepliesCount }} replies
{{- end -}}
{{- if eq .RepliesCount 1 -}}
, 1 reply
{{- else -}}
, {{ .RepliesCount }} replies
{{- end -}}
{{- end -}}
{{- if .FavouritesCount -}}
{{- if eq .FavouritesCount 1 -}}
, 1 favourite
{{- else -}}
, {{ .FavouritesCount }} favourites
{{- end -}}
{{- if eq .FavouritesCount 1 -}}
, 1 favourite
{{- else -}}
, {{ .FavouritesCount }} favourites
{{- end -}}
{{- end -}}
{{- if .ReblogsCount -}}
{{- if eq .ReblogsCount 1 -}}
, 1 boost
{{- else -}}
, {{ .ReblogsCount }} boosts
{{- end -}}
{{- if eq .ReblogsCount 1 -}}
, 1 boost
{{- else -}}
, {{ .ReblogsCount }} boosts
{{- end -}}
{{- end -}}
{{- end -}}

View file

@ -20,47 +20,30 @@
{{- with .Account }}
<address>
{{- if $.Local }}
<a
href="{{- .URL -}}"
rel="author"
title="Open profile"
>
{{- else }}
<a
href="{{- .URL -}}"
rel="author nofollow noreferrer noopener" target="_blank"
title="Open remote profile (opens in a new window)"
>
{{- end }}
<picture
class="avatar"
aria-hidden="true"
>
{{- if .AvatarAttachment }}
<source
srcset="{{- .AvatarStatic -}}"
type="{{- .AvatarAttachment.PreviewMIMEType -}}"
media="(prefers-reduced-motion: reduce)"
/>
<a href="{{- .URL -}}" rel="author" title="Open profile">
{{- else }}
<a href="{{- .URL -}}" rel="author nofollow noreferrer noopener" target="_blank"
title="Open remote profile (opens in a new window)">
{{- end }}
<img
src="{{- .Avatar -}}"
alt="Avatar for {{ .Username -}}"
title="Avatar for {{ .Username -}}"
>
</picture>
<div class="author-strap">
<span class="displayname text-cutoff">
{{- if .DisplayName -}}
{{- emojify .Emojis (escape .DisplayName) -}}
{{- else -}}
{{- .Username -}}
{{- end -}}
</span>
<span class="sr-only">,</span>
<span class="username text-cutoff">@{{- .Acct -}}</span>
</div>
<span class="sr-only">(open profile)</span>
</a>
<picture class="avatar" aria-hidden="true">
{{- if .AvatarAttachment }}
<source srcset="{{- .AvatarStatic -}}" type="{{- .AvatarAttachment.PreviewMIMEType -}}"
media="(prefers-reduced-motion: reduce)" />
{{- end }}
<img src="{{- .Avatar -}}" alt="Avatar for {{ .Username -}}" title="Avatar for {{ .Username -}}">
</picture>
<div class="author-strapline">
<span class="displayname text-cutoff">
{{- if .DisplayName -}}
{{- emojify .Emojis (escape .DisplayName) -}}
{{- else -}}
{{- .Username -}}
{{- end -}}
</span>
<span class="sr-only">,</span>
<span class="username text-cutoff">@{{- .Acct -}}</span>
</div>
<span class="sr-only">(open profile)</span>
</a>
</address>
{{- end }}

View file

@ -23,11 +23,11 @@
*/ -}}
{{- define "votes" -}}
{{- if eq . 1 -}}
{{- . -}}&nbsp;vote
{{- else -}}
{{- . }}&nbsp;votes
{{- end -}}
{{- if eq . 1 -}}
{{- . -}}&nbsp;vote
{{- else -}}
{{- . }}&nbsp;votes
{{- end -}}
{{- end -}}
{{- with . }}
@ -51,14 +51,14 @@
<span class="total-votes">
{{- template "votes" .Poll.VotesCount -}}&nbsp;
{{- if .Poll.Expired -}}
total
total
{{- else -}}
so far
so far
{{- end -}}
</span>
</figcaption>
<ul class="poll-options nodot">
{{- range $index, $pollOption := .PollOptions }}
{{- range $index, $pollOption := .PollOptions }}
<li class="poll-option">
<span class="sr-only">Option {{ increment $index }},</span>
<span lang="{{- .LanguageTag.TagStr -}}">{{ emojify .Emojis (noescape $pollOption.Title) }}</span>
@ -75,7 +75,7 @@
{{- end }}
</div>
</li>
{{- end }}
{{- end }}
</ul>
</figure>
{{- end }}

View file

@ -19,7 +19,7 @@
{{- with . }}
<main>
<h2 id="tag-name" tabindex="-1">#{{- .tagName -}}</h2>
<h2 class="wrap-text" tabindex="-1">#{{- .tagName -}}</h2>
<p>There's nothing here!</p>
<p>
For privacy reasons, GoToSocial doesn't (yet) implement public web views of tag timelines.

View file

@ -18,81 +18,82 @@
*/ -}}
{{- define "repliesSummary" -}}
{{- if .context.ThreadRepliesShown -}}
{{- if .context.ThreadRepliesHidden -}}
{{- if eq .context.ThreadRepliesShown 1 -}}
{{- /* Some replies are hidden. */ -}}
{{ .context.ThreadRepliesShown }} visible reply
{{- else if gt .context.ThreadRepliesShown 1 -}}
{{ .context.ThreadRepliesShown }} visible replies
{{- end -}}
; {{ .context.ThreadRepliesHidden }} more {{ if eq .context.ThreadRepliesHidden 1 }}reply{{ else }}replies{{ end }} hidden or not public
{{- else -}}
{{- /* No hidden replies. */ -}}
{{- if eq .context.ThreadReplies 1 -}}
{{ .context.ThreadReplies }} reply
{{- else if gt .context.ThreadReplies 1 -}}
{{ .context.ThreadReplies }} replies
{{- end -}}
{{- end -}}
{{- else -}}
{{- .context.ThreadRepliesHidden }} {{ if eq .context.ThreadRepliesHidden 1 }}reply{{ else }}replies{{ end }} hidden or not public
{{- end -}}
{{- if .context.ThreadRepliesShown -}}
{{- if .context.ThreadRepliesHidden -}}
{{- if eq .context.ThreadRepliesShown 1 -}}
{{- /* Some replies are hidden. */ -}}
{{ .context.ThreadRepliesShown }} visible reply
{{- else if gt .context.ThreadRepliesShown 1 -}}
{{ .context.ThreadRepliesShown }} visible replies
{{- end -}}
; {{ .context.ThreadRepliesHidden }} more {{ if eq .context.ThreadRepliesHidden 1 }}reply{{ else }}replies{{ end }}
hidden or not public
{{- else -}}
{{- /* No hidden replies. */ -}}
{{- if eq .context.ThreadReplies 1 -}}
{{ .context.ThreadReplies }} reply
{{- else if gt .context.ThreadReplies 1 -}}
{{ .context.ThreadReplies }} replies
{{- end -}}
{{- end -}}
{{- else -}}
{{- .context.ThreadRepliesHidden }} {{ if eq .context.ThreadRepliesHidden 1 }}reply{{ else }}replies{{ end }} hidden or
not public
{{- end -}}
{{- end -}}
{{- define "threadSummary" -}}
{{- if .context.ThreadHidden -}}
{{- if eq .context.ThreadShown 1 -}}
Single visible post
{{- else if gt .context.ThreadShown 1 -}}
Thread of {{ .context.ThreadShown }} visible posts
{{- end -}}
; {{ .context.ThreadHidden }} more {{ if eq .context.ThreadHidden 1 }}post{{ else }}posts{{ end }} hidden or not public
{{- else -}}
{{- /* No hidden posts */ -}}
{{- if eq .context.ThreadLength 1 -}}
Single post
{{- else if gt .context.ThreadLength 1 -}}
Thread of {{ .context.ThreadLength }} posts
{{- end -}}
{{- end -}}
{{- if .context.ThreadHidden -}}
{{- if eq .context.ThreadShown 1 -}}
Single visible post
{{- else if gt .context.ThreadShown 1 -}}
Thread of {{ .context.ThreadShown }} visible posts
{{- end -}}
; {{ .context.ThreadHidden }} more {{ if eq .context.ThreadHidden 1 }}post{{ else }}posts{{ end }} hidden or not public
{{- else -}}
{{- /* No hidden posts */ -}}
{{- if eq .context.ThreadLength 1 -}}
Single post
{{- else if gt .context.ThreadLength 1 -}}
Thread of {{ .context.ThreadLength }} posts
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "repliesStart" -}}
{{- with . }}
</section>
<section class="thread thread-replies" aria-labelledby="replies" open>
<div class="col-header replies{{- if not .context.ThreadRepliesShown }} hidden-only{{- end -}}">
<div class="col-header wrap replies{{- if not .context.ThreadRepliesShown }} hidden-only{{- end -}}">
<h2 id="replies">{{- template "repliesSummary" . -}}</h2>
<a href="#thread-summary">back to top</a>
</div>
{{- end }}
{{- end -}}
{{- with . }}
<main class="thread-wrapper" data-nosnippet>
<section class="thread thread-main" aria-labelledby="thread-summary">
<div class="col-header">
<h2 id="thread-summary">{{- template "threadSummary" . -}}</h2>
{{- if .context.ThreadRepliesShown }}
<a href="#replies">jump to replies</a>
{{- end }}
</div>
{{- range $status := .context.Statuses }}
<article
class="status{{- if $status.ThreadContextStatus }} expanded{{- end -}}{{- if $status.Indent }} indent-{{ $status.Indent }}{{- end -}}"
{{- includeAttr "status_attributes.tmpl" $status | indentAttr 3 }}
>
{{- include "status.tmpl" $status | indent 3 }}
</article>
{{- if and $status.ThreadLastMain $.context.ThreadReplies }}
{{- include "repliesStart" $ | indent 1 }}
{{- end }}
{{- end }}
{{- if .context.ThreadReplies }}
</section>
{{- end }}
</main>
{{- end }}
{{- end -}}
{{- with . }}
<main class="thread-wrapper" data-nosnippet>
<section class="thread thread-main" aria-labelledby="thread-summary">
<div class="col-header wrap">
<h2 id="thread-summary">{{- template "threadSummary" . -}}</h2>
{{- if .context.ThreadRepliesShown }}
<a href="#replies">jump to replies</a>
{{- end }}
</div>
{{- range $status := .context.Statuses }}
<article
class="status{{- if $status.ThreadContextStatus }} expanded{{- end -}}{{- if $status.Indent }} indent-{{ $status.Indent }}{{- end -}}"
{{- includeAttr "status_attributes.tmpl" $status | indentAttr 3 }}>
{{- include "status.tmpl" $status | indent 3 }}
</article>
{{- if and $status.ThreadLastMain $.context.ThreadReplies }}
{{- include "repliesStart" $ | indent 1 }}
{{- end }}
{{- end }}
{{- if .context.ThreadReplies }}
</section>
{{- end }}
</main>
{{- end }}