Backport of mr_widget_author.vue EE changes

This commit is contained in:
Phil Hughes 2018-02-02 14:33:02 +00:00
parent 54a575f1bb
commit 9b7971379e
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
1 changed files with 21 additions and 1 deletions

View File

@ -1,11 +1,26 @@
<script>
import tooltip from '../../vue_shared/directives/tooltip';
export default {
name: 'MRWidgetAuthor',
directives: {
tooltip,
},
props: {
author: {
type: Object,
required: true,
},
showAuthorName: {
type: Boolean,
required: false,
default: true,
},
showAuthorTooltip: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
authorUrl() {
@ -21,12 +36,17 @@
<a
:href="authorUrl"
class="author-link inline"
:v-tooltip="showAuthorTooltip"
:title="author.name"
>
<img
:src="avatarUrl"
class="avatar avatar-inline s16"
/>
<span class="author">
<span
class="author"
v-if="showAuthorName"
>
{{ author.name }}
</span>
</a>