note_signed_out_widget.vue 898 字节
Newer Older
1
<script>
2
/* eslint-disable vue/no-v-html */
F
Fatih Acet 已提交
3
import { mapGetters } from 'vuex';
4
import { __, sprintf } from '~/locale';
5

F
Fatih Acet 已提交
6 7 8 9 10
export default {
  computed: {
    ...mapGetters(['getNotesDataByProp']),
    registerLink() {
      return this.getNotesDataByProp('registerPath');
F
Filipa Lacerda 已提交
11
    },
F
Fatih Acet 已提交
12 13 14
    signInLink() {
      return this.getNotesDataByProp('newSessionPath');
    },
15 16 17 18 19 20 21 22 23 24 25 26 27 28
    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,
      );
    },
F
Fatih Acet 已提交
29 30
  },
};
31 32 33
</script>

<template>
34
  <div class="disabled-comment text-center" v-html="signedOutText"></div>
35
</template>