logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

notification.vue (8906B)


  1. <template>
  2. <article
  3. v-if="notification.type === 'mention' || notification.type === 'status'"
  4. >
  5. <Status
  6. class="Notification"
  7. :compact="true"
  8. :statusoid="notification.status"
  9. @interacted="interacted"
  10. />
  11. </article>
  12. <article v-else>
  13. <div
  14. v-if="needMute && !unmuted"
  15. class="Notification container -muted"
  16. >
  17. <small>
  18. <user-link
  19. :user="notification.from_profile"
  20. :at="false"
  21. />
  22. </small>
  23. <button
  24. class="button-unstyled unmute"
  25. @click.prevent="toggleMute"
  26. >
  27. <FAIcon
  28. class="fa-scale-110 fa-old-padding"
  29. icon="eye-slash"
  30. />
  31. </button>
  32. </div>
  33. <div
  34. v-else
  35. class="Notification non-mention"
  36. :class="[userClass, { highlighted: userStyle }, '-type--' + notification.type]"
  37. :style="[ userStyle ]"
  38. >
  39. <a
  40. class="avatar-container"
  41. :href="$router.resolve(userProfileLink).href"
  42. @click.prevent
  43. >
  44. <UserPopover
  45. :user-id="notification.from_profile.id"
  46. :overlay-centers="true"
  47. >
  48. <UserAvatar
  49. class="post-avatar"
  50. :compact="true"
  51. :user="notification.from_profile"
  52. />
  53. </UserPopover>
  54. </a>
  55. <div class="notification-right">
  56. <span class="notification-details">
  57. <div class="name-and-action">
  58. <!-- eslint-disable vue/no-v-html -->
  59. <bdi v-if="!!notification.from_profile.name_html">
  60. <RichContent
  61. class="username"
  62. :title="'@'+notification.from_profile.screen_name_ui"
  63. :html="notification.from_profile.name_html"
  64. :emoji="notification.from_profile.emoji"
  65. />
  66. </bdi>
  67. <!-- eslint-enable vue/no-v-html -->
  68. <span
  69. v-else
  70. class="username"
  71. :title="'@'+notification.from_profile.screen_name_ui"
  72. >
  73. {{ notification.from_profile.name }}
  74. </span>
  75. {{ ' ' }}
  76. <span v-if="notification.type === 'like'">
  77. <FAIcon
  78. class="type-icon"
  79. icon="star"
  80. />
  81. {{ ' ' }}
  82. <small>{{ $t('notifications.favorited_you') }}</small>
  83. </span>
  84. <span v-if="notification.type === 'repeat'">
  85. <FAIcon
  86. class="type-icon"
  87. icon="retweet"
  88. :title="$t('tool_tip.repeat')"
  89. />
  90. {{ ' ' }}
  91. <small>{{ $t('notifications.repeated_you') }}</small>
  92. </span>
  93. <span v-if="notification.type === 'follow'">
  94. <FAIcon
  95. class="type-icon"
  96. icon="user-plus"
  97. />
  98. {{ ' ' }}
  99. <small>{{ $t('notifications.followed_you') }}</small>
  100. </span>
  101. <span v-if="notification.type === 'follow_request'">
  102. <FAIcon
  103. class="type-icon"
  104. icon="user"
  105. />
  106. {{ ' ' }}
  107. <small>{{ $t('notifications.follow_request') }}</small>
  108. </span>
  109. <span v-if="notification.type === 'move'">
  110. <FAIcon
  111. class="type-icon"
  112. icon="suitcase-rolling"
  113. />
  114. {{ ' ' }}
  115. <small>{{ $t('notifications.migrated_to') }}</small>
  116. </span>
  117. <span v-if="notification.type === 'pleroma:emoji_reaction'">
  118. <small>
  119. <i18n-t
  120. scope="global"
  121. keypath="notifications.reacted_with"
  122. >
  123. <img
  124. v-if="notification.emoji_url"
  125. class="emoji-reaction-emoji emoji-reaction-emoji-image"
  126. :src="notification.emoji_url"
  127. :alt="notification.emoji"
  128. :title="notification.emoji"
  129. >
  130. <span
  131. v-else
  132. class="emoji-reaction-emoji"
  133. >{{ notification.emoji }}</span>
  134. </i18n-t>
  135. </small>
  136. </span>
  137. <span v-if="notification.type === 'pleroma:report'">
  138. <small>{{ $t('notifications.submitted_report') }}</small>
  139. </span>
  140. <span v-if="notification.type === 'poll'">
  141. <FAIcon
  142. class="type-icon"
  143. icon="poll-h"
  144. />
  145. {{ ' ' }}
  146. <small>{{ $t('notifications.poll_ended') }}</small>
  147. </span>
  148. </div>
  149. <div
  150. v-if="isStatusNotification"
  151. class="timeago"
  152. >
  153. <router-link
  154. v-if="notification.status"
  155. :to="{ name: 'conversation', params: { id: notification.status.id } }"
  156. class="timeago-link faint"
  157. >
  158. <Timeago
  159. :time="notification.created_at"
  160. :auto-update="240"
  161. />
  162. </router-link>
  163. <button
  164. class="button-unstyled expand-icon"
  165. :title="$t('tool_tip.toggle_expand')"
  166. :aria-expanded="statusExpanded"
  167. @click.prevent="toggleStatusExpanded"
  168. >
  169. <FAIcon
  170. class="fa-scale-110"
  171. fixed-width
  172. :icon="statusExpanded ? 'compress-alt' : 'expand-alt'"
  173. />
  174. </button>
  175. </div>
  176. <div
  177. v-else
  178. class="timeago"
  179. >
  180. <span class="faint">
  181. <Timeago
  182. :time="notification.created_at"
  183. :auto-update="240"
  184. />
  185. </span>
  186. </div>
  187. <button
  188. v-if="needMute"
  189. class="button-unstyled"
  190. :title="$t('tool_tip.toggle_mute')"
  191. :aria-expanded="!unmuted"
  192. @click.prevent="toggleMute"
  193. >
  194. <FAIcon
  195. class="fa-scale-110 fa-old-padding"
  196. icon="eye-slash"
  197. />
  198. </button>
  199. </span>
  200. <div
  201. v-if="notification.type === 'follow' || notification.type === 'follow_request'"
  202. class="follow-text"
  203. >
  204. <user-link
  205. class="follow-name"
  206. :user="notification.from_profile"
  207. />
  208. <div
  209. v-if="notification.type === 'follow_request'"
  210. style="white-space: nowrap;"
  211. >
  212. <button
  213. class="button-unstyled"
  214. :title="$t('tool_tip.accept_follow_request')"
  215. @click="approveUser()"
  216. >
  217. <FAIcon
  218. icon="check"
  219. class="fa-scale-110 fa-old-padding follow-request-accept"
  220. />
  221. </button>
  222. <button
  223. class="button-unstyled"
  224. :title="$t('tool_tip.reject_follow_request')"
  225. @click="denyUser()"
  226. >
  227. <FAIcon
  228. icon="times"
  229. class="fa-scale-110 fa-old-padding follow-request-reject"
  230. />
  231. </button>
  232. </div>
  233. </div>
  234. <div
  235. v-else-if="notification.type === 'move'"
  236. class="move-text"
  237. >
  238. <user-link
  239. :user="notification.target"
  240. />
  241. </div>
  242. <Report
  243. v-else-if="notification.type === 'pleroma:report'"
  244. :report-id="notification.report.id"
  245. />
  246. <template v-else>
  247. <StatusContent
  248. :compact="!statusExpanded"
  249. :status="notification.status"
  250. />
  251. </template>
  252. </div>
  253. </div>
  254. <teleport to="#modal">
  255. <confirm-modal
  256. v-if="showingApproveConfirmDialog"
  257. :title="$t('user_card.approve_confirm_title')"
  258. :confirm-text="$t('user_card.approve_confirm_accept_button')"
  259. :cancel-text="$t('user_card.approve_confirm_cancel_button')"
  260. @accepted="doApprove"
  261. @cancelled="hideApproveConfirmDialog"
  262. >
  263. {{ $t('user_card.approve_confirm', { user: user.screen_name_ui }) }}
  264. </confirm-modal>
  265. <confirm-modal
  266. v-if="showingDenyConfirmDialog"
  267. :title="$t('user_card.deny_confirm_title')"
  268. :confirm-text="$t('user_card.deny_confirm_accept_button')"
  269. :cancel-text="$t('user_card.deny_confirm_cancel_button')"
  270. @accepted="doDeny"
  271. @cancelled="hideDenyConfirmDialog"
  272. >
  273. {{ $t('user_card.deny_confirm', { user: user.screen_name_ui }) }}
  274. </confirm-modal>
  275. </teleport>
  276. </article>
  277. </template>
  278. <script src="./notification.js"></script>
  279. <style src="./notification.scss" lang="scss"></style>