summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authormarihachi <marihachi0620@gmail.com>2021-03-13 10:56:27 +0900
committerGitHub <noreply@github.com>2021-03-13 10:56:27 +0900
commit522dbb1e138f9fa2180a5ccc0b9075da306d72aa (patch)
treea6b8ef9074e911de4f03f7278883423002effe3a /src/client
parentImprove flush (#7328) (diff)
downloadsharkey-522dbb1e138f9fa2180a5ccc0b9075da306d72aa.tar.gz
sharkey-522dbb1e138f9fa2180a5ccc0b9075da306d72aa.tar.bz2
sharkey-522dbb1e138f9fa2180a5ccc0b9075da306d72aa.zip
update page editor (#7317)
* fix buttons visibility * fix title of page editor
Diffstat (limited to 'src/client')
-rw-r--r--src/client/pages/page-editor/page-editor.vue22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/client/pages/page-editor/page-editor.vue b/src/client/pages/page-editor/page-editor.vue
index 45997dfd65..08856ebfe4 100644
--- a/src/client/pages/page-editor/page-editor.vue
+++ b/src/client/pages/page-editor/page-editor.vue
@@ -4,9 +4,9 @@
<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;">
- <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="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>
<MkContainer :body-togglable="true" :expanded="true" class="_vMargin">
@@ -134,12 +134,18 @@ export default defineComponent({
data() {
return {
- INFO: computed(() => this.initPageId ? {
- title: this.$ts._pages.editPage,
- icon: faPencilAlt,
- } : {
- title: this.$ts._pages.newPage,
- icon: faPencilAlt,
+ INFO: computed(() => {
+ let title = this.$ts._pages.newPage;
+ if (this.initPageId) {
+ title = this.$ts._pages.editPage;
+ }
+ else if (this.initPageName && this.initUser) {
+ title = this.$ts._pages.readPage;
+ }
+ return {
+ title: title,
+ icon: faPencilAlt,
+ };
}),
author: this.$i,
readonly: false,