summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkSignupDialog.rules.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2023-10-07 13:13:13 +0900
committerGitHub <noreply@github.com>2023-10-07 13:13:13 +0900
commit5e8c0deab3d62c2c2cfd1fda14dc63179f65257d (patch)
tree230920c73d7350cf22b1cc1dc25880c62317dd52 /packages/frontend/src/components/MkSignupDialog.rules.vue
parentバックエンドのテストの改善 (#11978) (diff)
downloadsharkey-5e8c0deab3d62c2c2cfd1fda14dc63179f65257d.tar.gz
sharkey-5e8c0deab3d62c2c2cfd1fda14dc63179f65257d.tar.bz2
sharkey-5e8c0deab3d62c2c2cfd1fda14dc63179f65257d.zip
プライバシーポリシー・運営者情報のリンクを追加 (#11925)
* 運営者情報・プライバシーポリシーリンクを追加 * Update Changelog * Run api extractor * プライバシーポリシー・利用規約の同意をまとめる * Update Changelog * fix lint * fix * api extractor * improve design * nodeinfoにプライバシーポリシー・運営者情報を追加
Diffstat (limited to 'packages/frontend/src/components/MkSignupDialog.rules.vue')
-rw-r--r--packages/frontend/src/components/MkSignupDialog.rules.vue43
1 files changed, 30 insertions, 13 deletions
diff --git a/packages/frontend/src/components/MkSignupDialog.rules.vue b/packages/frontend/src/components/MkSignupDialog.rules.vue
index aa4a184d7b..76163ab68b 100644
--- a/packages/frontend/src/components/MkSignupDialog.rules.vue
+++ b/packages/frontend/src/components/MkSignupDialog.rules.vue
@@ -30,13 +30,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch :modelValue="agreeServerRules" style="margin-top: 16px;" @update:modelValue="updateAgreeServerRules">{{ i18n.ts.agree }}</MkSwitch>
</MkFolder>
- <MkFolder v-if="availableTos" :defaultOpen="true">
- <template #label>{{ i18n.ts.termsOfService }}</template>
- <template #suffix><i v-if="agreeTos" class="ti ti-check" style="color: var(--success)"></i></template>
+ <MkFolder v-if="availableTos || availablePrivacyPolicy" :defaultOpen="true">
+ <template #label>{{ tosPrivacyPolicyLabel }}</template>
+ <template #suffix><i v-if="agreeTosAndPrivacyPolicy" class="ti ti-check" style="color: var(--success)"></i></template>
+ <div class="_gaps_s">
+ <div v-if="availableTos"><a :href="instance.tosUrl" class="_link" target="_blank">{{ i18n.ts.termsOfService }} <i class="ti ti-external-link"></i></a></div>
+ <div v-if="availablePrivacyPolicy"><a :href="instance.privacyPolicyUrl" class="_link" target="_blank">{{ i18n.ts.privacyPolicy }} <i class="ti ti-external-link"></i></a></div>
+ </div>
- <a :href="instance.tosUrl" class="_link" target="_blank">{{ i18n.ts.termsOfService }} <i class="ti ti-external-link"></i></a>
-
- <MkSwitch :modelValue="agreeTos" style="margin-top: 16px;" @update:modelValue="updateAgreeTos">{{ i18n.ts.agree }}</MkSwitch>
+ <MkSwitch :modelValue="agreeTosAndPrivacyPolicy" style="margin-top: 16px;" @update:modelValue="updateAgreeTosAndPrivacyPolicy">{{ i18n.ts.agree }}</MkSwitch>
</MkFolder>
<MkFolder :defaultOpen="true">
@@ -70,14 +72,15 @@ import MkInfo from '@/components/MkInfo.vue';
import * as os from '@/os.js';
const availableServerRules = instance.serverRules.length > 0;
-const availableTos = instance.tosUrl != null;
+const availableTos = instance.tosUrl != null && instance.tosUrl !== '';
+const availablePrivacyPolicy = instance.privacyPolicyUrl != null && instance.privacyPolicyUrl !== '';
const agreeServerRules = ref(false);
-const agreeTos = ref(false);
+const agreeTosAndPrivacyPolicy = ref(false);
const agreeNote = ref(false);
const agreed = computed(() => {
- return (!availableServerRules || agreeServerRules.value) && (!availableTos || agreeTos.value) && agreeNote.value;
+ return (!availableServerRules || agreeServerRules.value) && ((!availableTos && !availablePrivacyPolicy) || agreeTosAndPrivacyPolicy.value) && agreeNote.value;
});
const emit = defineEmits<{
@@ -85,6 +88,18 @@ const emit = defineEmits<{
(ev: 'done'): void;
}>();
+const tosPrivacyPolicyLabel = computed(() => {
+ if (availableTos && availablePrivacyPolicy) {
+ return i18n.ts.tosAndPrivacyPolicy;
+ } else if (availableTos) {
+ return i18n.ts.termsOfService;
+ } else if (availablePrivacyPolicy) {
+ return i18n.ts.privacyPolicy;
+ } else {
+ return "";
+ }
+});
+
async function updateAgreeServerRules(v: boolean) {
if (v) {
const confirm = await os.confirm({
@@ -99,17 +114,19 @@ async function updateAgreeServerRules(v: boolean) {
}
}
-async function updateAgreeTos(v: boolean) {
+async function updateAgreeTosAndPrivacyPolicy(v: boolean) {
if (v) {
const confirm = await os.confirm({
type: 'question',
title: i18n.ts.doYouAgree,
- text: i18n.t('iHaveReadXCarefullyAndAgree', { x: i18n.ts.termsOfService }),
+ text: i18n.t('iHaveReadXCarefullyAndAgree', {
+ x: tosPrivacyPolicyLabel.value,
+ }),
});
if (confirm.canceled) return;
- agreeTos.value = true;
+ agreeTosAndPrivacyPolicy.value = true;
} else {
- agreeTos.value = false;
+ agreeTosAndPrivacyPolicy.value = false;
}
}