You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
4.0 KiB

  1. <template lang='pug'>
  2. v-toolbar(color='black', dark, app, clipped-left, fixed, flat, dense)
  3. v-menu(open-on-hover, offset-y, bottom, left, nudge-top='-18', min-width='250')
  4. v-toolbar-side-icon(slot='activator')
  5. v-icon view_module
  6. v-list(dense).py-0
  7. v-list-tile(avatar, href='/')
  8. v-list-tile-avatar: v-icon(color='blue') home
  9. v-list-tile-content Home
  10. v-list-tile(avatar, @click='')
  11. v-list-tile-avatar: v-icon(color='green') add_box
  12. v-list-tile-content New Page
  13. v-divider.my-0
  14. v-subheader Current Page
  15. v-list-tile(avatar, @click='')
  16. v-list-tile-avatar: v-icon(color='indigo') edit
  17. v-list-tile-content Edit
  18. v-list-tile(avatar, @click='')
  19. v-list-tile-avatar: v-icon(color='indigo') history
  20. v-list-tile-content History
  21. v-list-tile(avatar, @click='')
  22. v-list-tile-avatar: v-icon(color='indigo') code
  23. v-list-tile-content View Source
  24. v-list-tile(avatar, @click='')
  25. v-list-tile-avatar: v-icon(color='indigo') forward
  26. v-list-tile-content Move / Rename
  27. v-list-tile(avatar, @click='')
  28. v-list-tile-avatar: v-icon(color='red darken-2') delete
  29. v-list-tile-content Delete
  30. v-divider.my-0
  31. v-subheader Assets
  32. v-list-tile(avatar, @click='')
  33. v-list-tile-avatar: v-icon(color='blue-grey') burst_mode
  34. v-list-tile-content Images &amp; Files
  35. v-toolbar-title
  36. span.subheading {{title}}
  37. v-spacer
  38. transition(name='navHeaderSearch')
  39. v-text-field(
  40. ref='searchField',
  41. v-if='searchIsShown',
  42. v-model='search',
  43. clearable,
  44. color='blue',
  45. label='Search...',
  46. single-line,
  47. hide-details,
  48. append-icon='search',
  49. :append-icon-cb='searchEnter',
  50. :loading='searchIsLoading',
  51. @keyup.enter='searchEnter',
  52. @keyup.esc='searchToggle'
  53. )
  54. v-progress-linear(
  55. indeterminate,
  56. slot='progress',
  57. height='2',
  58. color='blue'
  59. )
  60. v-spacer
  61. v-progress-circular.mr-3(indeterminate, color='blue', :size='22', :width='2' v-show='isLoading')
  62. slot(name='actions')
  63. transition(name='navHeaderSearch')
  64. v-btn(icon, @click='searchToggle', v-if='!searchIsShown')
  65. v-icon(color='grey') search
  66. v-btn(icon, href='/a')
  67. v-icon(color='grey') settings
  68. v-menu(offset-y, min-width='300')
  69. v-btn(icon, slot='activator')
  70. v-icon(color='grey') account_circle
  71. v-list.py-0
  72. v-list-tile.py-3(avatar)
  73. v-list-tile-avatar
  74. v-avatar.red(:size='40'): span.white--text.subheading JD
  75. v-list-tile-content
  76. v-list-tile-title John Doe
  77. v-list-tile-sub-title john.doe@example.com
  78. v-divider.my-0
  79. v-list-tile(href='/p')
  80. v-list-tile-action: v-icon(color='red') person
  81. v-list-tile-title Profile
  82. v-list-tile(href='/logout')
  83. v-list-tile-action: v-icon(color='red') exit_to_app
  84. v-list-tile-title Logout
  85. </template>
  86. <script>
  87. import { mapGetters } from 'vuex'
  88. /* global siteConfig */
  89. export default {
  90. data() {
  91. return {
  92. menuIsShown: true,
  93. searchIsLoading: false,
  94. searchIsShown: false,
  95. search: ''
  96. }
  97. },
  98. computed: {
  99. ...mapGetters(['isLoading']),
  100. title() { return siteConfig.title }
  101. },
  102. methods: {
  103. searchToggle() {
  104. this.searchIsLoading = false
  105. this.searchIsShown = !this.searchIsShown
  106. if (this.searchIsShown) {
  107. this.$nextTick(() => {
  108. this.$refs.searchField.focus()
  109. })
  110. }
  111. },
  112. searchEnter() {
  113. this.searchIsLoading = true
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang='scss'>
  119. .navHeaderSearch {
  120. &-enter-active, &-leave-active {
  121. transition: opacity .25s ease, transform .25s ease;
  122. opacity: 1;
  123. }
  124. &-enter-active {
  125. transition-delay: .25s;
  126. }
  127. &-enter, &-leave-to {
  128. opacity: 0;
  129. transform: translateY(-25px);
  130. }
  131. }
  132. </style>