mirror of https://github.com/Requarks/wiki.git
17 changed files with 374 additions and 81 deletions
Unified View
Diff Options
-
1client/client-app.js
-
12client/components/common/page-selector.vue
-
221client/components/history.vue
-
76client/components/source.vue
-
13client/graph/history/history-trail-query.gql
-
1client/scss/app.scss
-
2client/scss/base/base.scss
-
16client/themes/default/scss/app.scss
-
1package.json
-
22server/controllers/common.js
-
6server/graph/resolvers/page.js
-
15server/graph/schemas/page.graphql
-
50server/models/pageHistory.js
-
3server/models/pages.js
-
3server/views/history.pug
-
11server/views/source.pug
-
2yarn.lock
@ -0,0 +1,76 @@ |
|||||
|
<template lang='pug'> |
||||
|
v-app(:dark='darkMode').source |
||||
|
nav-header |
||||
|
v-content |
||||
|
v-toolbar(color='primary', dark) |
||||
|
.subheading Viewing source of page #[strong /{{path}}] |
||||
|
v-spacer |
||||
|
.caption.blue--text.text--lighten-3 ID {{pageId}} |
||||
|
v-btn.ml-4(depressed, color='blue darken-1', @click='goLive') Return to Normal View |
||||
|
v-card(tile) |
||||
|
v-card-text |
||||
|
v-card.grey.lighten-4.radius-7(flat) |
||||
|
v-card-text |
||||
|
pre |
||||
|
code |
||||
|
slot |
||||
|
|
||||
|
nav-footer |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
/* global siteConfig */ |
||||
|
|
||||
|
export default { |
||||
|
props: { |
||||
|
pageId: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
locale: { |
||||
|
type: String, |
||||
|
default: 'en' |
||||
|
}, |
||||
|
path: { |
||||
|
type: String, |
||||
|
default: 'home' |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
computed: { |
||||
|
darkMode() { return siteConfig.darkMode } |
||||
|
}, |
||||
|
created () { |
||||
|
this.$store.commit('page/SET_ID', this.id) |
||||
|
this.$store.commit('page/SET_LOCALE', this.locale) |
||||
|
this.$store.commit('page/SET_PATH', this.path) |
||||
|
|
||||
|
this.$store.commit('page/SET_MODE', 'history') |
||||
|
}, |
||||
|
methods: { |
||||
|
goLive() { |
||||
|
window.location.assign(`/${this.path}`) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang='scss'> |
||||
|
|
||||
|
.source { |
||||
|
pre > code { |
||||
|
box-shadow: none; |
||||
|
color: mc('grey', '800'); |
||||
|
font-family: 'Source Code Pro', sans-serif; |
||||
|
font-weight: 400; |
||||
|
font-size: 1rem; |
||||
|
|
||||
|
&::before { |
||||
|
display: none; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</style> |
@ -0,0 +1,13 @@ |
|||||
|
query($id: Int!, $offset: Int) { |
||||
|
pages { |
||||
|
history(id:$id, offset:$offset) { |
||||
|
versionId |
||||
|
authorId |
||||
|
authorName |
||||
|
actionType |
||||
|
valueBefore |
||||
|
valueAfter |
||||
|
createdAt |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
extends master.pug |
||||
|
|
||||
|
block head |
||||
|
|
||||
|
block body |
||||
|
#root |
||||
|
page-source( |
||||
|
page-id=page.id |
||||
|
locale=page.localeCode |
||||
|
path=page.path |
||||
|
)= page.content |
Write
Preview
Loading…
Cancel
Save