feat: add "posts with file attached" page to client

Co-authored-by: Mia Herkt <mia@0x0.st>
This commit is contained in:
Johann150 2023-10-29 20:32:25 +09:00 committed by naskya
parent 89bef89d84
commit 645047b7cf
Signed by: naskya
GPG key ID: 164DFF24E2D40139
8 changed files with 63 additions and 0 deletions

View file

@ -40,6 +40,7 @@
- 本家 Firefish へのまだマージされていないマージリクエストを独断でマージ - 本家 Firefish へのまだマージされていないマージリクエストを独断でマージ
- https://git.joinfirefish.org/firefish/firefish/-/merge_requests/10631 - https://git.joinfirefish.org/firefish/firefish/-/merge_requests/10631
- https://git.joinfirefish.org/firefish/firefish/-/merge_requests/10634
- デフォルトではバイブレーションを無効に - デフォルトではバイブレーションを無効に
- ログインしていなければ投稿検索ができないように - ログインしていなければ投稿検索ができないように
- 攻撃対策のため - 攻撃対策のため

View file

@ -402,6 +402,8 @@ withReplies: "Antworten beinhalten"
connectedTo: "Mit folgenden Nutzerkonten verknüpft" connectedTo: "Mit folgenden Nutzerkonten verknüpft"
notesAndReplies: "Beiträge und Antworten" notesAndReplies: "Beiträge und Antworten"
withFiles: "Beiträge mit Dateien" withFiles: "Beiträge mit Dateien"
attachedToNotes: "Beiträge mit dieser Datei"
showAttachedNotes: "Zeige Beiträge mit dieser Datei"
silence: "stummschalten" silence: "stummschalten"
silenceConfirm: "Sind Sie sicher, dass Sie diesen Benutzer Stummschalten möchten?" silenceConfirm: "Sind Sie sicher, dass Sie diesen Benutzer Stummschalten möchten?"
unsilence: "Stummschaltung aufheben" unsilence: "Stummschaltung aufheben"

View file

@ -429,6 +429,8 @@ withReplies: "Include replies"
connectedTo: "Following account(s) are connected" connectedTo: "Following account(s) are connected"
notesAndReplies: "Posts and replies" notesAndReplies: "Posts and replies"
withFiles: "Including files" withFiles: "Including files"
attachedToNotes: "Posts with this file"
showAttachedNotes: "Show posts with this file"
silence: "Silence" silence: "Silence"
silenceConfirm: "Are you sure that you want to silence this user?" silenceConfirm: "Are you sure that you want to silence this user?"
unsilence: "Undo silencing" unsilence: "Undo silencing"

View file

@ -384,6 +384,8 @@ withReplies: "返信を含む"
connectedTo: "次のアカウントに接続されています" connectedTo: "次のアカウントに接続されています"
notesAndReplies: "投稿と返信" notesAndReplies: "投稿と返信"
withFiles: "ファイル付き" withFiles: "ファイル付き"
attachedToNotes: "このファイルが添付された投稿"
showAttachedNotes: "このファイルが添付された投稿を見る"
silence: "サイレンス" silence: "サイレンス"
silenceConfirm: "サイレンスしますか?" silenceConfirm: "サイレンスしますか?"
unsilence: "サイレンス解除" unsilence: "サイレンス解除"

View file

@ -107,6 +107,12 @@ function getMenu() {
icon: `${icon("ph-download-simple")}`, icon: `${icon("ph-download-simple")}`,
download: props.file.name, download: props.file.name,
}, },
{
type: "a",
href: `/my/drive/file/${props.file.id}/attached`,
text: i18n.ts.showAttachedNotes,
icon: `${icon("ph-paperclip")}`,
},
null, null,
{ {
text: i18n.ts.delete, text: i18n.ts.delete,

View file

@ -44,6 +44,7 @@ const props = defineProps<{
antenna?: string; antenna?: string;
channel?: string; channel?: string;
sound?: boolean; sound?: boolean;
fileId?: string;
}>(); }>();
const queue = ref(0); const queue = ref(0);
@ -195,6 +196,11 @@ if (props.src === "antenna") {
channelId: props.channel, channelId: props.channel,
}); });
connection.on("note", prepend); connection.on("note", prepend);
} else if (props.src === "file") {
endpoint = "drive/files/attached-notes";
query = {
fileId: props.fileId,
};
} }
function closeHint() { function closeHint() {

View file

@ -0,0 +1,39 @@
<template>
<MkStickyContainer>
<template #header
><MkPageHeader :display-back-button="true"
/></template>
<MkSpacer :content-max="800">
<div class="attachments-timeline">
<XTimeline ref="tl" class="tl" src="file" :fileId="fileId" />
</div>
</MkSpacer>
</MkStickyContainer>
</template>
<script lang="ts" setup>
import { computed } from "vue";
import XTimeline from "@/components/MkTimeline.vue";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
import icon from "@/scripts/icon";
defineProps<{
fileId: string;
}>();
definePageMetadata(
computed(() => ({
title: i18n.ts.attachedToNotes,
icon: `${icon("ph-paperclip")}`,
})),
);
</script>
<style lang="scss" scoped>
.attachments-timeline {
background: var(--bg);
border-radius: var(--radius);
overflow: clip;
}
</style>

View file

@ -588,6 +588,11 @@ export const routes = [
component: page(() => import("./pages/drive.vue")), component: page(() => import("./pages/drive.vue")),
loginRequired: true, loginRequired: true,
}, },
{
path: "/my/drive/file/:fileId/attached",
component: page(() => import("./pages/attached-files.vue")),
loginRequired: true,
},
{ {
path: "/my/drive", path: "/my/drive",
component: page(() => import("./pages/drive.vue")), component: page(() => import("./pages/drive.vue")),