summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issue_show/components/edited.vue
blob: d59e6d110322a260572f39e9ae6b4d38f99ead58 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<script>
import timeAgoTooltip from '../../vue_shared/components/time_ago_tooltip.vue';

export default {
  props: {
    updatedAt: {
      type: String,
      required: false,
      default: '',
    },
    updatedByName: {
      type: String,
      required: false,
      default: '',
    },
    updatedByPath: {
      type: String,
      required: false,
      default: '',
    },
  },
  components: {
    timeAgoTooltip,
  },
  computed: {
    hasUpdatedBy() {
      return this.updatedByName && this.updatedByPath;
    },
  },
};
</script>

<template>
  <small
    class="edited-text"
  >
    Edited
    <time-ago-tooltip
      v-if="updatedAt"
      placement="bottom"
      :time="updatedAt"
    />
    <span
      v-if="hasUpdatedBy"
    >
      by
      <a
        class="author_link"
        :href="updatedByPath"
      >
        <span>{{updatedByName}}</span>
      </a>
    </span>
  </small>
</template>