debian-mirror-gitlab/app/assets/javascripts/notes/components/note_edited_text.vue

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

78 lines
1.8 KiB
Vue
Raw Normal View History

2018-03-17 18:26:18 +05:30
<script>
2023-05-27 22:25:52 +05:30
import { GlSprintf, GlLink } from '@gitlab/ui';
2022-10-11 01:57:18 +05:30
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
2023-05-27 22:25:52 +05:30
import { EDITED_TEXT } from '../i18n';
2018-03-17 18:26:18 +05:30
2018-05-09 12:01:36 +05:30
export default {
name: 'EditedNoteText',
components: {
2023-05-27 22:25:52 +05:30
GlSprintf,
GlLink,
2022-10-11 01:57:18 +05:30
TimeAgoTooltip,
2018-05-09 12:01:36 +05:30
},
props: {
actionText: {
type: String,
required: true,
2018-03-17 18:26:18 +05:30
},
2018-11-08 19:23:39 +05:30
actionDetailText: {
type: String,
required: false,
default: '',
},
2018-05-09 12:01:36 +05:30
editedAt: {
type: String,
2018-11-08 19:23:39 +05:30
required: false,
default: null,
2018-03-17 18:26:18 +05:30
},
2018-05-09 12:01:36 +05:30
editedBy: {
type: Object,
required: false,
2018-11-08 19:23:39 +05:30
default: null,
2018-05-09 12:01:36 +05:30
},
className: {
type: String,
required: false,
default: 'edited-text',
},
},
2023-05-27 22:25:52 +05:30
i18n: EDITED_TEXT,
2018-05-09 12:01:36 +05:30
};
2018-03-17 18:26:18 +05:30
</script>
<template>
<div :class="className">
2023-05-27 22:25:52 +05:30
<gl-sprintf v-if="editedBy" :message="$options.i18n.actionWithAuthor">
<template #actionText>
{{ actionText }}
</template>
<template #actionDetail>
{{ actionDetailText }}
</template>
<template #timeago>
<time-ago-tooltip :time="editedAt" tooltip-placement="bottom" />
</template>
<template #author>
<gl-link
:href="editedBy.path"
:data-user-id="editedBy.id"
class="js-user-link author-link gl-hover-text-decoration-underline"
>
{{ editedBy.name }}
</gl-link>
</template>
</gl-sprintf>
<gl-sprintf v-else :message="$options.i18n.actionWithoutAuthor">
<template #actionText>
{{ actionText }}
</template>
<template #actionDetail>
{{ actionDetailText }}
</template>
<template #timeago>
<time-ago-tooltip :time="editedAt" tooltip-placement="bottom" />
</template>
</gl-sprintf>
2018-03-17 18:26:18 +05:30
</div>
</template>