Merge branch 'feat-client-drive-notes' into 'develop'

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

Co-authored-by: Johann150 <johann.galle@protonmail.com>

Closes #10695

See merge request firefish/firefish!10634
This commit is contained in:
Kainoa Kanter 2023-11-10 15:38:18 +00:00
commit 09053f5748
7 changed files with 62 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

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