add tags as buttons to posts

This commit is contained in:
Absturztaube 2021-07-03 17:23:25 +02:00
parent 77f8537f61
commit 0fc86d5bfe
2 changed files with 27 additions and 0 deletions

View file

@ -90,6 +90,17 @@ const StatusContent = {
}
return true
},
tagsSorted () {
return this.status.tags.sort((a, b) => {
if (a.name < b.name) {
return -1
}
if (a.name > b.name) {
return 1
}
return 0
})
},
attachmentSize () {
if ((this.mergedConfig.hideAttachments && !this.inConversation) ||
(this.mergedConfig.hideAttachmentsInConv && this.inConversation) ||

View file

@ -87,6 +87,17 @@
</button>
</div>
<div v-if="status.tags.length !== 0">
<a
v-for="tag in tagsSorted"
:key="tag.name"
:href="tag.url"
class="btn button-default status-tag"
>
{{ tag.name }}
</a>
</div>
<div v-if="status.poll && status.poll.options && !hideSubjectStatus">
<poll :base-poll="status.poll" />
</div>
@ -140,6 +151,11 @@ $status-margin: 0.75em;
flex: 1;
min-width: 0;
.status-tag {
padding: 2px;
margin: 2px;
}
.status-content-wrapper {
display: flex;
flex-direction: column;