update page editor (#7317)
* fix buttons visibility * fix title of page editor
This commit is contained in:
parent
bc4315da1e
commit
522dbb1e13
1 changed files with 14 additions and 8 deletions
|
@ -4,9 +4,9 @@
|
||||||
<MkA class="view" v-if="pageId" :to="`/@${ author.username }/pages/${ currentName }`"><Fa :icon="faExternalLinkSquareAlt"/> {{ $ts._pages.viewPage }}</MkA>
|
<MkA class="view" v-if="pageId" :to="`/@${ author.username }/pages/${ currentName }`"><Fa :icon="faExternalLinkSquareAlt"/> {{ $ts._pages.viewPage }}</MkA>
|
||||||
|
|
||||||
<div class="buttons" style="margin: 16px 0;">
|
<div class="buttons" style="margin: 16px 0;">
|
||||||
<MkButton inline @click="save" primary class="save"><Fa :icon="faSave"/> {{ $ts.save }}</MkButton>
|
<MkButton inline @click="save" primary class="save" v-if="!readonly"><Fa :icon="faSave"/> {{ $ts.save }}</MkButton>
|
||||||
<MkButton inline @click="duplicate" class="duplicate" v-if="pageId"><Fa :icon="faCopy"/> {{ $ts.duplicate }}</MkButton>
|
<MkButton inline @click="duplicate" class="duplicate" v-if="pageId"><Fa :icon="faCopy"/> {{ $ts.duplicate }}</MkButton>
|
||||||
<MkButton inline @click="del" class="delete" v-if="pageId"><Fa :icon="faTrashAlt"/> {{ $ts.delete }}</MkButton>
|
<MkButton inline @click="del" class="delete" v-if="pageId && !readonly"><Fa :icon="faTrashAlt"/> {{ $ts.delete }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MkContainer :body-togglable="true" :expanded="true" class="_vMargin">
|
<MkContainer :body-togglable="true" :expanded="true" class="_vMargin">
|
||||||
|
@ -134,12 +134,18 @@ export default defineComponent({
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
INFO: computed(() => this.initPageId ? {
|
INFO: computed(() => {
|
||||||
title: this.$ts._pages.editPage,
|
let title = this.$ts._pages.newPage;
|
||||||
icon: faPencilAlt,
|
if (this.initPageId) {
|
||||||
} : {
|
title = this.$ts._pages.editPage;
|
||||||
title: this.$ts._pages.newPage,
|
}
|
||||||
icon: faPencilAlt,
|
else if (this.initPageName && this.initUser) {
|
||||||
|
title = this.$ts._pages.readPage;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
icon: faPencilAlt,
|
||||||
|
};
|
||||||
}),
|
}),
|
||||||
author: this.$i,
|
author: this.$i,
|
||||||
readonly: false,
|
readonly: false,
|
||||||
|
|
Loading…
Reference in a new issue