Skip to content

Commit

Permalink
fix: nav external blank option
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed May 8, 2020
1 parent 98bf0d9 commit cc9f022
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 77 deletions.
11 changes: 5 additions & 6 deletions client/components/admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
v-list-item-avatar(size='24', tile): v-icon mdi-file-document-outline
v-list-item-title {{ $t('admin:pages.title') }}
v-list-item-action(style='min-width:auto;')
v-chip(x-small, :color='darkMode ? `grey darken-3-d4` : `grey lighten-5`')
v-chip(x-small, :color='$vuetify.theme.dark ? `grey darken-3-d4` : `grey lighten-5`')
.caption.grey--text {{ info.pagesTotal }}
v-list-item(to='/tags', v-if='hasPermission([`manage:system`])')
v-list-item-avatar(size='24', tile): v-icon mdi-tag-multiple
v-list-item-title {{ $t('admin:tags.title') }}
v-list-item-action(style='min-width:auto;')
v-chip(x-small, :color='darkMode ? `grey darken-3-d4` : `grey lighten-5`')
v-chip(x-small, :color='$vuetify.theme.dark ? `grey darken-3-d4` : `grey lighten-5`')
.caption.grey--text {{ info.tagsTotal }}
v-list-item(to='/theme', color='primary', v-if='hasPermission([`manage:system`, `manage:theme`])')
v-list-item-avatar(size='24', tile): v-icon mdi-palette-outline
Expand All @@ -45,13 +45,13 @@
v-list-item-avatar(size='24', tile): v-icon mdi-account-group
v-list-item-title {{ $t('admin:groups.title') }}
v-list-item-action(style='min-width:auto;')
v-chip(x-small, :color='darkMode ? `grey darken-3-d4` : `grey lighten-4`')
v-chip(x-small, :color='$vuetify.theme.dark ? `grey darken-3-d4` : `grey lighten-4`')
.caption.grey--text {{ info.groupsTotal }}
v-list-item(to='/users', color='primary', v-if='hasPermission([`manage:system`, `manage:groups`, `write:groups`, `manage:users`, `write:users`])')
v-list-item-avatar(size='24', tile): v-icon mdi-account-box
v-list-item-title {{ $t('admin:users.title') }}
v-list-item-action(style='min-width:auto;')
v-chip(x-small, :color='darkMode ? `grey darken-3-d4` : `grey lighten-4`')
v-chip(x-small, :color='$vuetify.theme.dark ? `grey darken-3-d4` : `grey lighten-4`')
.caption.grey--text {{ info.usersTotal }}
template(v-if='hasPermission(`manage:system`)')
v-divider.my-2
Expand Down Expand Up @@ -123,7 +123,7 @@
v-list-item-avatar(size='24', tile): v-icon mdi-heart-outline
v-list-item-title {{ $t('admin:contribute.title') }}

v-content(:class='darkMode ? "grey darken-5" : "grey lighten-5"')
v-content(:class='$vuetify.theme.dark ? "grey darken-5" : "grey lighten-5"')
transition(name='admin-router')
router-view

Expand Down Expand Up @@ -210,7 +210,6 @@ export default {
}
},
computed: {
darkMode: get('site/dark'),
info: sync('admin/info'),
permissions: get('user/permissions')
},
Expand Down
3 changes: 1 addition & 2 deletions client/components/admin/admin-general.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@

