notification.tmpl 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {{with .Data}}
  2. {{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
  3. <div class="page-title-container">
  4. <span class="page-title">
  5. Notifications
  6. {{if and (not $.Ctx.AntiDopamineMode) (gt .UnreadCount 0)}}
  7. ({{.UnreadCount }})
  8. {{end}}
  9. </span>
  10. <a class="page-refresh" href="/notifications" target="_self" accesskey="R" title="Refresh (R)">refresh</a>
  11. {{if .ReadID}}
  12. <form class="notification-read" action="/notifications/read?max_id={{.ReadID}}" method="post" target="_self">
  13. <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
  14. <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
  15. <input type="submit" value="read" class="btn-link" accesskey="C" title="Clear unread notifications (C)">
  16. </form>
  17. {{end}}
  18. </div>
  19. {{range .Notifications}}
  20. <div class="notification-container {{.Type}} {{if .Pleroma}}{{if not .Pleroma.IsSeen}}unread{{end}}{{end}}">
  21. {{if eq .Type "follow"}}
  22. <div class="notification-follow-container">
  23. <div class="status-profile-img-container">
  24. <a class="img-link" href="/user/{{.Account.ID}}">
  25. <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="profile-avatar" height="48" />
  26. </a>
  27. </div>
  28. <div class="notification-follow">
  29. <div class="notification-info-text">
  30. <bdi class="status-dname">{{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}}</bdi>
  31. <span class="notification-text"> followed you -
  32. <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
  33. </span>
  34. </div>
  35. <div>
  36. <a href="/user/{{.Account.ID}}"> <span class="status-uname">@{{.Account.Acct}}</span> </a>
  37. </div>
  38. </div>
  39. </div>
  40. {{else if eq .Type "follow_request"}}
  41. <div class="notification-follow-container">
  42. <div class="status-profile-img-container">
  43. <a class="img-link" href="/user/{{.Account.ID}}">
  44. <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="profile-avatar" height="48" />
  45. </a>
  46. </div>
  47. <div class="notification-follow">
  48. <div class="notification-info-text">
  49. <bdi class="status-dname">{{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}}</bdi>
  50. <span class="notification-text"> wants to follow you -
  51. <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
  52. </span>
  53. </div>
  54. <div>
  55. <a href="/user/{{.Account.ID}}"><span class="status-uname">@{{.Account.Acct}}</span></a>
  56. </div>
  57. <form class="d-inline" action="/accept/{{.Account.ID}}" method="post" target="_self">
  58. <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
  59. <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
  60. <input type="submit" value="accept" class="btn-link">
  61. </form>
  62. -
  63. <form class="d-inline" action="/reject/{{.Account.ID}}" method="post" target="_self">
  64. <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
  65. <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
  66. <input type="submit" value="reject" class="btn-link">
  67. </form>
  68. </div>
  69. </div>
  70. {{else if eq .Type "mention"}}
  71. {{template "status" (WithContext .Status $.Ctx)}}
  72. {{else if eq .Type "reblog"}}
  73. <div class="retweet-info">
  74. <a class="img-link" href="/user/{{.Account.ID}}">
  75. <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
  76. </a>
  77. <a href="/user/{{.Account.ID}}">
  78. <span class="status-uname">@{{.Account.Acct}}</span>
  79. </a>
  80. <span class="notification-text"> retweeted your post -
  81. <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
  82. </span>
  83. </div>
  84. {{template "status" (WithContext .Status $.Ctx)}}
  85. {{else if eq .Type "favourite"}}
  86. <div class="retweet-info">
  87. <a class="img-link" href="/user/{{.Account.ID}}">
  88. <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
  89. </a>
  90. <a href="/user/{{.Account.ID}}">
  91. <span class="status-uname">@{{.Account.Acct}}</span>
  92. </a>
  93. <span class="notification-text"> liked your post -
  94. <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
  95. </span>
  96. </div>
  97. {{template "status" (WithContext .Status $.Ctx)}}
  98. {{else if eq .Type "update"}}
  99. <div class="retweet-info">
  100. <a class="img-link" href="/user/{{.Account.ID}}">
  101. <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
  102. </a>
  103. <a href="/user/{{.Account.ID}}">
  104. <span class="status-uname"> @{{.Account.Acct}} </span>
  105. </a>
  106. <span class="notification-text"> edited own post -
  107. <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
  108. </span>
  109. </div>
  110. {{template "status" (WithContext .Status $.Ctx)}}
  111. {{else if eq .Type "admin.sign_up"}}
  112. <div class="retweet-info">
  113. <a class="img-link" href="/user/{{.Account.ID}}">
  114. <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
  115. </a>
  116. <a href="/user/{{.Account.ID}}">
  117. <span class="status-uname"> @{{.Account.Acct}} </span>
  118. </a>
  119. <span class="notification-text"> Signed up on instance -
  120. <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
  121. </span>
  122. </div>
  123. {{else}}
  124. <div class="retweet-info">
  125. <a class="img-link" href="/user/{{.Account.ID}}">
  126. <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
  127. </a>
  128. <a href="/user/{{.Account.ID}}">
  129. <span class="status-uname">@{{.Account.Acct}}</span>
  130. </a>
  131. <span class="notification-text"> {{.Type}} -
  132. <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
  133. </span>
  134. </div>
  135. {{if .Status}}{{template "status" (WithContext .Status $.Ctx)}}{{end}}
  136. {{end}}
  137. </div>
  138. {{end}}
  139. <div class="pagination">
  140. {{if .NextLink}}
  141. <a href="{{.NextLink}}" target="_self">[next]</a>
  142. {{end}}
  143. </div>
  144. {{template "footer.tmpl"}}
  145. {{end}}