summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_author.js
blob: a01cb8cc202ba0cb08b04bcc3cbb51750b377af2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export default {
  name: 'MRWidgetAuthor',
  props: {
    author: { type: Object, required: true },
    showAuthorName: { type: Boolean, required: false, default: true },
    showAuthorTooltip: { type: Boolean, required: false, default: false },
  },
  template: `
    <a
      :href="author.webUrl || author.web_url"
      class="author-link"
      :class="{ 'has-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>
  `,
};