<script>
import _ from 'lodash'
import { get, sync } from 'vuex-pathify'
import { sync } from 'vuex-pathify'
import gql from 'graphql-tag'
import editorStore from '../../store/editor'
Expand Down Expand Up @@ -323,7 +323,6 @@ export default {
}
},
computed: {
darkMode: get('site/dark'),
siteTitle: sync('site/title'),
logoUrl: sync('site/logoUrl'),
company: sync('site/company'),
Expand Down
3 changes: 2 additions & 1 deletion client/components/admin/admin-navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
hide-details
)
v-text-field.mt-4(
v-if='current.targetType === `external`'
v-if='current.targetType === `external` || current.targetType === `externalblank`'
outlined
:label='$t("navigation.target")'
prepend-icon='mdi-near-me'
Expand Down Expand Up @@ -302,6 +302,7 @@ export default {
navTypes () {
return [
{ text: this.$t('navigation.navType.external'), value: 'external' },
{ text: this.$t('navigation.navType.externalblank'), value: 'externalblank' },
{ text: this.$t('navigation.navType.home'), value: 'home' },
{ text: this.$t('navigation.navType.page'), value: 'page' }
// { text: this.$t('navigation.navType.searchQuery'), value: 'search' }
Expand Down
6 changes: 1 addition & 5 deletions client/components/admin/admin-rendering.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
v-list-item(
:key='rdr.key'
@click='selectRenderer(rdr.key)'
:class='currentRenderer.key === rdr.key ? (darkMode ? `grey darken-4-l4` : `blue lighten-5`) : ``'
:class='currentRenderer.key === rdr.key ? ($vuetify.theme.dark ? `grey darken-4-l4` : `blue lighten-5`) : ``'
)
v-list-item-avatar(size='24', tile)
v-icon(:color='currentRenderer.key === rdr.key ? "primary" : "grey"') {{rdr.icon}}
Expand Down Expand Up @@ -126,7 +126,6 @@
<script>
import _ from 'lodash'
import { DepGraph } from 'dependency-graph'
import { get } from 'vuex-pathify'
import { StatusIndicator } from 'vue-status-indicator'
Expand All @@ -144,9 +143,6 @@ export default {
currentRenderer: {}
}
},
computed: {
darkMode: get('site/dark')
},
watch: {
renderers(newValue, oldValue) {
_.delay(() => {
Expand Down
9 changes: 4 additions & 5 deletions client/components/editor/editor-modal-properties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
:hint='$t(`editor:props.shortDescriptionHint`)'
)
v-divider
v-card-text.grey.pt-5(:class='darkMode ? `darken-3-d3` : `lighten-5`')
v-card-text.grey.pt-5(:class='$vuetify.theme.dark ? `darken-3-d3` : `lighten-5`')
.overline.pb-5 {{$t('editor:props.path')}}
v-container.pa-0(fluid, grid-list-lg)
v-layout(row, wrap)
Expand All @@ -65,7 +65,7 @@
@click:append='showPathSelector'
)
v-divider
v-card-text.grey.pt-5(:class='darkMode ? `darken-3-d5` : `lighten-4`')
v-card-text.grey.pt-5(:class='$vuetify.theme.dark ? `darken-3-d5` : `lighten-4`')
.overline.pb-5 {{$t('editor:props.categorization')}}
v-chip-group.radius-5.mb-5(column, v-if='tags && tags.length > 0')
v-chip(
Expand Down Expand Up @@ -101,7 +101,7 @@
inset
)
v-divider
v-card-text.grey.pt-5(:class='darkMode ? `darken-3-d3` : `lighten-5`')
v-card-text.grey.pt-5(:class='$vuetify.theme.dark ? `darken-3-d3` : `lighten-5`')
v-container.pa-0(fluid, grid-list-lg)
v-row
v-col(cols='6')
Expand Down Expand Up @@ -197,7 +197,7 @@
persistent-hint
)
v-divider
v-card-text.grey.pt-5(:class='darkMode ? `darken-3-d3` : `lighten-5`')
v-card-text.grey.pt-5(:class='$vuetify.theme.dark ? `darken-3-d3` : `lighten-5`')
.overline.pb-3 {{$t('editor:props.css')}}
v-textarea(
outlined
Expand Down Expand Up @@ -279,7 +279,6 @@ export default {
get() { return this.value },
set(val) { this.$emit('input', val) }
},
darkMode: get('site/dark'),
mode: get('editor/mode'),
title: sync('page/title'),
description: sync('page/description'),
Expand Down
22 changes: 10 additions & 12 deletions client/components/history.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang='pug'>
v-app(:dark='darkMode').history
v-app(:dark='$vuetify.theme.dark').history
nav-header
v-content
v-toolbar(color='primary', dark)
Expand All @@ -15,8 +15,8 @@
v-chip.my-0.ml-6(
label
small
:color='darkMode ? `grey darken-2` : `grey lighten-2`'
:class='darkMode ? `grey--text text--lighten-2` : `grey--text text--darken-2`'
:color='$vuetify.theme.dark ? `grey darken-2` : `grey lighten-2`'
:class='$vuetify.theme.dark ? `grey--text text--lighten-2` : `grey--text text--darken-2`'
)
span Live
v-timeline(
Expand Down Expand Up @@ -92,14 +92,14 @@
v-else
label
small
:color='darkMode ? `grey darken-2` : `grey lighten-2`'
:class='darkMode ? `grey--text text--lighten-2` : `grey--text text--darken-2`'
:color='$vuetify.theme.dark ? `grey darken-2` : `grey lighten-2`'
:class='$vuetify.theme.dark ? `grey--text text--lighten-2` : `grey--text text--darken-2`'
) End of history trail

v-flex(xs12, md8)
v-card.radius-7(:class='$vuetify.breakpoint.mdAndUp ? `mt-8` : ``')
v-card-text
v-card.grey.radius-7(flat, :class='darkMode ? `darken-2` : `lighten-4`')
v-card.grey.radius-7(flat, :class='$vuetify.theme.dark ? `darken-2` : `lighten-4`')
v-row(no-gutters, align='center')
v-col
v-card-text
Expand Down Expand Up @@ -132,7 +132,6 @@
<script>
import * as Diff2Html from 'diff2html'
import { createPatch } from 'diff'
import { get } from 'vuex-pathify'
import _ from 'lodash'
import gql from 'graphql-tag'
Expand Down Expand Up @@ -224,7 +223,6 @@ export default {
}
},
computed: {
darkMode: get('site/dark'),
fullTrail () {
const liveTrailItem = {
versionId: 0,
Expand Down Expand Up @@ -501,13 +499,13 @@ export default {
trailBgColor (actionType) {
switch (actionType) {
case 'move':
return this.darkMode ? 'purple' : 'purple lighten-5'
return this.$vuetify.theme.dark ? 'purple' : 'purple lighten-5'
case 'initial':
return this.darkMode ? 'teal darken-3' : 'teal lighten-5'
return this.$vuetify.theme.dark ? 'teal darken-3' : 'teal lighten-5'
case 'live':
return this.darkMode ? 'orange darken-3' : 'orange lighten-5'
return this.$vuetify.theme.dark ? 'orange darken-3' : 'orange lighten-5'
default:
return this.darkMode ? 'grey darken-3' : 'grey lighten-4'
return this.$vuetify.theme.dark ? 'grey darken-3' : 'grey lighten-4'
}
}
},
Expand Down
7 changes: 2 additions & 5 deletions client/components/profile.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang='pug'>
v-app(:dark='darkMode').profile
v-app(:dark='$vuetify.theme.dark').profile
nav-header
v-navigation-drawer.pb-0(v-model='profileDrawerShown', app, fixed, clipped, left, permanent)
v-list(dense, nav)
Expand Down Expand Up @@ -34,7 +34,7 @@
<script>
import VueRouter from 'vue-router'
/* global WIKI, siteConfig */
/* global WIKI */
const router = new VueRouter({
mode: 'history',
Expand Down Expand Up @@ -63,9 +63,6 @@ export default {
profileDrawerShown: true
}
},
computed: {
darkMode() { return siteConfig.darkMode }
},
router,
created() {
this.$store.commit('page/SET_MODE', 'profile')
Expand Down
9 changes: 2 additions & 7 deletions client/components/source.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang='pug'>
v-app(:dark='darkMode').source
v-app(:dark='$vuetify.theme.dark').source
nav-header
v-content
v-toolbar(color='primary', dark)
Expand All @@ -17,7 +17,7 @@
v-btn.ml-4(depressed, color='blue darken-1', @click='goLive') {{$t('common:page.returnNormalView')}}
v-card(tile)
v-card-text
v-card.grey.radius-7(flat, :class='darkMode ? `darken-4` : `lighten-4`')
v-card.grey.radius-7(flat, :class='$vuetify.theme.dark ? `darken-4` : `lighten-4`')
v-card-text
pre
code
Expand All @@ -29,8 +29,6 @@
</template>

<script>
import { get } from 'vuex-pathify'
export default {
props: {
pageId: {
Expand All @@ -57,9 +55,6 @@ export default {
data() {
return {}
},
computed: {
darkMode: get('site/dark')
},
created () {
this.$store.commit('page/SET_ID', this.id)
this.$store.commit('page/SET_LOCALE', this.locale)
Expand Down
4 changes: 1 addition & 3 deletions client/components/tags.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang='pug'>
v-app(:dark='darkMode').tags
v-app(:dark='$vuetify.theme.dark').tags
nav-header
v-navigation-drawer.pb-0.elevation-1(app, fixed, clipped, :right='$vuetify.rtl', permanent, width='300')
vue-scroll(:ops='scrollStyle')
Expand Down Expand Up @@ -151,7 +151,6 @@
</template>

<script>
import { get } from 'vuex-pathify'
import VueRouter from 'vue-router'
import _ from 'lodash'
Expand Down Expand Up @@ -209,7 +208,6 @@ export default {
}
},
computed: {
darkMode: get('site/dark'),
tagsGrouped () {
return _.groupBy(this.tags, t => t.title.charAt(0).toUpperCase())
},
Expand Down
14 changes: 8 additions & 6 deletions client/themes/default/components/nav-sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
v-list.py-2(v-if='currentMode === `custom`', dense, :class='color', :dark='dark')
template(v-for='item of items')
v-list-item(
v-if='item.kind === `link`'
:href='item.target'
v-if='item.k === `link`'
:href='item.t'
:target='item.y === `externalblank` ? `_blank` : `_self`'
:rel='item.y === `externalblank` ? `noopener` : ``'
)
v-list-item-avatar(size='24', tile)
v-icon {{ item.icon }}
v-list-item-title {{ item.label }}
v-divider.my-2(v-else-if='item.kind === `divider`')
v-subheader.pl-4(v-else-if='item.kind === `header`') {{ item.label }}
v-icon {{ item.c }}
v-list-item-title {{ item.l }}
v-divider.my-2(v-else-if='item.k === `divider`')
v-subheader.pl-4(v-else-if='item.k === `header`') {{ item.l }}
//-> Browse
v-list.py-2(v-else-if='currentMode === `browse`', dense, :class='color', :dark='dark')
template(v-if='currentParent.id > 0')
Expand Down
Loading

0 comments on commit cc9f022

Please sign in to comment.