From f93fe3276607039a5d09fa83b17c8f353b19ce86 Mon Sep 17 00:00:00 2001 From: r Date: Wed, 29 Jan 2020 18:14:27 +0000 Subject: Update notification layout --- mastodon/status.go | 1 - service/service.go | 7 ------ static/style.css | 10 +++++---- templates/notification.tmpl | 53 +++++++++++++++++++++------------------------ templates/status.tmpl | 4 ---- 5 files changed, 31 insertions(+), 44 deletions(-) diff --git a/mastodon/status.go b/mastodon/status.go index bce283f..5be4f49 100644 --- a/mastodon/status.go +++ b/mastodon/status.go @@ -50,7 +50,6 @@ type Status struct { // Custom fields Pleroma StatusPleroma `json:"pleroma"` - HideAccountInfo bool `json:"hide_account_info"` ShowReplies bool `json:"show_replies"` ReplyMap map[string][]ReplyInfo `json:"reply_map"` ReplyNumber int `json:"reply_number"` diff --git a/service/service.go b/service/service.go index 0ef8f09..fbf617a 100644 --- a/service/service.go +++ b/service/service.go @@ -490,13 +490,6 @@ func (svc *service) ServeNotificationPage(ctx context.Context, c *model.Client, } for i := range notifications { - if notifications[i].Status != nil { - notifications[i].Status.CreatedAt = notifications[i].CreatedAt - switch notifications[i].Type { - case "reblog", "favourite": - notifications[i].Status.HideAccountInfo = true - } - } if notifications[i].Pleroma != nil && !notifications[i].Pleroma.IsSeen { unreadCount++ } diff --git a/static/style.css b/static/style.css index 602f2ef..fdbad23 100644 --- a/static/style.css +++ b/static/style.css @@ -138,7 +138,7 @@ } .retweet-info { - margin: 8px 0 4px 24px; + margin: 0 0 2px 24px; } .retweet-info .status-profile-img { @@ -176,9 +176,7 @@ border-color: #777777; } -.notification-follow-container, -.notification-like-container, -.notification-retweet-container { +.notification-follow-container { display: flex; } @@ -190,6 +188,10 @@ margin-top: 8px; } +.notification-time { + margin-left: 8px; +} + .status-reply-to { display: inline-block; vertical-align: center; diff --git a/templates/notification.tmpl b/templates/notification.tmpl index 7d0e67c..cc7a4a1 100644 --- a/templates/notification.tmpl +++ b/templates/notification.tmpl @@ -17,6 +17,9 @@ {{EmojiFilter .Account.DisplayName .Account.Emojis}} followed followed you + + - +
@{{.Account.Acct}} @@ -28,38 +31,32 @@ {{template "status" (WithContext .Status $.Ctx)}} {{else if eq .Type "reblog"}} -
-
- - profile-avatar - -
-
-
- {{EmojiFilter .Account.DisplayName .Account.Emojis}} - retweeted - retweeted your post -
- {{template "status" (WithContext .Status $.Ctx)}} -
+
+ + avatar + + {{EmojiFilter .Account.DisplayName .Account.Emojis}} + retweeted + retweeted your post + + - +
+ {{template "status" (WithContext .Status $.Ctx)}} {{else if eq .Type "favourite"}} -
-
- - profile-avatar - -
-
-
- {{EmojiFilter .Account.DisplayName .Account.Emojis}} - liked - liked your post -
- {{template "status" (WithContext .Status $.Ctx)}} -
+
+ + avatar + + {{EmojiFilter .Account.DisplayName .Account.Emojis}} + liked + liked your post + + - +
+ {{template "status" (WithContext .Status $.Ctx)}} {{end}}
{{end}} diff --git a/templates/status.tmpl b/templates/status.tmpl index fd5339a..a6b28fa 100644 --- a/templates/status.tmpl +++ b/templates/status.tmpl @@ -14,15 +14,12 @@ {{block "status" (WithContext . $.Ctx)}} {{with $s := .Data}}
- {{if not .HideAccountInfo}} - {{end}}
- {{if not .HideAccountInfo}}
{{EmojiFilter .Account.DisplayName .Account.Emojis}} @@ -43,7 +40,6 @@ source
- {{end}}
{{if .InReplyToID}}
-- cgit v1.2.3