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

48 lines
1.3 KiB
Vue
Raw Normal View History

2018-03-17 18:26:18 +05:30
<script>
2019-09-04 21:01:54 +05:30
import { GlLink } from '@gitlab/ui';
2018-05-09 12:01:36 +05:30
import Icon from '~/vue_shared/components/icon.vue';
2019-09-04 21:01:54 +05:30
import { __, sprintf } from '~/locale';
2018-05-09 12:01:36 +05:30
import Issuable from '~/vue_shared/mixins/issuable';
2019-09-04 21:01:54 +05:30
import issuableStateMixin from '../mixins/issuable_state';
2018-03-17 18:26:18 +05:30
2018-05-09 12:01:36 +05:30
export default {
components: {
Icon,
2019-09-04 21:01:54 +05:30
GlLink,
},
mixins: [Issuable, issuableStateMixin],
computed: {
2020-01-01 13:55:28 +05:30
projectArchivedWarning() {
return __('This project is archived and cannot be commented on.');
},
2019-09-04 21:01:54 +05:30
lockedIssueWarning() {
return sprintf(
__('This %{issuableDisplayName} is locked. Only project members can comment.'),
{ issuableDisplayName: this.issuableDisplayName },
);
},
2018-05-09 12:01:36 +05:30
},
};
2018-03-17 18:26:18 +05:30
</script>
<template>
<div class="disabled-comment text-center">
<span class="issuable-note-warning inline">
2019-02-15 15:39:39 +05:30
<icon :size="16" name="lock" class="icon" />
2020-01-01 13:55:28 +05:30
<span v-if="isProjectArchived">
{{ projectArchivedWarning }}
<gl-link :href="archivedProjectDocsPath" target="_blank" class="learn-more">
{{ __('Learn more') }}
</gl-link>
</span>
2019-09-04 21:01:54 +05:30
2020-01-01 13:55:28 +05:30
<span v-else>
{{ lockedIssueWarning }}
2019-09-04 21:01:54 +05:30
<gl-link :href="lockedIssueDocsPath" target="_blank" class="learn-more">
{{ __('Learn more') }}
</gl-link>
2018-03-17 18:26:18 +05:30
</span>
</span>
</div>
</template>