diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 3824d437fe..041bdfb11d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -704,6 +704,7 @@ editCode: "コードを編集" apply: "適用" receiveAnnouncementFromInstance: "インスタンスからのお知らせを受け取る" emailNotification: "メール通知" +publish: "公開" inChannelSearch: "チャンネル内検索" useReactionPickerForContextMenu: "右クリックでリアクションピッカーを開く" typingUsers: "{users}が入力中" @@ -741,6 +742,17 @@ switch: "切り替え" noMaintainerInformationWarning: "管理者情報が設定されていません。" noBotProtectionWarning: "Bot防御が設定されていません。" configure: "設定する" +postToGallery: "ギャラリーへ投稿" +gallery: "ギャラリー" +recentPosts: "最近の投稿" +popularPosts: "人気の投稿" +shareWithNote: "ノートで共有" + +_gallery: + my: "自分の投稿" + liked: "いいねした投稿" + like: "いいね!" + unlike: "いいね解除" _email: _follow: diff --git a/migration/1611397665007-gallery.ts b/migration/1611397665007-gallery.ts new file mode 100644 index 0000000000..1b64490feb --- /dev/null +++ b/migration/1611397665007-gallery.ts @@ -0,0 +1,40 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class gallery1611397665007 implements MigrationInterface { + name = 'gallery1611397665007' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE "gallery_post" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "title" character varying(256) NOT NULL, "description" character varying(2048), "userId" character varying(32) NOT NULL, "fileIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "isSensitive" boolean NOT NULL DEFAULT false, "likedCount" integer NOT NULL DEFAULT '0', "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_8e90d7b6015f2c4518881b14753" PRIMARY KEY ("id")); COMMENT ON COLUMN "gallery_post"."createdAt" IS 'The created date of the GalleryPost.'; COMMENT ON COLUMN "gallery_post"."updatedAt" IS 'The updated date of the GalleryPost.'; COMMENT ON COLUMN "gallery_post"."userId" IS 'The ID of author.'; COMMENT ON COLUMN "gallery_post"."isSensitive" IS 'Whether the post is sensitive.'`); + await queryRunner.query(`CREATE INDEX "IDX_8f1a239bd077c8864a20c62c2c" ON "gallery_post" ("createdAt") `); + await queryRunner.query(`CREATE INDEX "IDX_f631d37835adb04792e361807c" ON "gallery_post" ("updatedAt") `); + await queryRunner.query(`CREATE INDEX "IDX_985b836dddd8615e432d7043dd" ON "gallery_post" ("userId") `); + await queryRunner.query(`CREATE INDEX "IDX_3ca50563facd913c425e7a89ee" ON "gallery_post" ("fileIds") `); + await queryRunner.query(`CREATE INDEX "IDX_f2d744d9a14d0dfb8b96cb7fc5" ON "gallery_post" ("isSensitive") `); + await queryRunner.query(`CREATE INDEX "IDX_1a165c68a49d08f11caffbd206" ON "gallery_post" ("likedCount") `); + await queryRunner.query(`CREATE INDEX "IDX_05cca34b985d1b8edc1d1e28df" ON "gallery_post" ("tags") `); + await queryRunner.query(`CREATE TABLE "gallery_like" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "postId" character varying(32) NOT NULL, CONSTRAINT "PK_853ab02be39b8de45cd720cc15f" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE INDEX "IDX_8fd5215095473061855ceb948c" ON "gallery_like" ("userId") `); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_df1b5f4099e99fb0bc5eae53b6" ON "gallery_like" ("userId", "postId") `); + await queryRunner.query(`ALTER TABLE "gallery_post" ADD CONSTRAINT "FK_985b836dddd8615e432d7043ddb" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "gallery_like" ADD CONSTRAINT "FK_8fd5215095473061855ceb948cf" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "gallery_like" ADD CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8" FOREIGN KEY ("postId") REFERENCES "gallery_post"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8"`); + await queryRunner.query(`ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_8fd5215095473061855ceb948cf"`); + await queryRunner.query(`ALTER TABLE "gallery_post" DROP CONSTRAINT "FK_985b836dddd8615e432d7043ddb"`); + await queryRunner.query(`DROP INDEX "IDX_df1b5f4099e99fb0bc5eae53b6"`); + await queryRunner.query(`DROP INDEX "IDX_8fd5215095473061855ceb948c"`); + await queryRunner.query(`DROP TABLE "gallery_like"`); + await queryRunner.query(`DROP INDEX "IDX_05cca34b985d1b8edc1d1e28df"`); + await queryRunner.query(`DROP INDEX "IDX_1a165c68a49d08f11caffbd206"`); + await queryRunner.query(`DROP INDEX "IDX_f2d744d9a14d0dfb8b96cb7fc5"`); + await queryRunner.query(`DROP INDEX "IDX_3ca50563facd913c425e7a89ee"`); + await queryRunner.query(`DROP INDEX "IDX_985b836dddd8615e432d7043dd"`); + await queryRunner.query(`DROP INDEX "IDX_f631d37835adb04792e361807c"`); + await queryRunner.query(`DROP INDEX "IDX_8f1a239bd077c8864a20c62c2c"`); + await queryRunner.query(`DROP TABLE "gallery_post"`); + } + +} diff --git a/src/client/components/gallery-post-preview.vue b/src/client/components/gallery-post-preview.vue new file mode 100644 index 0000000000..5c3bdb1349 --- /dev/null +++ b/src/client/components/gallery-post-preview.vue @@ -0,0 +1,126 @@ + + + + + diff --git a/src/client/components/ui/button.vue b/src/client/components/ui/button.vue index 3901e8ae44..c92f30db97 100644 --- a/src/client/components/ui/button.vue +++ b/src/client/components/ui/button.vue @@ -139,7 +139,8 @@ export default defineComponent({ } &.primary { - color: #fff; + font-weight: bold; + color: #fff !important; background: var(--accent); &:not(:disabled):hover { @@ -200,10 +201,6 @@ export default defineComponent({ min-width: 100px; } - &.primary { - font-weight: bold; - } - > .ripples { position: absolute; z-index: 0; diff --git a/src/client/components/ui/container.vue b/src/client/components/ui/container.vue index cfd928518e..2e8eea7132 100644 --- a/src/client/components/ui/container.vue +++ b/src/client/components/ui/container.vue @@ -199,6 +199,7 @@ export default defineComponent({ > .fade { display: block; position: absolute; + z-index: 10; bottom: 0; left: 0; width: 100%; diff --git a/src/client/components/ui/pagination.vue b/src/client/components/ui/pagination.vue index ac8ed01e12..1bd77447b7 100644 --- a/src/client/components/ui/pagination.vue +++ b/src/client/components/ui/pagination.vue @@ -10,8 +10,8 @@
-
- +
+ @@ -38,6 +38,12 @@ export default defineComponent({ pagination: { required: true }, + + disableAutoLoad: { + type: Boolean, + required: false, + default: false, + } }, }); diff --git a/src/client/pages/gallery/index.vue b/src/client/pages/gallery/index.vue new file mode 100644 index 0000000000..9e726e70f2 --- /dev/null +++ b/src/client/pages/gallery/index.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/src/client/pages/gallery/new.vue b/src/client/pages/gallery/new.vue new file mode 100644 index 0000000000..3f9756df8e --- /dev/null +++ b/src/client/pages/gallery/new.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/client/pages/gallery/post.vue b/src/client/pages/gallery/post.vue new file mode 100644 index 0000000000..86fae99888 --- /dev/null +++ b/src/client/pages/gallery/post.vue @@ -0,0 +1,271 @@ + + + + + diff --git a/src/client/pages/page.vue b/src/client/pages/page.vue index f25ed51184..e43add7b0b 100644 --- a/src/client/pages/page.vue +++ b/src/client/pages/page.vue @@ -166,10 +166,11 @@ export default defineComponent({ border-top: solid 0.5px var(--divider); > .button { - --accent: rgb(216 71 106); + --accent: rgb(241 97 132); --X8: rgb(241 92 128); --buttonBg: rgb(216 71 106 / 5%); --buttonHoverBg: rgb(216 71 106 / 10%); + color: #ff002f; ::v-deep(.count) { margin-left: 0.5em; diff --git a/src/client/pages/user/gallery.vue b/src/client/pages/user/gallery.vue new file mode 100644 index 0000000000..2a4c4e03f4 --- /dev/null +++ b/src/client/pages/user/gallery.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/src/client/pages/user/index.vue b/src/client/pages/user/index.vue index 207b44f631..474860e6db 100644 --- a/src/client/pages/user/index.vue +++ b/src/client/pages/user/index.vue @@ -191,6 +191,10 @@ {{ $ts.pages }} + + + {{ $ts.gallery }} +