logo

pleroma-fe

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

extra_buttons.vue (6551B)


  1. <template>
  2. <Popover
  3. class="ExtraButtons"
  4. trigger="click"
  5. :trigger-attrs="triggerAttrs"
  6. placement="top"
  7. :offset="{ y: 5 }"
  8. :bound-to="{ x: 'container' }"
  9. remove-padding
  10. @show="onShow"
  11. @close="onClose"
  12. >
  13. <template #content="{close}">
  14. <div
  15. :id="`popup-menu-${randomSeed}`"
  16. class="dropdown-menu"
  17. role="menu"
  18. >
  19. <button
  20. v-if="canMute && !status.thread_muted"
  21. class="menu-item dropdown-item dropdown-item-icon"
  22. role="menuitem"
  23. @click.prevent="muteConversation"
  24. >
  25. <FAIcon
  26. fixed-width
  27. icon="eye-slash"
  28. /><span>{{ $t("status.mute_conversation") }}</span>
  29. </button>
  30. <button
  31. v-if="canMute && status.thread_muted"
  32. class="menu-item dropdown-item dropdown-item-icon"
  33. role="menuitem"
  34. @click.prevent="unmuteConversation"
  35. >
  36. <FAIcon
  37. fixed-width
  38. icon="eye-slash"
  39. /><span>{{ $t("status.unmute_conversation") }}</span>
  40. </button>
  41. <button
  42. v-if="!status.pinned && canPin"
  43. class="menu-item dropdown-item dropdown-item-icon"
  44. role="menuitem"
  45. @click.prevent="pinStatus"
  46. @click="close"
  47. >
  48. <FAIcon
  49. fixed-width
  50. icon="thumbtack"
  51. /><span>{{ $t("status.pin") }}</span>
  52. </button>
  53. <button
  54. v-if="status.pinned && canPin"
  55. class="menu-item dropdown-item dropdown-item-icon"
  56. role="menuitem"
  57. @click.prevent="unpinStatus"
  58. @click="close"
  59. >
  60. <FAIcon
  61. fixed-width
  62. icon="thumbtack"
  63. /><span>{{ $t("status.unpin") }}</span>
  64. </button>
  65. <template v-if="canBookmark">
  66. <button
  67. v-if="!status.bookmarked"
  68. class="menu-item dropdown-item dropdown-item-icon"
  69. role="menuitem"
  70. @click.prevent="bookmarkStatus"
  71. @click="close"
  72. >
  73. <FAIcon
  74. fixed-width
  75. :icon="['far', 'bookmark']"
  76. /><span>{{ $t("status.bookmark") }}</span>
  77. </button>
  78. <button
  79. v-if="status.bookmarked"
  80. class="menu-item dropdown-item dropdown-item-icon"
  81. role="menuitem"
  82. @click.prevent="unbookmarkStatus"
  83. @click="close"
  84. >
  85. <FAIcon
  86. fixed-width
  87. icon="bookmark"
  88. /><span>{{ $t("status.unbookmark") }}</span>
  89. </button>
  90. <StatusBookmarkFolderMenu
  91. v-if="status.bookmarked && bookmarkFolders"
  92. :status="status"
  93. />
  94. </template>
  95. <button
  96. v-if="ownStatus && editingAvailable"
  97. class="menu-item dropdown-item dropdown-item-icon"
  98. role="menuitem"
  99. @click.prevent="editStatus"
  100. @click="close"
  101. >
  102. <FAIcon
  103. fixed-width
  104. icon="pen"
  105. /><span>{{ $t("status.edit") }}</span>
  106. </button>
  107. <button
  108. v-if="isEdited && editingAvailable"
  109. class="menu-item dropdown-item dropdown-item-icon"
  110. role="menuitem"
  111. @click.prevent="showStatusHistory"
  112. @click="close"
  113. >
  114. <FAIcon
  115. fixed-width
  116. icon="history"
  117. /><span>{{ $t("status.status_history") }}</span>
  118. </button>
  119. <button
  120. v-if="canDelete"
  121. class="menu-item dropdown-item dropdown-item-icon"
  122. role="menuitem"
  123. @click.prevent="deleteStatus"
  124. @click="close"
  125. >
  126. <FAIcon
  127. fixed-width
  128. icon="times"
  129. /><span>{{ $t("status.delete") }}</span>
  130. </button>
  131. <button
  132. class="menu-item dropdown-item dropdown-item-icon"
  133. role="menuitem"
  134. @click.prevent="copyLink"
  135. @click="close"
  136. >
  137. <FAIcon
  138. fixed-width
  139. icon="share-alt"
  140. /><span>{{ $t("status.copy_link") }}</span>
  141. </button>
  142. <a
  143. v-if="!status.is_local"
  144. class="menu-item dropdown-item dropdown-item-icon"
  145. role="menuitem"
  146. title="Source"
  147. :href="status.external_url"
  148. target="_blank"
  149. >
  150. <FAIcon
  151. fixed-width
  152. icon="external-link-alt"
  153. /><span>{{ $t("status.external_source") }}</span>
  154. </a>
  155. <button
  156. class="menu-item dropdown-item dropdown-item-icon"
  157. role="menuitem"
  158. @click.prevent="reportStatus"
  159. @click="close"
  160. >
  161. <FAIcon
  162. fixed-width
  163. :icon="['far', 'flag']"
  164. /><span>{{ $t("user_card.report") }}</span>
  165. </button>
  166. </div>
  167. </template>
  168. <template #trigger>
  169. <span class="button-unstyled popover-trigger">
  170. <FALayers class="fa-old-padding-layer">
  171. <FAIcon
  172. class="fa-scale-110 "
  173. icon="ellipsis-h"
  174. />
  175. <FAIcon
  176. v-show="!expanded"
  177. class="focus-marker"
  178. transform="shrink-6 up-8 right-16"
  179. icon="plus"
  180. />
  181. <FAIcon
  182. v-show="expanded"
  183. class="focus-marker"
  184. transform="shrink-6 up-8 right-16"
  185. icon="times"
  186. />
  187. </FALayers>
  188. </span>
  189. <teleport to="#modal">
  190. <ConfirmModal
  191. v-if="showingDeleteDialog"
  192. :title="$t('status.delete_confirm_title')"
  193. :cancel-text="$t('status.delete_confirm_cancel_button')"
  194. :confirm-text="$t('status.delete_confirm_accept_button')"
  195. @cancelled="hideDeleteStatusConfirmDialog"
  196. @accepted="doDeleteStatus"
  197. >
  198. {{ $t('status.delete_confirm') }}
  199. </ConfirmModal>
  200. </teleport>
  201. </template>
  202. </Popover>
  203. </template>
  204. <script src="./extra_buttons.js"></script>
  205. <style lang="scss">
  206. @import "../../mixins";
  207. .ExtraButtons {
  208. .popover-trigger {
  209. position: static;
  210. padding: 10px;
  211. margin: -10px;
  212. &:hover .svg-inline--fa {
  213. color: var(--text);
  214. }
  215. }
  216. .popover-trigger-button {
  217. /* override of popover internal stuff */
  218. width: auto;
  219. @include unfocused-style {
  220. .focus-marker {
  221. visibility: hidden;
  222. }
  223. }
  224. @include focused-style {
  225. .focus-marker {
  226. visibility: visible;
  227. }
  228. }
  229. }
  230. }
  231. </style>