feat: view version of page source
This commit is contained in:
@@ -3,11 +3,17 @@
|
||||
nav-header
|
||||
v-content
|
||||
v-toolbar(color='primary', dark)
|
||||
i18next.subheading(path='common:page.viewingSource', tag='div')
|
||||
i18next.subheading(v-if='versionId > 0', path='common:page.viewingSourceVersion', tag='div')
|
||||
strong(place='date', :title='$options.filters.moment(versionDate, `LLL`)') {{versionDate | moment('lll')}}
|
||||
strong(place='path') /{{path}}
|
||||
i18next.subheading(v-else, path='common:page.viewingSource', tag='div')
|
||||
strong(place='path') /{{path}}
|
||||
template(v-if='$vuetify.breakpoint.mdAndUp')
|
||||
v-spacer
|
||||
.caption.blue--text.text--lighten-3 {{$t('common:page.id', { id: pageId })}}
|
||||
.caption.blue--text.text--lighten-3.ml-4(v-if='versionId > 0') {{$t('common:page.versionId', { id: versionId })}}
|
||||
v-btn.ml-4(v-if='versionId > 0', depressed, color='blue darken-1', @click='goHistory')
|
||||
v-icon mdi-history
|
||||
v-btn.ml-4(depressed, color='blue darken-1', @click='goLive') {{$t('common:page.returnNormalView')}}
|
||||
v-card(tile)
|
||||
v-card-text
|
||||
@@ -38,6 +44,14 @@ export default {
|
||||
path: {
|
||||
type: String,
|
||||
default: 'home'
|
||||
},
|
||||
versionId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
versionDate: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -55,7 +69,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
goLive() {
|
||||
window.location.assign(`/${this.path}`)
|
||||
window.location.assign(`/${this.locale}/${this.path}`)
|
||||
},
|
||||
goHistory () {
|
||||
window.location.assign(`/h/${this.locale}/${this.path}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user