From f68d72ae0eb2eb6c15cd225c1a3b9185aaa20e3f Mon Sep 17 00:00:00 2001 From: r Date: Sun, 15 Dec 2019 17:37:58 +0000 Subject: Add notification support --- templates/navigation.tmpl | 1 + templates/notification.tmpl | 59 +++++++++++++++++++++++++++++++++++++++++++++ templates/status.tmpl | 4 +++ templates/thread.tmpl | 2 +- templates/timeline.tmpl | 2 +- 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 templates/notification.tmpl (limited to 'templates') diff --git a/templates/navigation.tmpl b/templates/navigation.tmpl index ea4a213..d86971c 100644 --- a/templates/navigation.tmpl +++ b/templates/navigation.tmpl @@ -1,4 +1,5 @@ diff --git a/templates/notification.tmpl b/templates/notification.tmpl new file mode 100644 index 0000000..099f17e --- /dev/null +++ b/templates/notification.tmpl @@ -0,0 +1,59 @@ +{{template "header.tmpl"}} +{{template "navigation.tmpl" .NavbarData}} +
Notifications
+ +{{range .Notifications}} +
+ {{if eq .Type "follow"}} +
+ profile-avatar +
+
+ {{WithEmojis .Account.DisplayName .Account.Emojis}} + + followed you +
+
+ @{{.Account.Acct}} +
+
+
+ + {{else if eq .Type "mention"}} + {{template "status" .Status}} + + {{else if eq .Type "reblog"}} +
+ profile-avatar +
+
+ {{WithEmojis .Account.DisplayName .Account.Emojis}} + + retweeted your post +
+ {{template "status" .Status}} +
+
+ + {{else if eq .Type "favourite"}} +
+ profile-avatar +
+
+ {{WithEmojis .Account.DisplayName .Account.Emojis}} + + liked your post +
+ {{template "status" .Status}} +
+
+ {{end}} +
+{{end}} + + +{{template "footer.tmpl"}} diff --git a/templates/status.tmpl b/templates/status.tmpl index 24f9a54..7020be0 100644 --- a/templates/status.tmpl +++ b/templates/status.tmpl @@ -11,13 +11,17 @@ {{block "status" .}}
+ {{if ne .Account.ID ""}} profile-avatar + {{end}}
+ {{if ne .Account.ID ""}}
{{WithEmojis .Account.DisplayName .Account.Emojis}} {{.Account.Acct}}
+ {{end}}
{{WithEmojis .Content .Emojis}}
{{range .MediaAttachments}} diff --git a/templates/thread.tmpl b/templates/thread.tmpl index a3f7916..29d702b 100644 --- a/templates/thread.tmpl +++ b/templates/thread.tmpl @@ -1,6 +1,6 @@ {{template "header.tmpl"}} +{{template "navigation.tmpl" .NavbarData}}
Thread
-{{template "navigation.tmpl"}} {{range .Context.Ancestors}} {{template "status.tmpl" .}} diff --git a/templates/timeline.tmpl b/templates/timeline.tmpl index 527c91b..53e3ad7 100644 --- a/templates/timeline.tmpl +++ b/templates/timeline.tmpl @@ -1,6 +1,6 @@ {{template "header.tmpl"}} +{{template "navigation.tmpl" .NavbarData}}
Timeline
-{{template "navigation.tmpl"}}
-- cgit v1.2.3