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 (3647B)


  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('statuses')"
  49. >
  50. <span
  51. class="input menu-checkbox"
  52. :class="{ 'menu-checkbox-checked': filters.statuses }"
  53. />{{ $t('settings.notification_visibility_statuses') }}
  54. </button>
  55. <button
  56. class="menu-item dropdown-item"
  57. @click="toggleNotificationFilter('emojiReactions')"
  58. >
  59. <span
  60. class="input menu-checkbox"
  61. :class="{ 'menu-checkbox-checked': filters.emojiReactions }"
  62. />{{ $t('settings.notification_visibility_emoji_reactions') }}
  63. </button>
  64. <button
  65. class="menu-item dropdown-item"
  66. @click="toggleNotificationFilter('moves')"
  67. >
  68. <span
  69. class="input menu-checkbox"
  70. :class="{ 'menu-checkbox-checked': filters.moves }"
  71. />{{ $t('settings.notification_visibility_moves') }}
  72. </button>
  73. <button
  74. class="menu-item dropdown-item"
  75. @click="toggleNotificationFilter('polls')"
  76. >
  77. <span
  78. class="input menu-checkbox"
  79. :class="{ 'menu-checkbox-checked': filters.polls }"
  80. />{{ $t('settings.notification_visibility_polls') }}
  81. </button>
  82. </div>
  83. </template>
  84. <template #trigger>
  85. <button class="filter-trigger-button button-unstyled">
  86. <FAIcon icon="filter" />
  87. </button>
  88. </template>
  89. </Popover>
  90. </template>
  91. <script>
  92. import Popover from '../popover/popover.vue'
  93. import { library } from '@fortawesome/fontawesome-svg-core'
  94. import { faFilter } from '@fortawesome/free-solid-svg-icons'
  95. library.add(
  96. faFilter
  97. )
  98. export default {
  99. components: { Popover },
  100. computed: {
  101. filters () {
  102. return this.$store.getters.mergedConfig.notificationVisibility
  103. }
  104. },
  105. methods: {
  106. toggleNotificationFilter (type) {
  107. this.$store.dispatch('setOption', {
  108. name: 'notificationVisibility',
  109. value: {
  110. ...this.filters,
  111. [type]: !this.filters[type]
  112. }
  113. })
  114. }
  115. }
  116. }
  117. </script>