From 3a30834fcbe4ddfd8ad9e78621611fb9e00e87ca Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 5 Dec 2020 16:05:40 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3=E3=82=92=E6=94=B9?= =?UTF-8?q?=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 2 + .../1607151207216-instance-pinned-clip.ts | 14 ++ src/client/pages/instance/settings.vue | 5 + src/client/pages/welcome.entrance.block.vue | 142 ------------------ src/client/pages/welcome.entrance.vue | 53 ++++--- src/client/style.scss | 3 +- src/client/ui/visitor/b.vue | 20 ++- src/client/ui/visitor/kanban.vue | 52 +++++-- src/models/entities/meta.ts | 7 + src/server/api/endpoints/admin/update-meta.ts | 8 + src/server/api/endpoints/meta.ts | 2 +- 11 files changed, 125 insertions(+), 183 deletions(-) create mode 100644 migration/1607151207216-instance-pinned-clip.ts delete mode 100644 src/client/pages/welcome.entrance.block.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index ee94c53da..013a85dff 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -320,6 +320,8 @@ pinnedUsers: "ピン留めユーザー" pinnedUsersDescription: "「みつける」ページなどにピン留めしたいユーザーを改行で区切って記述します。" pinnedPages: "ピン留めページ" pinnedPagesDescription: "インスタンスのトップページにピン留めしたいページのパスを改行で区切って記述します。" +pinnedClipId: "ピン留めするクリップのID" +pinnedNotes: "ピン留めされたノート" hcaptcha: "hCaptcha" enableHcaptcha: "hCaptchaを有効にする" hcaptchaSiteKey: "サイトキー" diff --git a/migration/1607151207216-instance-pinned-clip.ts b/migration/1607151207216-instance-pinned-clip.ts new file mode 100644 index 000000000..7e2c8b7de --- /dev/null +++ b/migration/1607151207216-instance-pinned-clip.ts @@ -0,0 +1,14 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class instancePinnedClip1607151207216 implements MigrationInterface { + name = 'instancePinnedClip1607151207216' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" ADD "pinnedClipId" character varying(32)`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedClipId"`); + } + +} diff --git a/src/client/pages/instance/settings.vue b/src/client/pages/instance/settings.vue index 542c2942b..d9d87ddbe 100644 --- a/src/client/pages/instance/settings.vue +++ b/src/client/pages/instance/settings.vue @@ -18,6 +18,8 @@ + {{ $t('pinnedClipId') }} +
{{ $t('maxNoteTextLength') }} @@ -285,6 +287,7 @@ export default defineComponent({ blockedHosts: '', pinnedUsers: '', pinnedPages: '', + pinnedClipId: null, maintainerName: null, maintainerEmail: null, name: null, @@ -373,6 +376,7 @@ export default defineComponent({ this.blockedHosts = this.meta.blockedHosts.join('\n'); this.pinnedUsers = this.meta.pinnedUsers.join('\n'); this.pinnedPages = this.meta.pinnedPages.join('\n'); + this.pinnedClipId = this.meta.pinnedClipId; this.enableServiceWorker = this.meta.enableServiceWorker; this.swPublicKey = this.meta.swPublickey; this.swPrivateKey = this.meta.swPrivateKey; @@ -526,6 +530,7 @@ export default defineComponent({ blockedHosts: this.blockedHosts.split('\n') || [], pinnedUsers: this.pinnedUsers ? this.pinnedUsers.split('\n') : [], pinnedPages: this.pinnedPages ? this.pinnedPages.split('\n') : [], + pinnedClipId: (this.pinnedClipId && this.pinnedClipId) != '' ? this.pinnedClipId : null, enableServiceWorker: this.enableServiceWorker, swPublicKey: this.swPublicKey, swPrivateKey: this.swPrivateKey, diff --git a/src/client/pages/welcome.entrance.block.vue b/src/client/pages/welcome.entrance.block.vue deleted file mode 100644 index b4f588177..000000000 --- a/src/client/pages/welcome.entrance.block.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - - - diff --git a/src/client/pages/welcome.entrance.vue b/src/client/pages/welcome.entrance.vue index d5ea47bb8..2ce357e20 100644 --- a/src/client/pages/welcome.entrance.vue +++ b/src/client/pages/welcome.entrance.vue @@ -1,8 +1,9 @@ @@ -12,16 +13,16 @@ import { toUnicode } from 'punycode'; import XSigninDialog from '@/components/signin-dialog.vue'; import XSignupDialog from '@/components/signup-dialog.vue'; import MkButton from '@/components/ui/button.vue'; -import XNotes from '@/components/notes.vue'; -import XBlock from './welcome.entrance.block.vue'; +import XNote from '@/components/note.vue'; +import MkPagination from '@/components/ui/pagination.vue'; import { host, instanceName } from '@/config'; import * as os from '@/os'; export default defineComponent({ components: { MkButton, - XNotes, - XBlock, + XNote, + MkPagination, }, data() { @@ -29,6 +30,13 @@ export default defineComponent({ host: toUnicode(host), instanceName, meta: null, + pagination: { + endpoint: 'clips/notes', + limit: 10, + params: () => ({ + clipId: this.meta.pinnedClipId, + }) + }, }; }, @@ -62,19 +70,28 @@ export default defineComponent({ .rsqzvsbo { text-align: center; - > .blocks { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); - grid-gap: var(--margin); - text-align: left; + > h2 { + display: inline-block; + color: #fff; + margin: 16px; + padding: 8px 12px; + background: rgba(0, 0, 0, 0.5); + } +} - > .block { - height: 600px; - } +.kmkqjgkl { + display: inline-block; + vertical-align: middle; + width: 600px; + margin: 16px; + text-align: left; + box-shadow: 0 6px 46px rgb(0 0 0 / 30%); + border-radius: 12px; - @media (max-width: 800px) { - grid-template-columns: 1fr; - } + @media (max-width: 800px) { + display: block; + width: 100%; + margin: 12px 0; } } diff --git a/src/client/style.scss b/src/client/style.scss index 5d81cf713..5026ffb14 100644 --- a/src/client/style.scss +++ b/src/client/style.scss @@ -2,7 +2,7 @@ :root { --baseContentWidth: 760px; - --radius: 8px; + --radius: 12px; --marginFull: 16px; --marginHalf: 10px; @@ -320,6 +320,7 @@ hr { ._popup { background: var(--panel); border-radius: var(--radius); + contain: content; } ._section { diff --git a/src/client/ui/visitor/b.vue b/src/client/ui/visitor/b.vue index e3cac4125..4f7a7f895 100644 --- a/src/client/ui/visitor/b.vue +++ b/src/client/ui/visitor/b.vue @@ -1,14 +1,14 @@