Welcome to mirror list, hosted at ThFree Co, Russian Federation.

design_note_signed_out.vue « design_notes « components « design_management « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: de3e71c0e9cfa0b3d70b4e83b4355166f15a6bbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<script>
import { GlSprintf, GlLink } from '@gitlab/ui';
import { __ } from '~/locale';

export default {
  components: {
    GlSprintf,
    GlLink,
  },
  props: {
    registerPath: {
      type: String,
      required: true,
    },
    signInPath: {
      type: String,
      required: true,
    },
    isAddDiscussion: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  computed: {
    signedOutText() {
      return this.isAddDiscussion
        ? __(
            'Please %{registerLinkStart}register%{registerLinkEnd} or %{signInLinkStart}sign in%{signInLinkEnd} to start a new discussion.',
          )
        : __(
            'Please %{registerLinkStart}register%{registerLinkEnd} or %{signInLinkStart}sign in%{signInLinkEnd} to reply.',
          );
    },
  },
};
</script>

<template>
  <div class="disabled-comment gl-text-center gl-text-secondary">
    <gl-sprintf :message="signedOutText">
      <template #registerLink="{ content }">
        <gl-link :href="registerPath">{{ content }}</gl-link>
      </template>
      <template #signInLink="{ content }">
        <gl-link :href="signInPath">{{ content }}</gl-link>
      </template>
    </gl-sprintf>
  </div>
</template>