logo

pleroma-fe

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

nav_panel.vue (3585B)


  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-for="item in rootItems"
  88. :key="item.name"
  89. :show-pin="editMode || forceEditMode"
  90. :item="item"
  91. />
  92. <NavigationEntry
  93. v-if="!forceEditMode && currentUser"
  94. :show-pin="false"
  95. :item="{ label: editMode ? $t('nav.edit_finish') : $t('nav.edit_pinned'), icon: editMode ? 'check' : 'wrench' }"
  96. @click="toggleEditMode"
  97. />
  98. </ul>
  99. </div>
  100. </div>
  101. </template>
  102. <script src="./nav_panel.js"></script>
  103. <style lang="scss">
  104. .NavPanel {
  105. .panel {
  106. overflow: hidden;
  107. box-shadow: var(--shadow);
  108. }
  109. ul {
  110. list-style: none;
  111. margin: 0;
  112. padding: 0;
  113. }
  114. .navigation-chevron {
  115. margin-left: 0.8em;
  116. margin-right: 0.8em;
  117. font-size: 1.1em;
  118. }
  119. .timelines-chevron {
  120. margin-left: 0.8em;
  121. font-size: 1.1em;
  122. }
  123. .timelines-background {
  124. padding: 0 0 0 0.6em;
  125. }
  126. .nav-panel-heading {
  127. // breaks without a unit
  128. // stylelint-disable-next-line length-zero-no-unit
  129. --panel-heading-height-padding: 0px;
  130. }
  131. }
  132. </style>