summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_author.js
blob: 982b5e8e3731f1da3b29977e47fd4c295739273f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import tooltip from '../../vue_shared/directives/tooltip';

export default {
  name: 'MRWidgetAuthor',
  props: {
    author: { type: Object, required: true },
    showAuthorName: { type: Boolean, required: false, default: true },
    showAuthorTooltip: { type: Boolean, required: false, default: false },
  },
  directives: {
    tooltip,
  },
  template: `
    <a
      :href="author.webUrl || author.web_url"
      class="author-link inline"
      :v-tooltip="showAuthorTooltip"
      :title="author.name">
      <img
        :src="author.avatarUrl || author.avatar_url"
        class="avatar avatar-inline s16" />
      <span
        v-if="showAuthorName"
        class="author">{{author.name}}
      </span>
    </a>
  `,
};