logo

pleroma-fe

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

notification_filters.vue (3316B)


  1. <template>
  2. <Popover
  3. trigger="click"
  4. class="NotificationFilters"
  5. placement="bottom"
  6. :bound-to="{ x: 'container' }"
  7. >
  8. <template #content>
  9. <div class="dropdown-menu">
  10. <button
  11. class="menu-item dropdown-item"
  12. @click="toggleNotificationFilter('likes')"
  13. >
  14. <span
  15. class="input menu-checkbox"
  16. :class="{ 'menu-checkbox-checked': filters.likes }"
  17. />{{ $t('settings.notification_visibility_likes') }}
  18. </button>
  19. <button
  20. class="menu-item dropdown-item"
  21. @click="toggleNotificationFilter('repeats')"
  22. >
  23. <span
  24. class="input menu-checkbox"
  25. :class="{ 'menu-checkbox-checked': filters.repeats }"
  26. />{{ $t('settings.notification_visibility_repeats') }}
  27. </button>
  28. <button
  29. class="menu-item dropdown-item"
  30. @click="toggleNotificationFilter('follows')"
  31. >
  32. <span
  33. class="input menu-checkbox"
  34. :class="{ 'menu-checkbox-checked': filters.follows }"
  35. />{{ $t('settings.notification_visibility_follows') }}
  36. </button>
  37. <button
  38. class="menu-item dropdown-item"
  39. @click="toggleNotificationFilter('mentions')"
  40. >
  41. <span
  42. class="input menu-checkbox"
  43. :class="{ 'menu-checkbox-checked': filters.mentions }"
  44. />{{ $t('settings.notification_visibility_mentions') }}
  45. </button>
  46. <button
  47. class="menu-item dropdown-item"
  48. @click="toggleNotificationFilter('emojiReactions')"
  49. >
  50. <span
  51. class="input menu-checkbox"
  52. :class="{ 'menu-checkbox-checked': filters.emojiReactions }"
  53. />{{ $t('settings.notification_visibility_emoji_reactions') }}
  54. </button>
  55. <button
  56. class="menu-item dropdown-item"
  57. @click="toggleNotificationFilter('moves')"
  58. >
  59. <span
  60. class="input menu-checkbox"
  61. :class="{ 'menu-checkbox-checked': filters.moves }"
  62. />{{ $t('settings.notification_visibility_moves') }}
  63. </button>
  64. <button
  65. class="menu-item dropdown-item"
  66. @click="toggleNotificationFilter('polls')"
  67. >
  68. <span
  69. class="input menu-checkbox"
  70. :class="{ 'menu-checkbox-checked': filters.polls }"
  71. />{{ $t('settings.notification_visibility_polls') }}
  72. </button>
  73. </div>
  74. </template>
  75. <template #trigger>
  76. <button class="filter-trigger-button button-unstyled">
  77. <FAIcon icon="filter" />
  78. </button>
  79. </template>
  80. </Popover>
  81. </template>
  82. <script>
  83. import Popover from '../popover/popover.vue'
  84. import { library } from '@fortawesome/fontawesome-svg-core'
  85. import { faFilter } from '@fortawesome/free-solid-svg-icons'
  86. library.add(
  87. faFilter
  88. )
  89. export default {
  90. components: { Popover },
  91. computed: {
  92. filters () {
  93. return this.$store.getters.mergedConfig.notificationVisibility
  94. }
  95. },
  96. methods: {
  97. toggleNotificationFilter (type) {
  98. this.$store.dispatch('setOption', {
  99. name: 'notificationVisibility',
  100. value: {
  101. ...this.filters,
  102. [type]: !this.filters[type]
  103. }
  104. })
  105. }
  106. }
  107. }
  108. </script>