Update notification layout
authorr <r@freesoftwareextremist.com>
Wed, 29 Jan 2020 18:14:27 +0000 (18:14 +0000)
committerr <r@freesoftwareextremist.com>
Wed, 29 Jan 2020 18:14:27 +0000 (18:14 +0000)
mastodon/status.go
service/service.go
static/style.css
templates/notification.tmpl
templates/status.tmpl

index bce283f83fe009c108358f4ba5cb0a7c0ef2570e..5be4f49b7cc73bb37d72232c15ad203a0d431b5b 100644 (file)
@@ -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"`
index 0ef8f094f89c269c5f24cc03fab41065c1152a2a..fbf617a6faa52c102a2bf392a7dbeabf44139427 100644 (file)
@@ -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++
                }
index 602f2ef857593fe7e4a8c47fa9a5e85401b0ead7..fdbad23e436aa7d996d5244985708884b6e7525a 100644 (file)
 }
 
 .retweet-info {
-       margin: 8px 0 4px 24px; 
+       margin: 0 0 2px 24px;   
 }
 
 .retweet-info .status-profile-img {
        border-color: #777777;
 }
 
-.notification-follow-container,
-.notification-like-container,
-.notification-retweet-container {
+.notification-follow-container {
        display: flex;
 }
 
        margin-top: 8px;
 }
 
+.notification-time {
+       margin-left: 8px;
+}
+
 .status-reply-to {
        display: inline-block;
        vertical-align: center;
index 7d0e67c799f4c8ac0fd35580ed7668e481df2f1c..cc7a4a155b4a18cf208402be704c5c27f2229fa8 100644 (file)
@@ -17,6 +17,9 @@
                                <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>  
                                <img class="icon" src="{{GetIcon "user-plus" $.Ctx.DarkMode}}" alt="followed" />
                                <span> followed you </span>
+                               <span>
+                                       - <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> 
+                               </span>
                        </div>
                        <div class="notification-follow-uname">
                                @{{.Account.Acct}}
        {{template "status" (WithContext .Status $.Ctx)}}
 
        {{else if eq .Type "reblog"}}
-       <div class="notification-retweet-container">
-               <div class="status-profile-img-container">
-                       <a class="img-link" href="/user/{{.Account.ID}}" >
-                               <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
-                       </a>
-               </div>
-               <div>
-                       <div class="notification-info-text">
-                               <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>  
-                               <img class="icon" src="{{GetIcon "retweeted" $.Ctx.DarkMode}}" alt="retweeted" />
-                               <span> retweeted your post </span>
-                       </div>
-                       {{template "status" (WithContext .Status $.Ctx)}}
-               </div>
+       <div class="retweet-info">
+               <a class="img-link" href="/user/{{.Account.ID}}">
+                       <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
+               </a>
+               <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>  
+               <img class="icon" src="{{GetIcon "retweeted" $.Ctx.DarkMode}}" alt="retweeted" />
+               <span> retweeted your post </span>
+               <span>
+                       - <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> 
+               </span>
        </div>
+       {{template "status" (WithContext .Status $.Ctx)}}
 
        {{else if eq .Type "favourite"}}
-       <div class="notification-like-container">
-               <div class="status-profile-img-container">
-                       <a class="img-link" href="/user/{{.Account.ID}}" >
-                               <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
-                       </a>
-               </div>
-               <div>
-                       <div class="notification-info-text">
-                               <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>  
-                               <img class="icon" src="{{GetIcon "liked" $.Ctx.DarkMode}}" alt="liked" />
-                               <span> liked your post </span>
-                       </div>
-                       {{template "status" (WithContext .Status $.Ctx)}}
-               </div>
+       <div class="retweet-info">
+               <a class="img-link" href="/user/{{.Account.ID}}">
+                       <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
+               </a>
+               <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>  
+               <img class="icon" src="{{GetIcon "liked" $.Ctx.DarkMode}}" alt="liked" />
+               <span> liked your post </span>
+               <span>
+                       - <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> 
+               </span>
        </div>
+       {{template "status" (WithContext .Status $.Ctx)}}
        {{end}}
 </div>
 {{end}}
index fd5339a3f41f0a2e6a5afc3e6a5eac2838c8754a..a6b28fa70395b8fcfeb655d444565c5a2a27f4c1 100644 (file)
        {{block "status" (WithContext . $.Ctx)}}
        {{with $s := .Data}}
        <div class="status-container status-{{.ID}}" data-id="{{.ID}}">
-               {{if not .HideAccountInfo}}
                <div class="status-profile-img-container">
                        <a class="img-link" href="/user/{{.Account.ID}}">
                                <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
                        </a>
                </div>
-               {{end}}
                <div class="status"> 
-                       {{if not .HideAccountInfo}}
                        <div class="status-name">
                                <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span> 
                                <a href="/user/{{.Account.ID}}" >
@@ -43,7 +40,6 @@
                                        <img class="icon" src="{{GetIcon "link" $.Ctx.DarkMode}}" alt="source" />
                                </a>
                        </div>
-                       {{end}}
                        <div class="status-reply-container">
                                {{if .InReplyToID}}
                                <div class="status-reply-to">