logo

pleroma-fe

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

thread_tree.vue (4563B)


  1. <template>
  2. <article class="thread-tree">
  3. <status
  4. :key="status.id"
  5. ref="statusComponent"
  6. :inline-expanded="collapsable && isExpanded"
  7. :statusoid="status"
  8. :expandable="!isExpanded"
  9. :show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
  10. :focused="focused(status.id)"
  11. :in-conversation="isExpanded"
  12. :highlight="highlight"
  13. :replies="getReplies(status.id)"
  14. :in-profile="inProfile"
  15. :profile-user-id="profileUserId"
  16. class="conversation-status conversation-status-treeview status-fadein panel-body"
  17. :simple-tree="simple"
  18. :controlled-thread-display-status="threadDisplayStatus[status.id]"
  19. :controlled-toggle-thread-display="() => toggleThreadDisplay(status.id)"
  20. :controlled-showing-tall="currentProp.showingTall"
  21. :controlled-expanding-subject="currentProp.expandingSubject"
  22. :controlled-showing-long-subject="currentProp.showingLongSubject"
  23. :controlled-replying="currentProp.replying"
  24. :controlled-media-playing="currentProp.mediaPlaying"
  25. :controlled-toggle-showing-tall="() => toggleCurrentProp('showingTall')"
  26. :controlled-toggle-expanding-subject="() => toggleCurrentProp('expandingSubject')"
  27. :controlled-toggle-showing-long-subject="() => toggleCurrentProp('showingLongSubject')"
  28. :controlled-toggle-replying="() => toggleCurrentProp('replying')"
  29. :controlled-set-media-playing="(newVal) => setCurrentProp('mediaPlaying', newVal)"
  30. :dive="dive ? () => dive(status.id) : undefined"
  31. @goto="setHighlight"
  32. @toggleExpanded="toggleExpanded"
  33. />
  34. <div
  35. v-if="currentReplies.length && threadShowing"
  36. class="thread-tree-replies"
  37. >
  38. <thread-tree
  39. v-for="replyStatus in currentReplies"
  40. :key="replyStatus.id"
  41. ref="childComponent"
  42. :depth="depth + 1"
  43. :status="replyStatus"
  44. :in-profile="inProfile"
  45. :conversation="conversation"
  46. :collapsable="collapsable"
  47. :is-expanded="isExpanded"
  48. :pinned-status-ids-object="pinnedStatusIdsObject"
  49. :profile-user-id="profileUserId"
  50. :focused="focused"
  51. :get-replies="getReplies"
  52. :highlight="highlight"
  53. :set-highlight="setHighlight"
  54. :toggle-expanded="toggleExpanded"
  55. :simple="simple"
  56. :toggle-thread-display="toggleThreadDisplay"
  57. :thread-display-status="threadDisplayStatus"
  58. :show-thread-recursively="showThreadRecursively"
  59. :total-reply-count="totalReplyCount"
  60. :total-reply-depth="totalReplyDepth"
  61. :status-content-properties="statusContentProperties"
  62. :set-status-content-property="setStatusContentProperty"
  63. :toggle-status-content-property="toggleStatusContentProperty"
  64. :dive="dive"
  65. />
  66. </div>
  67. <div
  68. v-if="currentReplies.length && !threadShowing"
  69. class="thread-tree-replies thread-tree-replies-hidden"
  70. >
  71. <i18n-t
  72. v-if="simple"
  73. scope="global"
  74. tag="button"
  75. keypath="status.thread_follow_with_icon"
  76. class="button-unstyled -link thread-tree-show-replies-button"
  77. @click.prevent="dive(status.id)"
  78. >
  79. <template #icon>
  80. <FAIcon
  81. icon="angle-double-right"
  82. />
  83. </template>
  84. <template #text>
  85. <span>
  86. {{ $tc('status.thread_follow', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id] }) }}
  87. </span>
  88. </template>
  89. </i18n-t>
  90. <i18n-t
  91. v-else
  92. scope="global"
  93. tag="button"
  94. keypath="status.thread_show_full_with_icon"
  95. class="button-unstyled -link thread-tree-show-replies-button"
  96. @click.prevent="showThreadRecursively(status.id)"
  97. >
  98. <template #icon>
  99. <FAIcon
  100. icon="angle-double-down"
  101. />
  102. </template>
  103. <template #text>
  104. <span>
  105. {{ $tc('status.thread_show_full', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id], depth: totalReplyDepth[status.id] }) }}
  106. </span>
  107. </template>
  108. </i18n-t>
  109. </div>
  110. </article>
  111. </template>
  112. <script src="./thread_tree.js"></script>
  113. <style lang="scss">
  114. .thread-tree-replies {
  115. margin-left: var(--status-margin);
  116. border-left: 2px solid var(--border);
  117. }
  118. .thread-tree-replies-hidden {
  119. padding: var(--status-margin);
  120. /* Make the button stretch along the whole row */
  121. display: flex;
  122. align-items: stretch;
  123. flex-direction: column;
  124. }
  125. </style>