logo

pleroma-fe

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

nav_panel.vue (4592B)


  1. <template>
  2. <div class="NavPanel">
  3. <div class="panel panel-default">
  4. <div
  5. v-if="!forceExpand"
  6. class="panel-heading nav-panel-heading"
  7. >
  8. <NavigationPins :limit="6" />
  9. <div class="spacer" />
  10. <button
  11. class="button-unstyled"
  12. @click="toggleCollapse"
  13. >
  14. <FAIcon
  15. class="navigation-chevron"
  16. fixed-width
  17. :icon="collapsed ? 'chevron-down' : 'chevron-up'"
  18. />
  19. </button>
  20. </div>
  21. <ul
  22. v-if="!collapsed || forceExpand"
  23. class="panel-body"
  24. >
  25. <NavigationEntry
  26. v-if="currentUser || !privateMode"
  27. :show-pin="false"
  28. :item="{ icon: 'stream', label: 'nav.timelines' }"
  29. :aria-expanded="showTimelines ? 'true' : 'false'"
  30. @click="toggleTimelines"
  31. >
  32. <FAIcon
  33. class="timelines-chevron"
  34. fixed-width
  35. :icon="showTimelines ? 'chevron-up' : 'chevron-down'"
  36. />
  37. </NavigationEntry>
  38. <div
  39. v-show="showTimelines"
  40. class="timelines-background menu-item-collapsible"
  41. :class="{ '-expanded': showTimelines }"
  42. >
  43. <div class="timelines">
  44. <NavigationEntry
  45. v-for="item in timelinesItems"
  46. :key="item.name"
  47. :show-pin="editMode || forceEditMode"
  48. :item="item"
  49. />
  50. </div>
  51. </div>
  52. <NavigationEntry
  53. v-if="currentUser"
  54. :show-pin="false"
  55. :item="{ icon: 'list', label: 'nav.lists' }"
  56. :aria-expanded="showLists ? 'true' : 'false'"
  57. @click="toggleLists"
  58. >
  59. <router-link
  60. :title="$t('lists.manage_lists')"
  61. class="button-unstyled extra-button"
  62. :to="{ name: 'lists' }"
  63. @click.stop
  64. >
  65. <FAIcon
  66. fixed-width
  67. icon="wrench"
  68. />
  69. </router-link>
  70. <FAIcon
  71. class="timelines-chevron"
  72. fixed-width
  73. :icon="showLists ? 'chevron-up' : 'chevron-down'"
  74. />
  75. </NavigationEntry>
  76. <div
  77. v-show="showLists"
  78. class="timelines-background menu-item-collapsible"
  79. :class="{ '-expanded': showLists }"
  80. >
  81. <ListsMenuContent
  82. :show-pin="editMode || forceEditMode"
  83. class="timelines"
  84. />
  85. </div>
  86. <NavigationEntry
  87. v-if="currentUser && bookmarkFolders"
  88. :show-pin="false"
  89. :item="{ icon: 'bookmark', label: 'nav.bookmarks' }"
  90. :aria-expanded="showBookmarkFolders ? 'true' : 'false'"
  91. @click="toggleBookmarkFolders"
  92. >
  93. <router-link
  94. :title="$t('bookmarks.manage_bookmark_folders')"
  95. class="button-unstyled extra-button"
  96. :to="{ name: 'bookmark-folders' }"
  97. @click.stop
  98. >
  99. <FAIcon
  100. fixed-width
  101. icon="wrench"
  102. />
  103. </router-link>
  104. <FAIcon
  105. class="timelines-chevron"
  106. fixed-width
  107. :icon="showBookmarkFolders ? 'chevron-up' : 'chevron-down'"
  108. />
  109. </NavigationEntry>
  110. <div
  111. v-show="showBookmarkFolders"
  112. class="timelines-background menu-item-collapsible"
  113. :class="{ '-expanded': showBookmarkFolders }"
  114. >
  115. <BookmarkFoldersMenuContent
  116. class="timelines"
  117. />
  118. </div>
  119. <NavigationEntry
  120. v-for="item in rootItems"
  121. :key="item.name"
  122. :show-pin="editMode || forceEditMode"
  123. :item="item"
  124. />
  125. <NavigationEntry
  126. v-if="!forceEditMode && currentUser"
  127. :show-pin="false"
  128. :item="{ labelRaw: editMode ? $t('nav.edit_finish') : $t('nav.edit_pinned'), icon: editMode ? 'check' : 'wrench' }"
  129. @click="toggleEditMode"
  130. />
  131. </ul>
  132. </div>
  133. </div>
  134. </template>
  135. <script src="./nav_panel.js"></script>
  136. <style lang="scss">
  137. .NavPanel {
  138. .panel {
  139. overflow: hidden;
  140. box-shadow: var(--shadow);
  141. }
  142. ul {
  143. list-style: none;
  144. margin: 0;
  145. padding: 0;
  146. }
  147. .navigation-chevron {
  148. margin-left: 0.8em;
  149. margin-right: 0.8em;
  150. font-size: 1.1em;
  151. }
  152. .timelines-background {
  153. padding: 0 0 0 0.6em;
  154. }
  155. .nav-panel-heading {
  156. // breaks without a unit
  157. // stylelint-disable-next-line length-zero-no-unit
  158. --panel-heading-height-padding: 0px;
  159. }
  160. }
  161. </style>