forked from AkkomaGang/akkoma-fe
add tags to data and to status component
This commit is contained in:
parent
5bf208f2d1
commit
fc9acf8fb6
3 changed files with 10 additions and 1 deletions
|
@ -289,6 +289,13 @@ const Status = {
|
||||||
AvatarList
|
AvatarList
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
generateTagAttributes(tags) {
|
||||||
|
let res = {};
|
||||||
|
for (let tag of tags) {
|
||||||
|
res['data-tag-'+tag.name] = tag.name;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
},
|
||||||
visibilityIcon (visibility) {
|
visibilityIcon (visibility) {
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
case 'private':
|
case 'private':
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status">
|
<div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status" v-bind="generateTagAttributes(status.tags)">
|
||||||
<div v-if="!noHeading" class="media-left">
|
<div v-if="!noHeading" class="media-left">
|
||||||
<router-link :to="userProfileLink" @click.stop.prevent.capture.native="toggleUserExpanded">
|
<router-link :to="userProfileLink" @click.stop.prevent.capture.native="toggleUserExpanded">
|
||||||
<UserAvatar :compact="compact" :betterShadow="betterShadow" :user="status.user"/>
|
<UserAvatar :compact="compact" :betterShadow="betterShadow" :user="status.user"/>
|
||||||
|
|
|
@ -192,6 +192,8 @@ export const parseStatus = (data) => {
|
||||||
|
|
||||||
output.statusnet_html = addEmojis(data.content, data.emojis)
|
output.statusnet_html = addEmojis(data.content, data.emojis)
|
||||||
|
|
||||||
|
output.tags = data.tags
|
||||||
|
|
||||||
if (data.pleroma) {
|
if (data.pleroma) {
|
||||||
const { pleroma } = data
|
const { pleroma } = data
|
||||||
output.text = pleroma.content ? data.pleroma.content['text/plain'] : data.content
|
output.text = pleroma.content ? data.pleroma.content['text/plain'] : data.content
|
||||||
|
|
Loading…
Reference in a new issue