2018-03-03 06:32:58 +00:00
|
|
|
<template lang='pug'>
|
2018-08-13 04:12:44 +00:00
|
|
|
v-toolbar.nav-header(color='black', dark, app, clipped-left, fixed, flat, :extended='searchIsShown && $vuetify.breakpoint.smAndDown')
|
|
|
|
v-toolbar(color='deep-purple', flat, slot='extension', v-if='searchIsShown && $vuetify.breakpoint.smAndDown')
|
|
|
|
v-text-field(
|
|
|
|
ref='searchFieldMobile',
|
|
|
|
v-model='search',
|
|
|
|
clearable,
|
|
|
|
background-color='deep-purple'
|
|
|
|
color='white',
|
|
|
|
label='Search...',
|
|
|
|
single-line,
|
|
|
|
solo
|
|
|
|
flat
|
|
|
|
hide-details,
|
|
|
|
prepend-inner-icon='search',
|
|
|
|
:loading='searchIsLoading',
|
|
|
|
@keyup.enter='searchEnter'
|
|
|
|
)
|
2018-08-09 04:07:15 +00:00
|
|
|
v-menu(open-on-hover, offset-y, bottom, left, min-width='250')
|
2018-11-11 04:40:55 +00:00
|
|
|
v-toolbar-side-icon.btn-animate-app(slot='activator')
|
2018-03-19 03:12:56 +00:00
|
|
|
v-icon view_module
|
2018-09-09 00:57:37 +00:00
|
|
|
v-list(dense, :light='!$vuetify.dark').py-0
|
2018-03-19 03:12:56 +00:00
|
|
|
v-list-tile(avatar, href='/')
|
|
|
|
v-list-tile-avatar: v-icon(color='blue') home
|
|
|
|
v-list-tile-content Home
|
2018-08-09 04:07:15 +00:00
|
|
|
v-list-tile(avatar, @click='pageNew')
|
2018-03-19 03:12:56 +00:00
|
|
|
v-list-tile-avatar: v-icon(color='green') add_box
|
|
|
|
v-list-tile-content New Page
|
2018-11-19 06:08:55 +00:00
|
|
|
template(v-if='path && path.length')
|
|
|
|
v-divider.my-0
|
|
|
|
v-subheader Current Page
|
|
|
|
v-list-tile(avatar, @click='pageView', v-if='mode !== `view`')
|
|
|
|
v-list-tile-avatar: v-icon(color='indigo') subject
|
|
|
|
v-list-tile-content View
|
|
|
|
v-list-tile(avatar, @click='pageEdit', v-if='mode !== `edit`')
|
|
|
|
v-list-tile-avatar: v-icon(color='indigo') edit
|
|
|
|
v-list-tile-content Edit
|
|
|
|
v-list-tile(avatar, @click='pageHistory', v-if='mode !== `history`')
|
|
|
|
v-list-tile-avatar: v-icon(color='indigo') history
|
|
|
|
v-list-tile-content History
|
|
|
|
v-list-tile(avatar, @click='pageSource', v-if='mode !== `source`')
|
|
|
|
v-list-tile-avatar: v-icon(color='indigo') code
|
|
|
|
v-list-tile-content View Source
|
|
|
|
v-list-tile(avatar, @click='pageMove')
|
|
|
|
v-list-tile-avatar: v-icon(color='indigo') forward
|
|
|
|
v-list-tile-content Move / Rename
|
|
|
|
v-list-tile(avatar, @click='pageDelete')
|
|
|
|
v-list-tile-avatar: v-icon(color='red darken-2') delete
|
|
|
|
v-list-tile-content Delete
|
2018-03-19 03:12:56 +00:00
|
|
|
v-divider.my-0
|
|
|
|
v-subheader Assets
|
|
|
|
v-list-tile(avatar, @click='')
|
|
|
|
v-list-tile-avatar: v-icon(color='blue-grey') burst_mode
|
2018-05-20 22:50:51 +00:00
|
|
|
v-list-tile-content Images & Files
|
2018-08-13 04:12:44 +00:00
|
|
|
v-toolbar-title(:class='{ "ml-2": $vuetify.breakpoint.mdAndUp, "ml-0": $vuetify.breakpoint.smAndDown }')
|
2018-06-11 03:23:09 +00:00
|
|
|
span.subheading {{title}}
|
2018-08-13 04:12:44 +00:00
|
|
|
v-spacer(v-if='searchIsShown && $vuetify.breakpoint.mdAndUp')
|
2018-03-12 04:09:54 +00:00
|
|
|
transition(name='navHeaderSearch')
|
|
|
|
v-text-field(
|
|
|
|
ref='searchField',
|
2018-08-11 01:00:20 +00:00
|
|
|
v-if='searchIsShown && $vuetify.breakpoint.mdAndUp',
|
2018-03-12 04:09:54 +00:00
|
|
|
v-model='search',
|
|
|
|
clearable,
|
2018-07-30 02:23:33 +00:00
|
|
|
color='white',
|
2018-03-12 04:09:54 +00:00
|
|
|
label='Search...',
|
|
|
|
single-line,
|
2018-07-30 02:23:33 +00:00
|
|
|
solo
|
|
|
|
flat
|
2018-03-12 04:09:54 +00:00
|
|
|
hide-details,
|
2018-07-30 02:23:33 +00:00
|
|
|
prepend-inner-icon='search',
|
2018-03-12 04:09:54 +00:00
|
|
|
:loading='searchIsLoading',
|
2018-07-30 02:23:33 +00:00
|
|
|
@keyup.enter='searchEnter'
|
2018-03-12 04:09:54 +00:00
|
|
|
)
|
|
|
|
v-progress-linear(
|
|
|
|
indeterminate,
|
|
|
|
slot='progress',
|
|
|
|
height='2',
|
|
|
|
color='blue'
|
|
|
|
)
|
|
|
|
v-spacer
|
2018-07-30 02:23:33 +00:00
|
|
|
.navHeaderLoading.mr-3
|
|
|
|
v-progress-circular(indeterminate, color='blue', :size='22', :width='2' v-show='isLoading')
|
2018-03-19 03:12:56 +00:00
|
|
|
slot(name='actions')
|
2018-08-13 04:12:44 +00:00
|
|
|
v-btn(
|
|
|
|
v-if='!hideSearch && $vuetify.breakpoint.smAndDown'
|
|
|
|
@click='searchToggle'
|
|
|
|
icon
|
|
|
|
)
|
2018-08-11 01:00:20 +00:00
|
|
|
v-icon(color='grey') search
|
2018-08-09 04:07:15 +00:00
|
|
|
v-tooltip(bottom)
|
2018-11-11 04:40:55 +00:00
|
|
|
v-btn.btn-animate-rotate(icon, href='/a', slot='activator')
|
2018-08-09 04:07:15 +00:00
|
|
|
v-icon(color='grey') settings
|
|
|
|
span Admin
|
2018-03-03 06:32:58 +00:00
|
|
|
v-menu(offset-y, min-width='300')
|
2018-08-09 04:07:15 +00:00
|
|
|
v-tooltip(bottom, slot='activator')
|
2018-11-11 04:40:55 +00:00
|
|
|
v-btn.btn-animate-grow(icon, slot='activator', outline, color='grey darken-3')
|
2018-08-09 04:07:15 +00:00
|
|
|
v-icon(color='grey') account_circle
|
|
|
|
span Account
|
2018-09-10 00:33:10 +00:00
|
|
|
v-list.py-0(:light='!$vuetify.dark')
|
2018-03-03 06:32:58 +00:00
|
|
|
v-list-tile.py-3(avatar)
|
|
|
|
v-list-tile-avatar
|
|
|
|
v-avatar.red(:size='40'): span.white--text.subheading JD
|
|
|
|
v-list-tile-content
|
|
|
|
v-list-tile-title John Doe
|
|
|
|
v-list-tile-sub-title john.doe@example.com
|
|
|
|
v-divider.my-0
|
2018-03-12 04:09:54 +00:00
|
|
|
v-list-tile(href='/p')
|
|
|
|
v-list-tile-action: v-icon(color='red') person
|
|
|
|
v-list-tile-title Profile
|
2018-10-08 04:17:31 +00:00
|
|
|
v-list-tile(@click='logout')
|
2018-03-03 06:32:58 +00:00
|
|
|
v-list-tile-action: v-icon(color='red') exit_to_app
|
|
|
|
v-list-tile-title Logout
|
2018-11-12 05:51:34 +00:00
|
|
|
|
|
|
|
page-selector(mode='create', v-model='newPageModal')
|
2018-03-03 06:32:58 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-08-04 21:27:55 +00:00
|
|
|
import { get } from 'vuex-pathify'
|
2018-08-13 04:12:44 +00:00
|
|
|
import _ from 'lodash'
|
2018-10-08 04:17:31 +00:00
|
|
|
import Cookies from 'js-cookie'
|
2018-06-11 03:23:09 +00:00
|
|
|
|
2018-03-03 06:32:58 +00:00
|
|
|
export default {
|
2018-07-30 02:23:33 +00:00
|
|
|
props: {
|
|
|
|
dense: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
hideSearch: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
}
|
|
|
|
},
|
2018-03-06 04:13:20 +00:00
|
|
|
data() {
|
2018-03-12 04:09:54 +00:00
|
|
|
return {
|
2018-03-19 03:12:56 +00:00
|
|
|
menuIsShown: true,
|
2018-03-12 04:09:54 +00:00
|
|
|
searchIsLoading: false,
|
2018-07-30 02:23:33 +00:00
|
|
|
searchIsShown: true,
|
2018-11-12 05:51:34 +00:00
|
|
|
search: '',
|
|
|
|
newPageModal: false
|
2018-03-12 04:09:54 +00:00
|
|
|
}
|
|
|
|
},
|
2018-03-25 02:35:47 +00:00
|
|
|
computed: {
|
2018-08-04 21:27:55 +00:00
|
|
|
isLoading: get('isLoading'),
|
2018-10-29 02:09:58 +00:00
|
|
|
title: get('site/title'),
|
2018-11-19 06:08:55 +00:00
|
|
|
path: get('page/path'),
|
|
|
|
mode: get('page/mode')
|
2018-03-25 02:35:47 +00:00
|
|
|
},
|
2018-07-30 02:23:33 +00:00
|
|
|
created() {
|
2018-08-13 04:12:44 +00:00
|
|
|
if (this.hideSearch || this.dense || this.$vuetify.breakpoint.smAndDown) {
|
2018-07-30 02:23:33 +00:00
|
|
|
this.searchIsShown = false
|
|
|
|
}
|
|
|
|
},
|
2018-03-12 04:09:54 +00:00
|
|
|
methods: {
|
2018-08-13 04:12:44 +00:00
|
|
|
searchToggle() {
|
|
|
|
this.searchIsShown = !this.searchIsShown
|
|
|
|
if (this.searchIsShown) {
|
|
|
|
_.delay(() => {
|
|
|
|
this.$refs.searchFieldMobile.focus()
|
|
|
|
}, 200)
|
|
|
|
}
|
|
|
|
},
|
2018-03-12 04:09:54 +00:00
|
|
|
searchEnter() {
|
|
|
|
this.searchIsLoading = true
|
2018-08-09 04:07:15 +00:00
|
|
|
},
|
|
|
|
pageNew () {
|
2018-11-12 05:51:34 +00:00
|
|
|
this.newPageModal = true
|
2018-08-09 04:07:15 +00:00
|
|
|
},
|
2018-11-19 06:08:55 +00:00
|
|
|
pageView () {
|
|
|
|
window.location.assign(`/${this.path}`)
|
|
|
|
},
|
2018-08-09 04:07:15 +00:00
|
|
|
pageEdit () {
|
2018-10-29 02:09:58 +00:00
|
|
|
window.location.assign(`/e/${this.path}`)
|
2018-08-09 04:07:15 +00:00
|
|
|
},
|
|
|
|
pageHistory () {
|
2018-10-29 02:09:58 +00:00
|
|
|
window.location.assign(`/h/${this.path}`)
|
2018-08-09 04:07:15 +00:00
|
|
|
},
|
|
|
|
pageSource () {
|
2018-11-19 06:08:55 +00:00
|
|
|
window.location.assign(`/s/${this.path}`)
|
2018-08-09 04:07:15 +00:00
|
|
|
},
|
|
|
|
pageMove () {
|
|
|
|
|
|
|
|
},
|
|
|
|
pageDelete () {
|
|
|
|
|
2018-10-08 04:17:31 +00:00
|
|
|
},
|
|
|
|
logout () {
|
|
|
|
Cookies.remove('jwt')
|
|
|
|
window.location.assign('/')
|
2018-03-12 04:09:54 +00:00
|
|
|
}
|
2018-03-06 04:13:20 +00:00
|
|
|
}
|
2018-03-03 06:32:58 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2018-03-12 04:09:54 +00:00
|
|
|
<style lang='scss'>
|
2018-08-13 04:12:44 +00:00
|
|
|
|
|
|
|
.nav-header {
|
|
|
|
.v-toolbar__extension {
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
.v-toolbar__content {
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
.v-text-field .v-input__prepend-inner {
|
|
|
|
padding: 0 14px 0 5px;
|
|
|
|
padding-right: 14px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-12 04:09:54 +00:00
|
|
|
.navHeaderSearch {
|
|
|
|
&-enter-active, &-leave-active {
|
|
|
|
transition: opacity .25s ease, transform .25s ease;
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
&-enter-active {
|
|
|
|
transition-delay: .25s;
|
|
|
|
}
|
|
|
|
&-enter, &-leave-to {
|
|
|
|
opacity: 0;
|
2018-07-30 02:23:33 +00:00
|
|
|
transform: scale(.7, .7);
|
2018-03-12 04:09:54 +00:00
|
|
|
}
|
|
|
|
}
|
2018-07-30 02:23:33 +00:00
|
|
|
.navHeaderLoading { // To avoid search bar jumping
|
|
|
|
width: 22px;
|
|
|
|
}
|
2018-11-11 04:40:55 +00:00
|
|
|
|
2018-03-03 06:32:58 +00:00
|
|
|
</style>
|