diff options
Diffstat (limited to 'src/components/status')
| -rw-r--r-- | src/components/status/status.js | 22 | ||||
| -rw-r--r-- | src/components/status/status.scss | 3 | ||||
| -rw-r--r-- | src/components/status/status.vue | 43 |
3 files changed, 54 insertions, 14 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index b6414ad8..54b54a90 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -13,6 +13,7 @@ import RichContent from 'src/components/rich_content/rich_content.jsx' import StatusPopover from '../status_popover/status_popover.vue' import UserListPopover from '../user_list_popover/user_list_popover.vue' import EmojiReactions from '../emoji_reactions/emoji_reactions.vue' +import MentionLink from 'src/components/mention_link/mention_link.vue' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js' import { muteWordHits } from '../../services/status_parser/status_parser.js' @@ -33,7 +34,8 @@ import { faStar, faEyeSlash, faEye, - faThumbtack + faThumbtack, + faAt, } from '@fortawesome/free-solid-svg-icons' library.add( @@ -50,7 +52,8 @@ library.add( faEllipsisH, faEyeSlash, faEye, - faThumbtack + faThumbtack, + faAt ) const Status = { @@ -70,7 +73,8 @@ const Status = { UserListPopover, EmojiReactions, StatusContent, - RichContent + RichContent, + MentionLink }, props: [ 'statusoid', @@ -133,9 +137,7 @@ const Status = { return this.generateUserProfileLink(this.status.user.id, this.status.user.screen_name) }, replyProfileLink () { - if (this.isReply) { - return this.generateUserProfileLink(this.status.in_reply_to_user_id, this.replyToName) - } + return this.$store.getters.findUser(this.status.in_reply_to_screen_name).statusnet_profile_url }, retweet () { return !!this.statusoid.retweeted_status }, retweeterUser () { return this.statusoid.user }, @@ -159,6 +161,14 @@ const Status = { muteWordHits () { return muteWordHits(this.status, this.muteWords) }, + mentions () { + return this.statusoid.attentions.filter(attn => { + return attn.screen_name !== this.replyToName + }) + }, + hasMentions () { + return this.mentions.length > 0 + }, muted () { if (this.statusoid.user.id === this.currentUser.id) return false const { status } = this diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 82088943..8744fa16 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -155,7 +155,8 @@ $status-margin: 0.75em; margin-right: 0.2em; } - .heading-reply-row { + & .heading-mentions-row, + & .heading-reply-row { position: relative; align-content: baseline; font-size: 12px; diff --git a/src/components/status/status.vue b/src/components/status/status.vue index a4247cd4..092d3834 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -222,6 +222,35 @@ </span> </div> + <div v-if="hasMentions" class="heading-mentions-row"> + <div + class="mentions" + > + <span + class="button-unstyled reply-to" + :aria-label="$t('tool_tip.reply')" + @click.prevent="gotoOriginal(status.in_reply_to_status_id)" + > + <FAIcon + class="fa-scale-110 fa-old-padding" + icon="at" + /> + <span + class="faint-link reply-to-text" + > + {{ $t('status.mentions') }} + </span> + </span> + <MentionLink + v-for="mention in mentions" + class="mention-link" + :key="mention.statusnet_profile_url" + :content="mention.statusnet_profile_url" + :url="mention.statusnet_profile_url" + :first-mention="false" + /> + </div> + </div> <div class="heading-reply-row"> <div v-if="isReply" @@ -258,13 +287,13 @@ > <span class="reply-to-text">{{ $t('status.reply_to') }}</span> </span> - <router-link - class="reply-to-link" - :title="replyToName" - :to="replyProfileLink" - > - {{ replyToName }} - </router-link> + + <MentionLink + class="mention-link" + :content="replyToName" + :url="replyProfileLink" + :first-mention="false" + /> <span v-if="replies && replies.length" class="faint replies-separator" |
