debian-mirror-gitlab/app/assets/javascripts/notes/components/note_edited_text.vue
2019-10-12 21:52:04 +05:30

51 lines
1 KiB
Vue

<script>
/* eslint-disable @gitlab/vue-i18n/no-bare-strings */
import timeAgoTooltip from '../../vue_shared/components/time_ago_tooltip.vue';
export default {
name: 'EditedNoteText',
components: {
timeAgoTooltip,
},
props: {
actionText: {
type: String,
required: true,
},
actionDetailText: {
type: String,
required: false,
default: '',
},
editedAt: {
type: String,
required: false,
default: null,
},
editedBy: {
type: Object,
required: false,
default: null,
},
className: {
type: String,
required: false,
default: 'edited-text',
},
},
};
</script>
<template>
<div :class="className">
{{ actionText }}
<template v-if="editedBy">
by
<a :href="editedBy.path" :data-user-id="editedBy.id" class="js-user-link author-link">
{{ editedBy.name }}
</a>
</template>
{{ actionDetailText }}
<time-ago-tooltip :time="editedAt" tooltip-placement="bottom" />
</div>
</template>