2018-02-28 05:54:09 +00:00
|
|
|
<template lang='pug'>
|
2018-09-30 03:30:20 +00:00
|
|
|
v-container(fluid, grid-list-lg)
|
2018-02-28 05:54:09 +00:00
|
|
|
v-layout(row wrap)
|
|
|
|
v-flex(xs12)
|
2018-09-30 03:30:20 +00:00
|
|
|
.admin-header
|
2019-04-07 16:37:33 +00:00
|
|
|
img.animated.fadeInUp(src='/svg/icon-categorize.svg', alt='General', style='width: 80px;')
|
2018-09-30 03:30:20 +00:00
|
|
|
.admin-header-title
|
2019-04-07 16:37:33 +00:00
|
|
|
.headline.primary--text.animated.fadeInLeft {{ $t('admin:general.title') }}
|
|
|
|
.subheading.grey--text.animated.fadeInLeft {{ $t('admin:general.subtitle') }}
|
2018-09-30 03:30:20 +00:00
|
|
|
v-spacer
|
2019-04-07 16:37:33 +00:00
|
|
|
v-btn.animated.fadeInDown(color='success', depressed, @click='save', large)
|
2018-09-30 03:30:20 +00:00
|
|
|
v-icon(left) check
|
|
|
|
span {{$t('common:actions.apply')}}
|
2018-02-28 05:54:09 +00:00
|
|
|
v-form.pt-3
|
|
|
|
v-layout(row wrap)
|
|
|
|
v-flex(lg6 xs12)
|
2018-03-12 04:09:54 +00:00
|
|
|
v-form
|
2019-04-07 16:37:33 +00:00
|
|
|
v-card.wiki-form.animated.fadeInUp
|
2018-03-12 04:09:54 +00:00
|
|
|
v-toolbar(color='primary', dark, dense, flat)
|
|
|
|
v-toolbar-title
|
2018-06-17 21:29:19 +00:00
|
|
|
.subheading {{ $t('admin:general.siteInfo') }}
|
2018-03-12 04:09:54 +00:00
|
|
|
v-subheader General
|
2018-07-30 02:23:33 +00:00
|
|
|
.px-3.pb-3
|
2018-09-30 03:30:20 +00:00
|
|
|
v-text-field(
|
2018-12-24 06:03:10 +00:00
|
|
|
outline
|
|
|
|
label='Site URL'
|
|
|
|
required
|
|
|
|
:counter='255'
|
|
|
|
v-model='config.host'
|
|
|
|
prepend-icon='label_important'
|
|
|
|
hint='Full URL to your wiki, without the trailing slash. (e.g. https://wiki.example.com)'
|
|
|
|
persistent-hint
|
|
|
|
)
|
|
|
|
v-text-field.mt-2(
|
2018-09-30 03:30:20 +00:00
|
|
|
outline
|
|
|
|
label='Site Title'
|
|
|
|
required
|
|
|
|
:counter='50'
|
2018-12-24 06:03:10 +00:00
|
|
|
v-model='config.title'
|
2018-09-30 03:30:20 +00:00
|
|
|
prepend-icon='public'
|
2019-01-07 03:03:34 +00:00
|
|
|
hint='Displayed in the top bar and appended to all pages meta title.'
|
|
|
|
persistent-hint
|
2018-09-30 03:30:20 +00:00
|
|
|
)
|
2018-07-30 02:23:33 +00:00
|
|
|
v-divider
|
2018-03-12 04:09:54 +00:00
|
|
|
v-subheader SEO
|
2018-07-30 02:23:33 +00:00
|
|
|
.px-3.pb-3
|
2018-09-30 03:30:20 +00:00
|
|
|
v-text-field(
|
|
|
|
outline
|
|
|
|
label='Site Description'
|
|
|
|
:counter='255'
|
2018-12-24 06:03:10 +00:00
|
|
|
v-model='config.description'
|
|
|
|
prepend-icon='explore'
|
2019-01-07 03:03:34 +00:00
|
|
|
hint='Default description when none is provided for a page.'
|
|
|
|
persistent-hint
|
2018-09-30 03:30:20 +00:00
|
|
|
)
|
2018-12-24 06:03:10 +00:00
|
|
|
v-select.mt-2(
|
2018-09-30 03:30:20 +00:00
|
|
|
outline
|
|
|
|
label='Meta Robots'
|
2018-12-24 06:03:10 +00:00
|
|
|
multiple
|
2018-09-30 03:30:20 +00:00
|
|
|
:items='metaRobots'
|
2018-12-24 06:03:10 +00:00
|
|
|
v-model='config.robots'
|
|
|
|
prepend-icon='explore'
|
|
|
|
:return-object='false'
|
2019-01-07 03:03:34 +00:00
|
|
|
hint='Default: Index, Follow. Can also be set on a per-page basis.'
|
2018-12-24 06:03:10 +00:00
|
|
|
persistent-hint
|
2018-09-30 03:30:20 +00:00
|
|
|
)
|
2018-07-30 02:23:33 +00:00
|
|
|
v-divider
|
2019-01-01 22:03:30 +00:00
|
|
|
v-subheader Analytics #[v-chip.ml-2(label, color='grey', small, outline) coming soon]
|
2018-07-30 02:23:33 +00:00
|
|
|
.px-3.pb-3
|
2019-01-01 22:03:30 +00:00
|
|
|
v-select.mt-2(
|
|
|
|
outline
|
|
|
|
label='Analytics Service Provider'
|
|
|
|
:items='analyticsServices'
|
|
|
|
v-model='config.analyticsService'
|
|
|
|
prepend-icon='timeline'
|
2019-01-07 03:03:34 +00:00
|
|
|
persistent-hint
|
|
|
|
hint='Automatically add tracking code for services like Google Analytics.'
|
2019-01-01 22:03:30 +00:00
|
|
|
)
|
|
|
|
v-text-field.mt-2(
|
|
|
|
v-if='config.analyticsService !== ``'
|
2018-09-30 03:30:20 +00:00
|
|
|
outline
|
2019-01-01 22:03:30 +00:00
|
|
|
label='Property Tracking ID'
|
2018-07-30 02:23:33 +00:00
|
|
|
:counter='255'
|
2019-01-01 22:03:30 +00:00
|
|
|
v-model='config.analyticsId'
|
2018-12-15 22:15:13 +00:00
|
|
|
prepend-icon='timeline'
|
2018-07-30 02:23:33 +00:00
|
|
|
persistent-hint
|
2019-01-01 22:03:30 +00:00
|
|
|
hint='A unique identifier provided by your analytics service provider.'
|
2018-07-30 02:23:33 +00:00
|
|
|
)
|
2018-02-28 05:54:09 +00:00
|
|
|
v-flex(lg6 xs12)
|
2019-04-07 16:37:33 +00:00
|
|
|
v-card.wiki-form.animated.fadeInUp.wait-p2s
|
2018-03-12 04:09:54 +00:00
|
|
|
v-toolbar(color='primary', dark, dense, flat)
|
2018-02-28 05:54:09 +00:00
|
|
|
v-toolbar-title
|
2018-06-17 21:29:19 +00:00
|
|
|
.subheading {{ $t('admin:general.siteBranding') }}
|
2019-01-01 22:03:30 +00:00
|
|
|
v-subheader Logo #[v-chip.ml-2(label, color='grey', small, outline) coming soon]
|
2018-05-12 20:13:04 +00:00
|
|
|
v-card-text
|
2018-12-24 06:03:10 +00:00
|
|
|
v-layout.px-3(row, align-center)
|
2018-12-30 03:12:52 +00:00
|
|
|
v-avatar(size='120', :color='$vuetify.dark ? `grey darken-2` : `grey lighten-3`', :tile='config.logoIsSquare')
|
2018-06-17 21:29:19 +00:00
|
|
|
.ml-4
|
2019-01-01 22:03:30 +00:00
|
|
|
v-btn.mx-0(color='teal', depressed, disabled)
|
|
|
|
v-icon(left) cloud_upload
|
|
|
|
span Upload Logo
|
|
|
|
v-btn(color='teal', depressed, disabled)
|
|
|
|
v-icon(left) clear
|
|
|
|
span Clear
|
2018-06-17 21:29:19 +00:00
|
|
|
.caption.grey--text An image of 120x120 pixels is recommended for best results.
|
|
|
|
.caption.grey--text SVG, PNG or JPG files only.
|
|
|
|
v-switch(
|
2018-12-24 06:03:10 +00:00
|
|
|
v-model='config.logoIsSquare'
|
2018-06-17 21:29:19 +00:00
|
|
|
label='Use Square Logo Frame'
|
|
|
|
color='primary'
|
|
|
|
persistent-hint
|
|
|
|
hint='Check this option if a round logo frame doesn\'t work with your logo.'
|
|
|
|
)
|
2018-12-24 06:03:10 +00:00
|
|
|
v-divider
|
|
|
|
v-subheader Footer Copyright
|
|
|
|
.px-3.pb-3
|
|
|
|
v-text-field(
|
|
|
|
outline
|
|
|
|
label='Company / Organization Name'
|
|
|
|
v-model='config.company'
|
|
|
|
:counter='255'
|
|
|
|
prepend-icon='business'
|
2018-06-17 21:29:19 +00:00
|
|
|
persistent-hint
|
2018-12-24 06:03:10 +00:00
|
|
|
hint='Name to use when displaying copyright notice in the footer. Leave empty to hide.'
|
2018-06-17 21:29:19 +00:00
|
|
|
)
|
2018-09-04 04:46:24 +00:00
|
|
|
|
2019-04-07 16:37:33 +00:00
|
|
|
v-card.wiki-form.mt-3.animated.fadeInUp.wait-p4s
|
2018-09-04 04:46:24 +00:00
|
|
|
v-toolbar(color='primary', dark, dense, flat)
|
|
|
|
v-toolbar-title
|
|
|
|
.subheading Features
|
2019-01-01 22:03:30 +00:00
|
|
|
v-spacer
|
|
|
|
v-chip(label, color='white', small).primary--text coming soon
|
2018-09-04 04:46:24 +00:00
|
|
|
v-card-text
|
|
|
|
v-switch(
|
|
|
|
label='Page Ratings'
|
|
|
|
color='primary'
|
2018-12-24 06:03:10 +00:00
|
|
|
v-model='config.featurePageRatings'
|
2018-09-04 04:46:24 +00:00
|
|
|
persistent-hint
|
|
|
|
hint='Allow users to rate pages.'
|
|
|
|
)
|
|
|
|
v-divider.mt-3
|
|
|
|
v-switch(
|
2018-12-24 06:03:10 +00:00
|
|
|
label='Page Comments'
|
|
|
|
color='primary'
|
|
|
|
v-model='config.featurePageComments'
|
|
|
|
persistent-hint
|
|
|
|
hint='Allow users to leave comments on pages.'
|
|
|
|
)
|
|
|
|
v-divider.mt-3
|
|
|
|
v-switch(
|
2018-09-04 04:46:24 +00:00
|
|
|
label='Personal Wikis'
|
|
|
|
color='primary'
|
2018-12-24 06:03:10 +00:00
|
|
|
v-model='config.featurePersonalWikis'
|
2018-09-04 04:46:24 +00:00
|
|
|
persistent-hint
|
|
|
|
hint='Allow users to have their own personal wiki.'
|
|
|
|
)
|
2018-02-28 05:54:09 +00:00
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-12-24 06:03:10 +00:00
|
|
|
import _ from 'lodash'
|
2018-12-03 02:42:43 +00:00
|
|
|
import { get, sync } from 'vuex-pathify'
|
2018-12-24 06:03:10 +00:00
|
|
|
import siteConfigQuery from 'gql/admin/site/site-query-config.gql'
|
|
|
|
import siteUpdateConfigMutation from 'gql/admin/site/site-mutation-save-config.gql'
|
2018-08-04 21:27:55 +00:00
|
|
|
|
2018-02-28 05:54:09 +00:00
|
|
|
export default {
|
|
|
|
data() {
|
2018-03-03 06:32:58 +00:00
|
|
|
return {
|
2019-01-01 22:03:30 +00:00
|
|
|
analyticsServices: [
|
|
|
|
{ text: 'None', value: '' },
|
|
|
|
{ text: 'Google Analytics', value: 'ga' },
|
2019-04-07 16:37:33 +00:00
|
|
|
{ text: 'Google Tag Manager', value: 'gtm' }
|
2019-01-01 22:03:30 +00:00
|
|
|
],
|
2018-12-24 06:03:10 +00:00
|
|
|
metaRobots: [
|
|
|
|
{ text: 'Index', value: 'index' },
|
|
|
|
{ text: 'Follow', value: 'follow' },
|
|
|
|
{ text: 'No Index', value: 'noindex' },
|
|
|
|
{ text: 'No Follow', value: 'nofollow' }
|
|
|
|
],
|
|
|
|
config: {
|
|
|
|
host: '',
|
|
|
|
title: '',
|
|
|
|
description: '',
|
|
|
|
robots: [],
|
2019-01-01 22:03:30 +00:00
|
|
|
analyticsService: '',
|
|
|
|
analyticsId: '',
|
2018-12-24 06:03:10 +00:00
|
|
|
company: '',
|
|
|
|
hasLogo: false,
|
|
|
|
logoIsSquare: false,
|
|
|
|
featurePageRatings: false,
|
|
|
|
featurePageComments: false,
|
|
|
|
featurePersonalWikis: false
|
|
|
|
}
|
2018-03-03 06:32:58 +00:00
|
|
|
}
|
2018-08-04 21:27:55 +00:00
|
|
|
},
|
|
|
|
computed: {
|
2018-12-03 02:42:43 +00:00
|
|
|
darkMode: get('site/dark'),
|
2018-08-04 21:27:55 +00:00
|
|
|
siteTitle: sync('site/title'),
|
|
|
|
company: sync('site/company')
|
2018-09-04 04:46:24 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async save () {
|
2018-12-24 06:03:10 +00:00
|
|
|
try {
|
|
|
|
await this.$apollo.mutate({
|
|
|
|
mutation: siteUpdateConfigMutation,
|
|
|
|
variables: {
|
|
|
|
host: this.config.host || '',
|
|
|
|
title: this.config.title || '',
|
|
|
|
description: this.config.description || '',
|
|
|
|
robots: this.config.robots || [],
|
2019-01-01 22:03:30 +00:00
|
|
|
analyticsService: this.config.analyticsService || '',
|
|
|
|
analyticsId: this.config.analyticsId || '',
|
2018-12-24 06:03:10 +00:00
|
|
|
company: this.config.company || '',
|
|
|
|
hasLogo: this.config.hasLogo || false,
|
|
|
|
logoIsSquare: this.config.logoIsSquare || false,
|
|
|
|
featurePageRatings: this.config.featurePageRatings || false,
|
|
|
|
featurePageComments: this.config.featurePageComments || false,
|
|
|
|
featurePersonalWikis: this.config.featurePersonalWikis || false
|
|
|
|
},
|
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-site-update')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.$store.commit('showNotification', {
|
|
|
|
style: 'success',
|
|
|
|
message: 'Configuration saved successfully.',
|
|
|
|
icon: 'check'
|
|
|
|
})
|
|
|
|
this.siteTitle = this.config.title
|
|
|
|
this.company = this.config.company
|
|
|
|
} catch (err) {
|
2019-01-13 03:33:30 +00:00
|
|
|
this.$store.commit('pushGraphError', err)
|
2018-12-24 06:03:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
apollo: {
|
|
|
|
config: {
|
|
|
|
query: siteConfigQuery,
|
|
|
|
fetchPolicy: 'network-only',
|
|
|
|
update: (data) => _.cloneDeep(data.site.config),
|
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-site-refresh')
|
|
|
|
}
|
2018-09-04 04:46:24 +00:00
|
|
|
}
|
2018-02-28 05:54:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang='scss'>
|
|
|
|
|
|
|
|
</style>
|