From 384afaa1b570e1581affd616cc439e0a6bdcc229 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Sat, 30 Sep 2023 15:26:01 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=A9=E3=82=A4=E3=83=90=E3=82=B7?= =?UTF-8?q?=E3=83=BC=E3=83=9D=E3=83=AA=E3=82=B7=E3=83=BC=E3=83=BB=E5=88=A9?= =?UTF-8?q?=E7=94=A8=E8=A6=8F=E7=B4=84=E3=81=AE=E5=90=8C=E6=84=8F=E3=82=92?= =?UTF-8?q?=E3=81=BE=E3=81=A8=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 3 + locales/ja-JP.yml | 3 + .../src/components/MkSignupDialog.rules.vue | 67 +++++++++---------- .../frontend/src/pages/admin/moderation.vue | 2 +- .../frontend/src/pages/admin/settings.vue | 2 +- 5 files changed, 38 insertions(+), 39 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 3e0b2e61bc..9f8a616e69 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1130,8 +1130,11 @@ export interface Locale { "mutualFollow": string; "fileAttachedOnly": string; "impressum": string; + "impressumUrl": string; "impressumDescription": string; "privacyPolicy": string; + "privacyPolicyUrl": string; + "tosAndPrivacyPolicy": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 392bfe870b..c840e2f426 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1127,8 +1127,11 @@ notificationRecieveConfig: "通知の受信設定" mutualFollow: "相互フォロー" fileAttachedOnly: "ファイル付きのみ" impressum: "運営者情報" +impressumUrl: "運営者情報URL" impressumDescription: "ドイツなどの一部の国と地域では表示が義務付けられています(Impressum)。" privacyPolicy: "プライバシーポリシー" +privacyPolicyUrl: "プライバシーポリシーURL" +tosAndPrivacyPolicy: "利用規約・プライバシーポリシー" _announcement: forExistingUsers: "既存ユーザーのみ" diff --git a/packages/frontend/src/components/MkSignupDialog.rules.vue b/packages/frontend/src/components/MkSignupDialog.rules.vue index e196cc67f3..74266b310d 100644 --- a/packages/frontend/src/components/MkSignupDialog.rules.vue +++ b/packages/frontend/src/components/MkSignupDialog.rules.vue @@ -30,22 +30,15 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.agree }} - - - + + + + - {{ i18n.ts.termsOfService }} - - {{ i18n.ts.agree }} - - - - - - - {{ i18n.ts.privacyPolicy }} - - {{ i18n.ts.agree }} + {{ i18n.ts.agree }} @@ -79,16 +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 availablePrivacyPolicy = instance.privacyPolicyUrl != null; +const availableTos = instance.tosUrl != null && instance.tosUrl !== ''; +const availablePrivacyPolicy = instance.privacyPolicyUrl != null && instance.privacyPolicyUrl !== ''; const agreeServerRules = ref(false); -const agreeTos = ref(false); -const agreePrivacyPolicy = ref(false); +const agreeTosAndPrivacyPolicy = ref(false); const agreeNote = ref(false); const agreed = computed(() => { - return (!availableServerRules || agreeServerRules.value) && (!availableTos || agreeTos.value) && (!availablePrivacyPolicy || agreePrivacyPolicy.value) && agreeNote.value; + return (!availableServerRules || agreeServerRules.value) && ((!availableTos && !availablePrivacyPolicy) || agreeTosAndPrivacyPolicy.value) && agreeNote.value; }); const emit = defineEmits<{ @@ -96,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({ @@ -110,31 +114,20 @@ 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 }), - }); - if (confirm.canceled) return; - agreeTos.value = true; - } else { - agreeTos.value = false; - } -} -async function updateAgreePrivacyPolicy(v: boolean) { - if (v) { const confirm = await os.confirm({ type: 'question', title: i18n.ts.doYouAgree, - text: i18n.t('iHaveReadXCarefullyAndAgree', { x: i18n.ts.privacyPolicy }), + text: i18n.t('iHaveReadXCarefullyAndAgree', { + x: tosPrivacyPolicyLabel.value, + }), }); if (confirm.canceled) return; - agreePrivacyPolicy.value = true; + agreeTosAndPrivacyPolicy.value = true; } else { - agreePrivacyPolicy.value = false; + agreeTosAndPrivacyPolicy.value = false; } } diff --git a/packages/frontend/src/pages/admin/moderation.vue b/packages/frontend/src/pages/admin/moderation.vue index ce914fae8a..8b160635f7 100644 --- a/packages/frontend/src/pages/admin/moderation.vue +++ b/packages/frontend/src/pages/admin/moderation.vue @@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only - + diff --git a/packages/frontend/src/pages/admin/settings.vue b/packages/frontend/src/pages/admin/settings.vue index 60ea8bb980..559a2e8ba2 100644 --- a/packages/frontend/src/pages/admin/settings.vue +++ b/packages/frontend/src/pages/admin/settings.vue @@ -35,7 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only - +