From 026674bc2c4eb5f53bcb38e7efce2fe2dfebe974 Mon Sep 17 00:00:00 2001 From: f0x52 Date: Mon, 13 Sep 2021 14:45:33 +0200 Subject: Thread views on the web (#207) * Webviews for status threads * fix up templates * add ForkAwesome and gotosocial-styling into repo * clean up gotosocial-styling, old styling * update CONTRIBUTING with new css building, and nodemon recommendation * update Dockerfile with new css bundling * those weren't supposed to make it in * upgrade gotosocial-styling deps * update authorize template with main wrapper * update css pipeline * abstract status from thread to avoid copy-pasting * basic CW implementation * fix PR review suggestions * fix no-image-desc icon alignment * remove template loading println * remove println * remove changes to testmodels * reset changes to testmodels --- web/template/404.tmpl | 14 ++++------ web/template/authorize.tmpl | 28 ++++++++++--------- web/template/header.tmpl | 23 +++++++++------ web/template/index.tmpl | 68 ++++++++++++++++++++++----------------------- web/template/sign-in.tmpl | 24 ++++++++-------- web/template/status.tmpl | 36 ++++++++++++++++++++++++ web/template/thread.tmpl | 34 +++++++++++++++++++++++ 7 files changed, 153 insertions(+), 74 deletions(-) create mode 100644 web/template/status.tmpl create mode 100644 web/template/thread.tmpl (limited to 'web/template') diff --git a/web/template/404.tmpl b/web/template/404.tmpl index 633ed65cf..096f7f364 100644 --- a/web/template/404.tmpl +++ b/web/template/404.tmpl @@ -1,11 +1,9 @@ {{ template "header.tmpl" .}} - - -
-

404: Page Not Found

- If you believe this was an error, you can contact an admin -
+
+
+

404: Page Not Found

+ If you believe this was an error, you can contact an admin +
+
{{ template "footer.tmpl" .}} \ No newline at end of file diff --git a/web/template/authorize.tmpl b/web/template/authorize.tmpl index bc609ed66..b6eef9561 100644 --- a/web/template/authorize.tmpl +++ b/web/template/authorize.tmpl @@ -1,15 +1,17 @@ {{ template "header.tmpl" .}} -
-

Hi {{.user}}!

-

Application {{.appname}} {{if len .appwebsite | eq 0 | not}}({{.appwebsite}}) {{end}}would like to perform actions on your behalf, with scope {{.scope}}.

-

The application will redirect to {{.redirect}} to continue.

-

- -

-
+
+
+

Hi {{.user}}!

+

Application {{.appname}} {{if len .appwebsite | eq 0 | not}}({{.appwebsite}}) {{end}}would like to perform actions on your behalf, with scope {{.scope}}.

+

The application will redirect to {{.redirect}} to continue.

+

+ +

+
+
{{ template "footer.tmpl" .}} \ No newline at end of file diff --git a/web/template/header.tmpl b/web/template/header.tmpl index 45d375ab8..0f224cf95 100644 --- a/web/template/header.tmpl +++ b/web/template/header.tmpl @@ -1,19 +1,26 @@ - + + - - - - + + + + {{range .stylesheets}} + {{end}} + {{.instance.Title}} - GoToSocial
-

- {{.instance.Title}} -

+ Instance Logo +
+

+ {{.instance.Title}} +

+
+
\ No newline at end of file diff --git a/web/template/index.tmpl b/web/template/index.tmpl index 6751c9bd2..52581d3aa 100644 --- a/web/template/index.tmpl +++ b/web/template/index.tmpl @@ -1,40 +1,40 @@ {{ template "header.tmpl" .}} - -
-

Home to {{.instance.Stats.user_count}} users - who posted {{.instance.Stats.status_count}} statuses, - federating with {{.instance.Stats.domain_count}} other instances.

-
- {{.instance.ShortDescription |noescape}} -
-
+
-
-

- GoToSocial does not provide its own frontend, but implements the Mastodon client API. - You can use this server through a variety of clients: -

-
-
- -
-

Pinafore

-

Pinafore is a web client designed for speed and simplicity.

- Use Pinafore -
+
+

Home to {{.instance.Stats.user_count}} users + who posted {{.instance.Stats.status_count}} statuses, + federating with {{.instance.Stats.domain_count}} other instances.

+
+ {{.instance.ShortDescription |noescape}}
-
- -
-

Tusky

-

Tusky is a lightweight mobile client for Android

- Get Tusky +
+ +
+

+ GoToSocial does not provide its own frontend, but implements the Mastodon client API. + You can use this server through a variety of clients: +

+
+
+ +
+

Pinafore

+

Pinafore is a web client designed for speed and simplicity.

+ Use Pinafore +
+
+
+ +
+

Tusky

+

Tusky is a lightweight mobile client for Android

+ Get Tusky +
-
-
+ +
{{ template "footer.tmpl" .}} \ No newline at end of file diff --git a/web/template/sign-in.tmpl b/web/template/sign-in.tmpl index cfe932b3a..48a833cee 100644 --- a/web/template/sign-in.tmpl +++ b/web/template/sign-in.tmpl @@ -1,13 +1,15 @@ {{ template "header.tmpl" .}} -
-

Login

-
- - - - - - -
-
+
+ +
{{ template "footer.tmpl" .}} diff --git a/web/template/status.tmpl b/web/template/status.tmpl new file mode 100644 index 000000000..343eb2d0a --- /dev/null +++ b/web/template/status.tmpl @@ -0,0 +1,36 @@ + +{{if .Account.DisplayName}}{{.Account.DisplayName}}{{else}}{{.Account.Username}}{{end}} +@{{.Account.Username}} +
+ {{if .SpoilerText}} + +
+ {{.SpoilerText}} +
+ {{end}} +
+ {{.Content |noescape}} +
+
+{{with .MediaAttachments}} +
+ {{range .}} + + {{if not .Description}} + + {{end}} + {{.Description}} + + {{end}} +
+{{end}} +
+
{{.CreatedAt | timestamp}}
+
+
{{.Visibility | visibilityIcon}}
+
{{.RepliesCount}}
+
{{.ReblogsCount}}
+
{{.FavouritesCount}}
+
+
+View toot \ No newline at end of file diff --git a/web/template/thread.tmpl b/web/template/thread.tmpl new file mode 100644 index 000000000..b6b91fd31 --- /dev/null +++ b/web/template/thread.tmpl @@ -0,0 +1,34 @@ +{{ template "header.tmpl" .}} +
+
+ {{range .context.Ancestors}} +
+ {{ template "status.tmpl" .}} +
+ {{end}} +
+ {{ template "status.tmpl" .status}} +
+ {{range .context.Descendants}} +
+ {{ template "status.tmpl" .}} +
+ {{end}} +
+
+ +{{ template "footer.tmpl" .}} \ No newline at end of file -- cgit v1.2.3