From fe31d4197b66cced9ca84779fac4fe69242d844b Mon Sep 17 00:00:00 2001 From: r Date: Tue, 18 Feb 2020 22:15:37 +0000 Subject: Add frame based navigation --- templates/about.tmpl | 3 +-- templates/emoji.tmpl | 3 +-- templates/error.tmpl | 4 ++-- templates/header.tmpl | 5 ++++- templates/likedby.tmpl | 3 +-- templates/nav.tmpl | 34 ++++++++++++++++++++++++++++++++++ templates/navigation.tmpl | 30 ------------------------------ templates/notification.tmpl | 23 +++++++++++++++++------ templates/postform.tmpl | 2 +- templates/retweetedby.tmpl | 3 +-- templates/root.tmpl | 17 +++++++++++++++++ templates/search.tmpl | 3 +-- templates/settings.tmpl | 11 +++++++---- templates/signin.tmpl | 2 +- templates/status.tmpl | 38 +++++++++++++++++++------------------- templates/thread.tmpl | 3 +-- templates/timeline.tmpl | 5 +---- templates/user.tmpl | 3 +-- templates/usersearch.tmpl | 3 +-- 19 files changed, 111 insertions(+), 84 deletions(-) create mode 100644 templates/nav.tmpl delete mode 100644 templates/navigation.tmpl create mode 100644 templates/root.tmpl (limited to 'templates') diff --git a/templates/about.tmpl b/templates/about.tmpl index b3c9a49..d4761de 100644 --- a/templates/about.tmpl +++ b/templates/about.tmpl @@ -1,6 +1,5 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
About
diff --git a/templates/emoji.tmpl b/templates/emoji.tmpl index 2066afa..3e9f0f0 100644 --- a/templates/emoji.tmpl +++ b/templates/emoji.tmpl @@ -1,6 +1,5 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
Emojis
diff --git a/templates/error.tmpl b/templates/error.tmpl index 0d6115a..fc925ca 100644 --- a/templates/error.tmpl +++ b/templates/error.tmpl @@ -1,11 +1,11 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
Error
{{.Error}}
Home - Sign In + Sign In
{{template "footer.tmpl"}} diff --git a/templates/header.tmpl b/templates/header.tmpl index 2889ead..76831f2 100644 --- a/templates/header.tmpl +++ b/templates/header.tmpl @@ -7,7 +7,10 @@ {{if .CSRFToken}} {{end}} - {{if gt .NotificationCount 0}}({{.NotificationCount}}) {{end}}{{.Title}} + {{if .AutoRefresh}} + + {{end}} + {{.Title}} {{if .CustomCSS}} diff --git a/templates/likedby.tmpl b/templates/likedby.tmpl index 00857c1..222254c 100644 --- a/templates/likedby.tmpl +++ b/templates/likedby.tmpl @@ -1,6 +1,5 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
Liked By
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} diff --git a/templates/nav.tmpl b/templates/nav.tmpl new file mode 100644 index 0000000..620643e --- /dev/null +++ b/templates/nav.tmpl @@ -0,0 +1,34 @@ +{{with .Data}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}} + + +{{template "postform.tmpl" (WithContext .PostContext $.Ctx)}} + +{{template "footer.tmpl"}} +{{end}} diff --git a/templates/navigation.tmpl b/templates/navigation.tmpl deleted file mode 100644 index a85f9fd..0000000 --- a/templates/navigation.tmpl +++ /dev/null @@ -1,30 +0,0 @@ -{{with .Data}} - -{{end}} diff --git a/templates/notification.tmpl b/templates/notification.tmpl index 51cc6e3..9e1854c 100644 --- a/templates/notification.tmpl +++ b/templates/notification.tmpl @@ -1,14 +1,25 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} -
Notifications
+{{template "header.tmpl" (WithContext .CommonData $.Ctx)}} +
+
+ Notifications + {{if gt .UnreadCount 0}}({{.UnreadCount }}){{end}} +
+ refresh + {{if .ReadID}} +
+ + +
+ {{end}} +
{{range .Notifications}}
{{if eq .Type "follow"}}
@@ -31,7 +42,7 @@ {{else if eq .Type "reblog"}}
- + avatar {{EmojiFilter .Account.DisplayName .Account.Emojis}} @@ -44,7 +55,7 @@ {{else if eq .Type "favourite"}}
- + avatar {{EmojiFilter .Account.DisplayName .Account.Emojis}} diff --git a/templates/postform.tmpl b/templates/postform.tmpl index 51ac5e6..d5c1fb9 100644 --- a/templates/postform.tmpl +++ b/templates/postform.tmpl @@ -11,7 +11,7 @@ emoji list
- +
{{if gt (len .Formats) 0}} diff --git a/templates/retweetedby.tmpl b/templates/retweetedby.tmpl index ce0d337..9492ee6 100644 --- a/templates/retweetedby.tmpl +++ b/templates/retweetedby.tmpl @@ -1,6 +1,5 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
Retweeted By
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} diff --git a/templates/root.tmpl b/templates/root.tmpl new file mode 100644 index 0000000..cd33139 --- /dev/null +++ b/templates/root.tmpl @@ -0,0 +1,17 @@ +{{with .Data}} + + + + + + {{.Title}} + + + + + + + + + +{{end}} diff --git a/templates/search.tmpl b/templates/search.tmpl index 96548b5..ede147e 100644 --- a/templates/search.tmpl +++ b/templates/search.tmpl @@ -1,6 +1,5 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
Search
diff --git a/templates/settings.tmpl b/templates/settings.tmpl index e7d49e9..d8ede87 100644 --- a/templates/settings.tmpl +++ b/templates/settings.tmpl @@ -1,6 +1,5 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
Settings
@@ -24,11 +23,15 @@
- + +
+
+ +
- +
diff --git a/templates/signin.tmpl b/templates/signin.tmpl index a199948..069572b 100644 --- a/templates/signin.tmpl +++ b/templates/signin.tmpl @@ -1,5 +1,5 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
Signin
diff --git a/templates/status.tmpl b/templates/status.tmpl index 95dee20..c4f2e5f 100644 --- a/templates/status.tmpl +++ b/templates/status.tmpl @@ -2,7 +2,7 @@
{{if .Reblog}}
- + avatar {{EmojiFilter .Account.DisplayName .Account.Emojis}} @@ -14,39 +14,39 @@ {{with $s := .Data}}
{{EmojiFilter .Account.DisplayName .Account.Emojis}} - + {{.Account.Acct}} -
+
- + source {{if .Muted}} - + {{else}}
- +
{{end}} {{if eq $.Ctx.UserID .Account.ID}}
- +
{{end}}
@@ -55,7 +55,7 @@
{{if .InReplyToID}} @@ -139,16 +139,16 @@ {{end}}
{{if or (eq .Visibility "private") (eq .Visibility "direct")}} - + retweet {{else}} @@ -156,17 +156,17 @@
- +
{{else}}
- +
{{end}} {{end}} - + {{if .ReblogsCount}} ({{DisplayInteractionCount .ReblogsCount}}) {{end}}
@@ -175,22 +175,22 @@
- +
{{else}}
- +
{{end}} - + {{if .FavouritesCount}} ({{DisplayInteractionCount .FavouritesCount}}) {{end}}
+ target="{{if $.Ctx.ThreadInNewTab}}_blank{{else}}main{{end}}"> diff --git a/templates/thread.tmpl b/templates/thread.tmpl index 2927ee4..8cf9ead 100644 --- a/templates/thread.tmpl +++ b/templates/thread.tmpl @@ -1,6 +1,5 @@ {{with $s := .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
Thread
{{range .Statuses}} diff --git a/templates/timeline.tmpl b/templates/timeline.tmpl index 0321c7f..82b624d 100644 --- a/templates/timeline.tmpl +++ b/templates/timeline.tmpl @@ -1,10 +1,7 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
{{.Title}}
-{{template "postform.tmpl" (WithContext .PostContext $.Ctx)}} - {{range .Statuses}} {{template "status.tmpl" (WithContext . $.Ctx)}} {{end}} diff --git a/templates/user.tmpl b/templates/user.tmpl index de2b5c4..6ea79f7 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -1,6 +1,5 @@ {{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
User