gitlab-ce/app/assets/javascripts/notes/components/note_signed_out_widget.vue

40 lines
1.0 KiB
Vue

<script>
// eslint-disable-next-line no-restricted-imports
import { mapGetters } from 'vuex';
import SafeHtml from '~/vue_shared/directives/safe_html';
import { __, sprintf } from '~/locale';
export default {
directives: {
SafeHtml,
},
computed: {
...mapGetters(['getNotesDataByProp']),
registerLink() {
return this.getNotesDataByProp('registerPath');
},
signInLink() {
return this.getNotesDataByProp('newSessionPath');
},
signedOutText() {
return sprintf(
__(
'Please %{startTagRegister}register%{endRegisterTag} or %{startTagSignIn}sign in%{endSignInTag} to reply',
),
{
startTagRegister: `<a href="${this.registerLink}">`,
startTagSignIn: `<a href="${this.signInLink}">`,
endRegisterTag: '</a>',
endSignInTag: '</a>',
},
false,
);
},
},
};
</script>
<template>
<div v-safe-html="signedOutText" class="disabled-comment gl-text-center gl-text-secondary"></div>
</template>