feat: add indicator if an attachment is task cover

This commit is contained in:
kolaente 2022-10-05 15:04:03 +02:00
parent a7731370a0
commit f01107fd73
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 19 additions and 2 deletions

View file

@ -35,7 +35,15 @@
:key="a.id"
@click="viewOrDownload(a)"
>
<div class="filename">{{ a.file.name }}</div>
<div class="filename">
{{ a.file.name }}
<span
v-if="task.coverImageAttachmentId === a.id"
class="is-task-cover"
>
{{ $t('task.attachment.usedAsCover') }}
</span>
</div>
<div class="info">
<p class="attachment-info-meta">
<i18n-t keypath="task.attachment.createdBy" scope="global">
@ -418,5 +426,13 @@ async function setCoverImage(attachment: IAttachment | null) {
}
}
.is-task-cover {
background: var(--primary);
color: var(--white);
padding: .25rem .35rem;
border-radius: 4px;
font-size: .75rem;
}
@include modal-transition();
</style>

View file

@ -696,7 +696,8 @@
"copyUrlTooltip": "Copy the url of this attachment for usage in text",
"setAsCover": "Make cover",
"unsetAsCover": "Remove cover",
"successfullyChangedCoverImage": "The cover image was successfully changed."
"successfullyChangedCoverImage": "The cover image was successfully changed.",
"usedAsCover": "Cover image"
},
"comment": {
"title": "Comments",