feat: client: add page 'posts with file attached'

Based on FoundKey commit 3747d7ecb1.
Closes #10695
This commit is contained in:
Johann150 2023-03-27 18:43:49 +02:00 committed by Mia Herkt
parent 2691bd14ee
commit a04f488da0
No known key found for this signature in database
7 changed files with 62 additions and 0 deletions

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

@ -583,6 +583,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")),