From 963c7761f274d7263103cb69acf1d754c1c8d32f Mon Sep 17 00:00:00 2001 From: syuilo <Syuilotan@yahoo.co.jp> Date: Fri, 31 Jan 2020 07:01:45 +0900 Subject: [PATCH] Pages --- locales/ja-JP.yml | 25 ++++--- src/client/components/page/page.post.vue | 17 +++-- src/client/components/page/page.vue | 69 -------------------- src/client/components/post-form.vue | 2 +- src/client/pages/page-editor/page-editor.vue | 8 +-- src/client/pages/page.vue | 12 ++-- 6 files changed, 32 insertions(+), 101 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 3b1ed879e9..e65798b96d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -338,6 +338,8 @@ unregister: "登録を解除" passwordLessLogin: "パスワード無ã—ãƒã‚°ã‚¤ãƒ³" resetPassword: "パスワードをリセット" newPasswordIs: "æ–°ã—ã„パスワードã¯ã€Œ{password}ã€ã§ã™" +post: "投稿" +posted: "投稿ã—ã¾ã—ãŸ" _2fa: registerDevice: "デãƒã‚¤ã‚¹ã‚’登録" @@ -445,7 +447,6 @@ _visibility: _postForm: replyPlaceholder: "ã“ã®æŠ•ç¨¿ã«è¿”ä¿¡..." quotePlaceholder: "ã“ã®æŠ•ç¨¿ã‚’引用..." - post: "投稿" _placeholders: a: "ã„ã¾ã©ã†ã—ã¦ã‚‹ï¼Ÿ" b: "何ã‹ã‚ã‚Šã¾ã—ãŸã‹ï¼Ÿ" @@ -505,21 +506,17 @@ _timelines: global: "ã‚°ãƒãƒ¼ãƒãƒ«" _pages: - new-page: "ページã®ä½œæˆ" - edit-page: "ページã®ç·¨é›†" - read-page: "ソースを表示ä¸" + newPage: "ページã®ä½œæˆ" + editPage: "ページã®ç·¨é›†" + readPage: "ソースを表示ä¸" page-created: "ページを作æˆã—ã¾ã—ãŸ" page-updated: "ページを更新ã—ã¾ã—ãŸ" name-already-exists: "指定ã•ã‚ŒãŸãƒšãƒ¼ã‚¸URLã¯æ—¢ã«å˜åœ¨ã—ã¦ã„ã¾ã™" title-invalid-name: "ä¸æ£ãªãƒšãƒ¼ã‚¸URLã§ã™" text-invalid-name: "空白ã§ãªã„ã‹ç¢ºèªã—ã¦ãã ã•ã„" - are-you-sure-delete: "ã“ã®ãƒšãƒ¼ã‚¸ã‚’削除ã—ã¾ã™ã‹ï¼Ÿ" - page-deleted: "ページを削除ã—ã¾ã—ãŸ" - edit-this-page: "ã“ã®ãƒšãƒ¼ã‚¸ã‚’編集" - pin-this-page: "ピン留ã‚" - unpin-this-page: "ピン留ã‚解除" - view-source: "ソースを表示" - view-page: "ページを見る" + editThisPage: "ã“ã®ãƒšãƒ¼ã‚¸ã‚’編集" + viewSource: "ソースを表示" + viewPage: "ページを見る" like: "ã„ã„ã" unlike: "ã„ã„ã解除" liked-pages: "ã„ã„ãã—ãŸãƒšãƒ¼ã‚¸" @@ -542,9 +539,9 @@ _pages: fontSansSerif: "サンセリフ" set-eye-catching-image: "アイã‚ャッãƒç”»åƒã‚’è¨å®š" remove-eye-catching-image: "アイã‚ャッãƒç”»åƒã‚’削除" - choose-block: "ブãƒãƒƒã‚¯ã‚’è¿½åŠ " - select-type: "種類をé¸æŠž" - enter-variable-name: "変数åを決ã‚ã¦ãã ã•ã„" + chooseBlock: "ブãƒãƒƒã‚¯ã‚’è¿½åŠ " + selectType: "種類をé¸æŠž" + enterVariableName: "変数åを決ã‚ã¦ãã ã•ã„" the-variable-name-is-already-used: "ãã®å¤‰æ•°åã¯æ—¢ã«ä½¿ã‚ã‚Œã¦ã„ã¾ã™" content-blocks: "コンテンツ" input-blocks: "入力" diff --git a/src/client/components/page/page.post.vue b/src/client/components/page/page.post.vue index 010a96c855..92a9d653f8 100644 --- a/src/client/components/page/page.post.vue +++ b/src/client/components/page/page.post.vue @@ -1,7 +1,7 @@ <template> <div class="ngbfujlo"> - <mk-textarea class="textarea" :value="text" readonly></mk-textarea> - <mk-button primary @click="post()" :disabled="posting || posted">{{ posted ? $t('posted-from-post-form') : $t('post-from-post-form') }}</mk-button> + <mk-textarea :value="text" readonly style="margin: 0;"></mk-textarea> + <mk-button class="button" primary @click="post()" :disabled="posting || posted">{{ posted ? $t('posted') : $t('post') }}</mk-button> </div> </template> @@ -59,16 +59,19 @@ export default Vue.extend({ <style lang="scss" scoped> .ngbfujlo { - padding: 0 32px 32px 32px; - border: solid 2px var(--divider); + padding: 32px; border-radius: 6px; + box-shadow: 0 2px 8px var(--shadow); + + > .button { + margin-top: 32px; + } @media (max-width: 600px) { - padding: 0 16px 16px 16px; + padding: 16px; - > .textarea { + > .button { margin-top: 16px; - margin-bottom: 16px; } } } diff --git a/src/client/components/page/page.vue b/src/client/components/page/page.vue index 9ec5da81ed..4d62326a53 100644 --- a/src/client/components/page/page.vue +++ b/src/client/components/page/page.vue @@ -97,74 +97,5 @@ export default Vue.extend({ &.center { text-align: center; } - - > header { - > .title { - z-index: 1; - margin: 0; - padding: 16px 32px; - font-size: 20px; - font-weight: bold; - color: var(--text); - box-shadow: 0 var(--lineWidth) rgba(#000, 0.07); - - @media (max-width: 600px) { - padding: 16px 32px; - font-size: 20px; - } - - @media (max-width: 400px) { - padding: 10px 20px; - font-size: 16px; - } - } - } - - > div { - color: var(--text); - padding: 24px 32px; - font-size: 16px; - - @media (max-width: 600px) { - padding: 24px 32px; - font-size: 16px; - } - - @media (max-width: 400px) { - padding: 20px 20px; - font-size: 15px; - } - } - - > footer { - color: var(--text); - padding: 0 32px 28px 32px; - - @media (max-width: 600px) { - padding: 0 32px 28px 32px; - } - - @media (max-width: 400px) { - padding: 0 20px 20px 20px; - font-size: 14px; - } - - > small { - display: block; - opacity: 0.5; - } - - > a { - font-size: 90%; - } - - > a + a { - margin-left: 8px; - } - - > .like { - margin-top: 16px; - } - } } </style> diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index c49b9c2455..d6141e210b 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -164,7 +164,7 @@ export default Vue.extend({ ? this.$t('renote') : this.reply ? this.$t('reply') - : this.$t('_postForm.post'); + : this.$t('post'); }, canPost(): boolean { diff --git a/src/client/pages/page-editor/page-editor.vue b/src/client/pages/page-editor/page-editor.vue index a5a4588f13..8b357584a5 100644 --- a/src/client/pages/page-editor/page-editor.vue +++ b/src/client/pages/page-editor/page-editor.vue @@ -2,7 +2,7 @@ <div> <div class="gwbmwxkm _panel"> <header> - <div class="title"><fa :icon="faStickyNote"/> {{ readonly ? $t('read-page') : pageId ? $t('edit-page') : $t('new-page') }}</div> + <div class="title"><fa :icon="faStickyNote"/> {{ readonly ? $t('readPage') : pageId ? $t('editPage') : $t('newPage') }}</div> <div class="buttons"> <button class="_button" @click="del()" v-if="!readonly"><fa :icon="faTrashAlt"/></button> <button class="_button" @click="() => showOptions = !showOptions"><fa :icon="faCog"/></button> @@ -27,7 +27,7 @@ <span>{{ $t('url') }}</span> </mk-input> - <mk-switch v-model="alignCenter">{{ $t('align-center') }}</mk-switch> + <mk-switch v-model="alignCenter">{{ $t('alignCenter') }}</mk-switch> <mk-select v-model="font"> <template #label>{{ $t('font') }}</template> @@ -301,7 +301,7 @@ export default Vue.extend({ async add() { const { canceled, result: type } = await this.$root.dialog({ type: null, - title: this.$t('choose-block'), + title: this.$t('chooseBlock'), select: { groupedItems: this.getPageBlockList() }, @@ -315,7 +315,7 @@ export default Vue.extend({ async addVariable() { let { canceled, result: name } = await this.$root.dialog({ - title: this.$t('enter-variable-name'), + title: this.$t('enterVariableName'), input: { type: 'text', }, diff --git a/src/client/pages/page.vue b/src/client/pages/page.vue index 780b6eccdb..5d0ca653d4 100644 --- a/src/client/pages/page.vue +++ b/src/client/pages/page.vue @@ -11,14 +11,14 @@ <div class="_footer"> <small>@{{ page.user.username }}</small> <template v-if="$store.getters.isSignedIn && $store.state.i.id === page.userId"> - <router-link :to="`/my/pages/edit/${page.id}`">{{ $t('edit-this-page') }}</router-link> - <a v-if="$store.state.i.pinnedPageId === page.id" @click="pin(false)">{{ $t('unpin-this-page') }}</a> - <a v-else @click="pin(true)">{{ $t('pin-this-page') }}</a> + <router-link :to="`/my/pages/edit/${page.id}`">{{ $t('_pages.editThisPage') }}</router-link> + <a v-if="$store.state.i.pinnedPageId === page.id" @click="pin(false)">{{ $t('unpin') }}</a> + <a v-else @click="pin(true)">{{ $t('pin') }}</a> </template> - <router-link :to="`./${page.name}/view-source`">{{ $t('view-source') }}</router-link> + <router-link :to="`./${page.name}/view-source`">{{ $t('_pages.viewSource') }}</router-link> <div class="like"> - <button @click="unlike()" v-if="page.isLiked" :title="$t('unlike')"><fa :icon="faHeartS"/></button> - <button @click="like()" v-else :title="$t('like')"><fa :icon="faHeart"/></button> + <button @click="unlike()" v-if="page.isLiked" :title="$t('_pages.unlike')"><fa :icon="faHeartS"/></button> + <button @click="like()" v-else :title="$t('_pages.like')"><fa :icon="faHeart"/></button> <span class="count" v-if="page.likedCount > 0">{{ page.likedCount }}</span> </div> </div> -- GitLab