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.

102 lines
2.8 KiB

  1. <template lang='pug'>
  2. v-app(:dark='darkMode').profile
  3. nav-header
  4. v-navigation-drawer.pb-0(v-model='profileDrawerShown', app, fixed, clipped, left, permanent)
  5. v-list(dense, nav)
  6. v-list-item(to='/profile', color='primary')
  7. v-list-item-action: v-icon mdi-face-profile
  8. v-list-item-content
  9. v-list-item-title {{$t('profile:title')}}
  10. //- v-list-item(to='/preferences', disabled)
  11. //- v-list-item-action: v-icon(color='grey lighten-1') mdi-cog-outline
  12. //- v-list-item-content
  13. //- v-list-item-title Preferences
  14. //- v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon
  15. v-list-item(to='/pages', color='primary')
  16. v-list-item-action: v-icon mdi-file-document-outline
  17. v-list-item-content
  18. v-list-item-title {{$t('profile:pages.title')}}
  19. //- v-list-item(to='/comments', disabled)
  20. //- v-list-item-action: v-icon(color='grey lighten-1') mdi-message-reply-text
  21. //- v-list-item-content
  22. //- v-list-item-title {{$t('profile:comments.title')}}
  23. //- v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon
  24. v-content(:class='darkMode ? "grey darken-4" : "grey lighten-5"')
  25. transition(name='profile-router')
  26. router-view
  27. nav-footer
  28. notify
  29. search-results
  30. </template>
  31. <script>
  32. import VueRouter from 'vue-router'
  33. /* global WIKI, siteConfig */
  34. const router = new VueRouter({
  35. mode: 'history',
  36. base: '/p',
  37. routes: [
  38. { path: '/', redirect: '/profile' },
  39. { path: '/profile', component: () => import(/* webpackChunkName: "profile" */ './profile/profile.vue') },
  40. // { path: '/preferences', component: () => import(/* webpackChunkName: "profile" */ './profile/preferences.vue') },
  41. { path: '/pages', component: () => import(/* webpackChunkName: "profile" */ './profile/pages.vue') },
  42. { path: '/comments', component: () => import(/* webpackChunkName: "profile" */ './profile/comments.vue') }
  43. ]
  44. })
  45. router.beforeEach((to, from, next) => {
  46. WIKI.$store.commit('loadingStart', 'profile')
  47. next()
  48. })
  49. router.afterEach((to, from) => {
  50. WIKI.$store.commit('loadingStop', 'profile')
  51. })
  52. export default {
  53. i18nOptions: { namespaces: 'profile' },
  54. data() {
  55. return {
  56. profileDrawerShown: true
  57. }
  58. },
  59. computed: {
  60. darkMode() { return siteConfig.darkMode }
  61. },
  62. router,
  63. created() {
  64. this.$store.commit('page/SET_MODE', 'profile')
  65. }
  66. }
  67. </script>
  68. <style lang='scss'>
  69. .profile-router {
  70. &-enter-active, &-leave-active {
  71. transition: opacity .25s ease;
  72. opacity: 1;
  73. }
  74. &-enter-active {
  75. transition-delay: .25s;
  76. }
  77. &-enter, &-leave-to {
  78. opacity: 0;
  79. }
  80. }
  81. .profile-header {
  82. display: flex;
  83. justify-content: flex-start;
  84. align-items: center;
  85. &-title {
  86. margin-left: 1rem;
  87. }
  88. }
  89. </style>