This commit is contained in:
@@ -3,12 +3,21 @@
|
|||||||
<!-- <span class="v-label v-label--active theme--light">
|
<!-- <span class="v-label v-label--active theme--light">
|
||||||
Wiki
|
Wiki
|
||||||
</span> -->
|
</span> -->
|
||||||
<div>
|
<template v-if="readOnly">
|
||||||
<v-btn depressed tile @click="switchView()">
|
<div>
|
||||||
<v-icon left>{{ switchViewIcon() }}</v-icon
|
<v-btn depressed tile @click="switchView()">
|
||||||
>Wiki</v-btn
|
Wiki<v-icon right>{{ switchViewIcon() }}</v-icon></v-btn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div>
|
||||||
|
<v-btn depressed tile @click="switchView()">
|
||||||
|
Wiki<v-icon right>{{ switchViewIcon() }}</v-icon></v-btn
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<v-sheet
|
<v-sheet
|
||||||
v-if="currentView != 0"
|
v-if="currentView != 0"
|
||||||
elevation="2"
|
elevation="2"
|
||||||
@@ -16,11 +25,8 @@
|
|||||||
>
|
>
|
||||||
<v-row>
|
<v-row>
|
||||||
<!-- DESIGNER -->
|
<!-- DESIGNER -->
|
||||||
<v-col
|
<!-- v-show="showDesigner()" -->
|
||||||
v-if="canEdit"
|
<v-col v-if="showDesigner()" :cols="currentView == 1 ? 6 : 12">
|
||||||
v-show="showDesigner()"
|
|
||||||
:cols="currentView == 1 ? 6 : 12"
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<v-btn depressed tile> <v-icon>fa-bold</v-icon></v-btn>
|
<v-btn depressed tile> <v-icon>fa-bold</v-icon></v-btn>
|
||||||
<v-btn depressed tile> <v-icon>fa-italic</v-icon></v-btn>
|
<v-btn depressed tile> <v-icon>fa-italic</v-icon></v-btn>
|
||||||
@@ -44,7 +50,7 @@
|
|||||||
<v-textarea v-model="value" auto-grow></v-textarea>
|
<v-textarea v-model="value" auto-grow></v-textarea>
|
||||||
</v-col>
|
</v-col>
|
||||||
<!-- WIKI -->
|
<!-- WIKI -->
|
||||||
<v-col v-show="showWiki()" :cols="currentView == 1 ? 6 : 12">
|
<v-col v-if="showWiki()" :cols="currentView == 1 ? 6 : 12">
|
||||||
<div class="aywiki" v-html="compiledOutput()"></div>
|
<div class="aywiki" v-html="compiledOutput()"></div>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -67,14 +73,14 @@ export default {
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: String,
|
value: String,
|
||||||
canEdit: Boolean
|
readOnly: Boolean
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
switchViewIcon() {
|
switchViewIcon() {
|
||||||
//return the icon that indicates what it will change to if you click it
|
//return the icon that indicates what it will change to if you click it
|
||||||
//mirror of switchview below
|
//mirror of switchview below
|
||||||
|
|
||||||
if (!this.canEdit) {
|
if (this.readOnly) {
|
||||||
if (this.currentView == HIDDEN_VIEW) {
|
if (this.currentView == HIDDEN_VIEW) {
|
||||||
return "fa-eye";
|
return "fa-eye";
|
||||||
} else {
|
} else {
|
||||||
@@ -102,7 +108,7 @@ export default {
|
|||||||
},
|
},
|
||||||
switchView() {
|
switchView() {
|
||||||
//if user can't edit then cycle between hidden and wiki view
|
//if user can't edit then cycle between hidden and wiki view
|
||||||
if (!this.canEdit) {
|
if (this.readOnly) {
|
||||||
if (this.currentView == HIDDEN_VIEW) {
|
if (this.currentView == HIDDEN_VIEW) {
|
||||||
this.currentView = WIKI_VIEW;
|
this.currentView = WIKI_VIEW;
|
||||||
} else {
|
} else {
|
||||||
@@ -157,6 +163,8 @@ Standard view maybe top and bottom better?
|
|||||||
baseurl setting for local images:
|
baseurl setting for local images:
|
||||||
https://marked.js.org/#/USING_ADVANCED.md#options
|
https://marked.js.org/#/USING_ADVANCED.md#options
|
||||||
|
|
||||||
|
todo: event log type just for edit wiki?
|
||||||
|
- this is because a wiki is not a discrete object in v8 so rights follow object itself and maybe it's necessary to know when wiki was edited?
|
||||||
|
|
||||||
Clean up the example markdown, go through and use mine and sprinkle in the marked sample stuff where it differs
|
Clean up the example markdown, go through and use mine and sprinkle in the marked sample stuff where it differs
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@
|
|||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<gz-wiki
|
<gz-wiki
|
||||||
v-model="obj.wikiContent"
|
v-model="obj.wikiContent"
|
||||||
:canEdit="true"
|
:readOnly="formstate.readOnly"
|
||||||
:parentVM="this"
|
:parentVM="this"
|
||||||
></gz-wiki
|
></gz-wiki
|
||||||
></v-col>
|
></v-col>
|
||||||
|
|||||||
Reference in New Issue
Block a user