summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issue_show/components/edited.vue
blob: 5ff5b1630b1e2fae40906698b34893be2497012e (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 {
    components: {
      timeAgoTooltip,
    },
    props: {
      updatedAt: {
        type: String,
        required: false,
        default: '',
      },
      updatedByName: {
        type: String,
        required: false,
        default: '',
      },
      updatedByPath: {
        type: String,
        required: false,
        default: '',
      },
    },
    computed: {
      hasUpdatedBy() {
        return this.updatedByName && this.updatedByPath;
      },
    },
  };
</script>

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