Read about our upcoming Code of Conduct on this issue

release_block_author.vue 971 Bytes
Newer Older
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
29
<script>
import { __, sprintf } from '~/locale';
import { GlSprintf } from '@gitlab/ui';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';

export default {
  name: 'ReleaseBlockAuthor',
  components: {
    GlSprintf,
    UserAvatarLink,
  },
  props: {
    author: {
      type: Object,
      required: true,
    },
  },
  computed: {
    userImageAltDescription() {
      return this.author && this.author.username
        ? sprintf(__("%{username}'s avatar"), { username: this.author.username })
        : null;
    },
  },
};
</script>

<template>
  <div class="d-flex">
30
    <gl-sprintf :message="__('by %{user}')">
31
32
33
34
35
36
37
38
39
40
41
42
      <template #user>
        <user-avatar-link
          class="prepend-left-4"
          :link-href="author.web_url"
          :img-src="author.avatar_url"
          :img-alt="userImageAltDescription"
          :tooltip-text="author.username"
        />
      </template>
    </gl-sprintf>
  </div>
</template>