From 0072b150c8dbdd8be8f323dd29813e37a54f13a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8A=E3=81=95=E3=82=80=E3=81=AE=E3=81=B2=E3=81=A8?= <46447427+samunohito@users.noreply.github.com> Date: Tue, 11 Feb 2025 21:05:04 +0900 Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=E3=83=8E=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=AB=E5=9F=8B=E3=82=81=E8=BE=BC=E3=81=BE=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E3=83=A1=E3=83=87=E3=82=A3=E3=82=A2=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E3=83=A1=E3=83=8B?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=81=8B=E3=82=89=E7=AE=A1=E7=90=86=E8=80=85?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=94=BB=E9=9D=A2=E3=82=92=E9=96=8B=E3=81=91=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + locales/index.d.ts | 4 ++++ locales/ja-JP.yml | 1 + .../frontend/src/components/MkMediaAudio.vue | 18 +++++++++++++++--- .../frontend/src/components/MkMediaImage.vue | 18 +++++++++++++++--- .../frontend/src/components/MkMediaVideo.vue | 18 +++++++++++++++--- 6 files changed, 51 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22e2459291..150c7e3442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Enhance: アンテナ、リスト等の名前をカラム名のデフォルト値にするように `#13992` - Enhance: クライアントエラー画面の多言語対応 - Enhance: 開発者モードでメニューからファイルIDをコピー出来るように `#15441' +- Enhance: ノートに埋め込まれたメディアのコンテキストメニューから管理者用のファイル管理画面を開けるように ( #15440 ) - Fix: コンディショナルロールを手動で割り当てできる導線を削除 `#13529` - Fix: 埋め込みプレイヤーから外部ページに移動できない問題を修正 diff --git a/locales/index.d.ts b/locales/index.d.ts index 4fe605490e..fb42ef2674 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10056,6 +10056,10 @@ export interface Locale extends ILocale { * ファイルの詳細 */ "title": string; + /** + * ファイルの詳細(管理者用) + */ + "titleAdmin": string; /** * ファイルタイプ */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 57b11e9e04..4d08a63e3e 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2665,6 +2665,7 @@ _moderationLogTypes: _fileViewer: title: "ファイルの詳細" + titleAdmin: "ファイルの詳細(管理者用)" type: "ファイルタイプ" size: "ファイルサイズ" url: "URL" diff --git a/packages/frontend/src/components/MkMediaAudio.vue b/packages/frontend/src/components/MkMediaAudio.vue index e509cac945..893a1d0b62 100644 --- a/packages/frontend/src/components/MkMediaAudio.vue +++ b/packages/frontend/src/components/MkMediaAudio.vue @@ -217,10 +217,9 @@ function showMenu(ev: MouseEvent) { }); } + const details: MenuItem[] = []; if ($i?.id === props.audio.userId) { - menu.push({ - type: 'divider', - }, { + details.push({ type: 'link', text: i18n.ts._fileViewer.title, icon: 'ti ti-info-circle', @@ -228,6 +227,19 @@ function showMenu(ev: MouseEvent) { }); } + if (iAmModerator) { + details.push({ + type: 'link', + text: i18n.ts._fileViewer.titleAdmin, + icon: 'ti ti-pencil', + to: `/admin/file/${props.audio.id}`, + }); + } + + if (details.length > 0) { + menu.push({ type: 'divider' }, ...details); + } + if (defaultStore.state.devMode) { menu.push({ type: 'divider' }, { icon: 'ti ti-id', diff --git a/packages/frontend/src/components/MkMediaImage.vue b/packages/frontend/src/components/MkMediaImage.vue index bd6decd082..8eb8d31ce2 100644 --- a/packages/frontend/src/components/MkMediaImage.vue +++ b/packages/frontend/src/components/MkMediaImage.vue @@ -133,10 +133,9 @@ function showMenu(ev: MouseEvent) { }); } + const details: MenuItem[] = []; if ($i?.id === props.image.userId) { - menuItems.push({ - type: 'divider', - }, { + details.push({ type: 'link', text: i18n.ts._fileViewer.title, icon: 'ti ti-info-circle', @@ -144,6 +143,19 @@ function showMenu(ev: MouseEvent) { }); } + if (iAmModerator) { + details.push({ + type: 'link', + text: i18n.ts._fileViewer.titleAdmin, + icon: 'ti ti-pencil', + to: `/admin/file/${props.image.id}`, + }); + } + + if (details.length > 0) { + menuItems.push({ type: 'divider' }, ...details); + } + if (defaultStore.state.devMode) { menuItems.push({ type: 'divider' }, { icon: 'ti ti-id', diff --git a/packages/frontend/src/components/MkMediaVideo.vue b/packages/frontend/src/components/MkMediaVideo.vue index dec190f16c..36f81e3890 100644 --- a/packages/frontend/src/components/MkMediaVideo.vue +++ b/packages/frontend/src/components/MkMediaVideo.vue @@ -242,10 +242,9 @@ function showMenu(ev: MouseEvent) { }); } + const details: MenuItem[] = []; if ($i?.id === props.video.userId) { - menu.push({ - type: 'divider', - }, { + details.push({ type: 'link', text: i18n.ts._fileViewer.title, icon: 'ti ti-info-circle', @@ -253,6 +252,19 @@ function showMenu(ev: MouseEvent) { }); } + if (iAmModerator) { + details.push({ + type: 'link', + text: i18n.ts._fileViewer.titleAdmin, + icon: 'ti ti-pencil', + to: `/admin/file/${props.video.id}`, + }); + } + + if (details.length > 0) { + menu.push({ type: 'divider' }, ...details); + } + if (defaultStore.state.devMode) { menu.push({ type: 'divider' }, { icon: 'ti ti-id',