debian-mirror-gitlab/app/assets/javascripts/issues/show/components/edited.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.5 KiB
Vue
Raw Normal View History

2017-08-17 22:00:37 +05:30
<script>
2022-11-25 23:54:43 +05:30
import { GlSprintf } from '@gitlab/ui';
2022-10-11 01:57:18 +05:30
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
2017-08-17 22:00:37 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
2022-10-11 01:57:18 +05:30
TimeAgoTooltip,
2022-11-25 23:54:43 +05:30
GlSprintf,
2018-12-13 13:39:08 +05:30
},
props: {
updatedAt: {
type: String,
required: false,
default: '',
2017-08-17 22:00:37 +05:30
},
2018-12-13 13:39:08 +05:30
updatedByName: {
type: String,
required: false,
default: '',
2017-08-17 22:00:37 +05:30
},
2018-12-13 13:39:08 +05:30
updatedByPath: {
type: String,
required: false,
default: '',
2017-08-17 22:00:37 +05:30
},
2018-12-13 13:39:08 +05:30
},
computed: {
hasUpdatedBy() {
return this.updatedByName && this.updatedByPath;
},
},
};
2017-08-17 22:00:37 +05:30
</script>
<template>
2022-06-21 17:19:12 +05:30
<small class="edited-text js-issue-widgets">
2022-11-25 23:54:43 +05:30
<gl-sprintf v-if="!hasUpdatedBy" :message="__('Edited %{timeago}')">
<template #timeago>
<time-ago-tooltip :time="updatedAt" tooltip-placement="bottom" />
</template>
</gl-sprintf>
<gl-sprintf v-else-if="!updatedAt" :message="__('Edited by %{author}')">
<template #author>
<a :href="updatedByPath" class="author-link gl-hover-text-decoration-underline">
<span>{{ updatedByName }}</span>
</a>
</template>
</gl-sprintf>
<gl-sprintf v-else :message="__('Edited %{timeago} by %{author}')">
<template #timeago>
<time-ago-tooltip :time="updatedAt" tooltip-placement="bottom" />
</template>
<template #author>
<a :href="updatedByPath" class="author-link gl-hover-text-decoration-underline">
<span>{{ updatedByName }}</span>
</a>
</template>
</gl-sprintf>
2017-08-17 22:00:37 +05:30
</small>
</template>