From c390a0c32720f6afe852bc7a3a3f64c3afe9e401 Mon Sep 17 00:00:00 2001 From: r Date: Fri, 11 Feb 2022 11:18:02 +0000 Subject: Add lists --- templates/about.tmpl | 4 +-- templates/list.tmpl | 63 +++++++++++++++++++++++++++++++++++++++++++++ templates/lists.tmpl | 35 +++++++++++++++++++++++++ templates/nav.tmpl | 9 ++++--- templates/userlist.tmpl | 14 +--------- templates/userlistitem.tmpl | 15 +++++++++++ 6 files changed, 121 insertions(+), 19 deletions(-) create mode 100644 templates/list.tmpl create mode 100644 templates/lists.tmpl create mode 100644 templates/userlistitem.tmpl (limited to 'templates') diff --git a/templates/about.tmpl b/templates/about.tmpl index 54316cf..0e4d001 100644 --- a/templates/about.tmpl +++ b/templates/about.tmpl @@ -46,11 +46,11 @@ 6 - Settings + Lists 7 - Signout + Settings 8 diff --git a/templates/list.tmpl b/templates/list.tmpl new file mode 100644 index 0000000..1b15278 --- /dev/null +++ b/templates/list.tmpl @@ -0,0 +1,63 @@ +{{with .Data}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}} +
List {{.List.Title}}
+ +
+ + + + +
+ +
Users
+{{if .Accounts}} + +{{range .Accounts}} + + + + +{{end}} +
{{template "userlistitem.tmpl" (WithContext . $.Ctx)}} +
+ + + +
+
+{{else}} +
No data found
+{{end}} + +
Add user
+
+ + + + + +
+ +{{if .Q}} +{{if .SearchAccounts}} + +{{range .SearchAccounts}} + + + + +{{end}} +
{{template "userlistitem.tmpl" (WithContext . $.Ctx)}} +
+ + + +
+
+{{else}} +
No data found
+{{end}} +{{end}} + +{{template "footer.tmpl"}} +{{end}} diff --git a/templates/lists.tmpl b/templates/lists.tmpl new file mode 100644 index 0000000..27979cb --- /dev/null +++ b/templates/lists.tmpl @@ -0,0 +1,35 @@ +{{with .Data}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}} +
Lists
+ +{{range .Lists}} +
+ {{.Title}} timeline + - +
+ +
+ - +
+ + + +
+
+{{else}} +
No data found
+{{end}} + +
Add list
+
+ + + + + + + +
+ +{{template "footer.tmpl"}} +{{end}} diff --git a/templates/nav.tmpl b/templates/nav.tmpl index ea18a5f..e7a7981 100644 --- a/templates/nav.tmpl +++ b/templates/nav.tmpl @@ -17,16 +17,17 @@ home direct local - twkn - remote + twkn + remote search
- settings + lists + settings
- +
about
diff --git a/templates/userlist.tmpl b/templates/userlist.tmpl index b8e0e5d..f206397 100644 --- a/templates/userlist.tmpl +++ b/templates/userlist.tmpl @@ -1,19 +1,7 @@ {{with .Data}}
{{range .}} -
-
- - avatar - -
-
-
{{EmojiFilter (html .DisplayName) .Emojis}}
- -
@{{.Acct}}
-
-
-
+ {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} {{else}}
No data found
{{end}} diff --git a/templates/userlistitem.tmpl b/templates/userlistitem.tmpl new file mode 100644 index 0000000..51261c8 --- /dev/null +++ b/templates/userlistitem.tmpl @@ -0,0 +1,15 @@ +{{with .Data}} +
+
+ + avatar + +
+
+
{{EmojiFilter (html .DisplayName) .Emojis}}
+ +
@{{.Acct}}
+
+
+
+{{end}} -- cgit v1.2.3 From 2d49ff9fb4ea9b0e88df1621e954246bc1851de6 Mon Sep 17 00:00:00 2001 From: r Date: Wed, 30 Mar 2022 15:52:30 +0000 Subject: Switch to html/template --- templates/header.tmpl | 2 +- templates/list.tmpl | 2 +- templates/nav.tmpl | 2 +- templates/notification.tmpl | 4 ++-- templates/requestlist.tmpl | 2 +- templates/search.tmpl | 2 +- templates/status.tmpl | 13 ++++++++----- templates/user.tmpl | 6 +++--- templates/userlistitem.tmpl | 2 +- templates/usersearch.tmpl | 4 ++-- 10 files changed, 21 insertions(+), 18 deletions(-) (limited to 'templates') diff --git a/templates/header.tmpl b/templates/header.tmpl index 8eb53f6..1abb6dd 100644 --- a/templates/header.tmpl +++ b/templates/header.tmpl @@ -17,7 +17,7 @@ {{if .RefreshInterval}} {{end}} - {{if gt .Count 0}}({{.Count}}){{end}} {{.Title | html}} + {{if gt .Count 0}}({{.Count}}){{end}} {{.Title}} {{if .CustomCSS}} diff --git a/templates/list.tmpl b/templates/list.tmpl index 1b15278..dcc6ee8 100644 --- a/templates/list.tmpl +++ b/templates/list.tmpl @@ -33,7 +33,7 @@
- +
diff --git a/templates/nav.tmpl b/templates/nav.tmpl index e7a7981..db88aa0 100644 --- a/templates/nav.tmpl +++ b/templates/nav.tmpl @@ -8,7 +8,7 @@
- {{EmojiFilter (html .Account.DisplayName) .Account.Emojis}} + {{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}} followed you - @@ -48,7 +48,7 @@
- {{EmojiFilter (html .Account.DisplayName) .Account.Emojis}} + {{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}} wants to follow you - diff --git a/templates/requestlist.tmpl b/templates/requestlist.tmpl index d9b2b0a..1a51e31 100644 --- a/templates/requestlist.tmpl +++ b/templates/requestlist.tmpl @@ -9,7 +9,7 @@
-
{{EmojiFilter (html .DisplayName) .Emojis}}
+
{{EmojiFilter (HTML .DisplayName) .Emojis | Raw}}
@{{.Acct}}
diff --git a/templates/search.tmpl b/templates/search.tmpl index 7338cad..0473d4a 100644 --- a/templates/search.tmpl +++ b/templates/search.tmpl @@ -5,7 +5,7 @@
- + diff --git a/templates/status.tmpl b/templates/status.tmpl index dda1d79..fd0940f 100644 --- a/templates/status.tmpl +++ b/templates/status.tmpl @@ -5,7 +5,7 @@ avatar - {{EmojiFilter (html .Account.DisplayName) .Account.Emojis}} + {{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}} @{{.Account.Acct}} @@ -23,7 +23,7 @@
- {{EmojiFilter (html .Account.DisplayName) .Account.Emojis}} + {{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}} @{{.Account.Acct}} @@ -91,7 +91,10 @@ {{end}}
{{if (or .Content .SpoilerText)}} -
{{StatusContentFilter (html .SpoilerText) .Content .Emojis .Mentions}}
+
+ {{if .SpoilerText}}{{EmojiFilter (HTML .SpoilerText) .Emojis | Raw}}
{{end}} + {{StatusContentFilter .Content .Emojis .Mentions | Raw}} +
{{end}} {{if .MediaAttachments}}
@@ -156,12 +159,12 @@ {{range $i, $o := .Poll.Options}}
{{if (or $s.Poll.Expired $s.Poll.Voted)}} -
{{EmojiFilter (html $o.Title) $s.Emojis}} - {{$o.VotesCount}} votes
+
{{EmojiFilter (HTML $o.Title) $s.Emojis | Raw}} - {{$o.VotesCount}} votes
{{else}} {{end}}
diff --git a/templates/user.tmpl b/templates/user.tmpl index 2532a91..fd838b9 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -11,7 +11,7 @@
{{if .User.Fields}}{{range .User.Fields}} -
{{.Name}} - {{.Value}}
+
{{.Name}} - {{.Value | Raw}}
{{end}}{{end}}
diff --git a/templates/userlistitem.tmpl b/templates/userlistitem.tmpl index 51261c8..50b9d0c 100644 --- a/templates/userlistitem.tmpl +++ b/templates/userlistitem.tmpl @@ -6,7 +6,7 @@
-
{{EmojiFilter (html .DisplayName) .Emojis}}
+
{{EmojiFilter (HTML .DisplayName) .Emojis | Raw}}
@{{.Acct}}
diff --git a/templates/usersearch.tmpl b/templates/usersearch.tmpl index e95129c..52001c9 100644 --- a/templates/usersearch.tmpl +++ b/templates/usersearch.tmpl @@ -1,11 +1,11 @@ {{with .Data}} {{template "header.tmpl" (WithContext .CommonData $.Ctx)}} -
Search {{EmojiFilter (html .User.DisplayName) .User.Emojis}}'s statuses
+
Search {{EmojiFilter (HTML .User.DisplayName) .User.Emojis | Raw}}'s statuses
Query - + -- cgit v1.2.3 From c36314fe7fe6ee5fa75b29930214b56c40e8e46d Mon Sep 17 00:00:00 2001 From: r Date: Wed, 30 Mar 2022 17:12:53 +0000 Subject: fluoride: Use target=_blank for user field links --- templates/user.tmpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/user.tmpl b/templates/user.tmpl index fd838b9..dccce7c 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -131,9 +131,13 @@ - {{if .User.Fields}}{{range .User.Fields}} -
{{.Name}} - {{.Value | Raw}}
- {{end}}{{end}} + {{if .User.Fields}} +
+ {{range .User.Fields}} +
{{.Name}} - {{.Value | Raw}}
+ {{end}} +
+ {{end}}
-- cgit v1.2.3 From 94ff5c93ded09cf6d9cff3e18969df3e9c6cb186 Mon Sep 17 00:00:00 2001 From: r Date: Wed, 30 Mar 2022 17:59:42 +0000 Subject: Show attachment metadata when attachment preview is disabled --- templates/status.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/status.tmpl b/templates/status.tmpl index fd0940f..5ada84e 100644 --- a/templates/status.tmpl +++ b/templates/status.tmpl @@ -103,7 +103,7 @@ {{if eq .Type "image"}} {{if $.Ctx.HideAttachments}} - {{if .Description}}[{{.Description}}]{{else}}[image]{{end}} + [image{{if $s.Sensitive}}/nsfw{{end}}{{if .Description}}: {{.Description}}{{end}}] {{else}} @@ -117,7 +117,7 @@ {{else if eq .Type "audio"}} {{if $.Ctx.HideAttachments}} - {{if .Description}}[{{.Description}}]{{else}}[audio]{{end}} + [audio{{if $s.Sensitive}}/nsfw{{end}}{{if .Description}}: {{.Description}}{{end}}] {{else}}