2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
2024-02-13 15:59:27 +00:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 05:31:52 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-04-19 12:24:31 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div :class="$style.banner">
|
|
|
|
<i class="ti ti-checklist"></i>
|
|
|
|
</div>
|
2023-05-19 04:58:09 +00:00
|
|
|
<MkSpacer :marginMin="20" :marginMax="28">
|
2023-04-19 12:24:31 +00:00
|
|
|
<div class="_gaps_m">
|
2023-04-22 07:04:03 +00:00
|
|
|
<div v-if="instance.disableRegistration">
|
|
|
|
<MkInfo warn>{{ i18n.ts.invitationRequiredToRegister }}</MkInfo>
|
|
|
|
</div>
|
|
|
|
|
2023-07-20 01:18:40 +00:00
|
|
|
<div style="text-align: center;">
|
|
|
|
<div>{{ i18n.ts.pleaseConfirmBelowBeforeSignup }}</div>
|
|
|
|
<div style="font-weight: bold; margin-top: 0.5em;">{{ i18n.ts.beSureToReadThisAsItIsImportant }}</div>
|
|
|
|
</div>
|
2023-04-19 12:24:31 +00:00
|
|
|
|
2023-05-19 04:58:09 +00:00
|
|
|
<MkFolder v-if="availableServerRules" :defaultOpen="true">
|
2023-04-19 12:24:31 +00:00
|
|
|
<template #label>{{ i18n.ts.serverRules }}</template>
|
2024-10-09 09:08:14 +00:00
|
|
|
<template #suffix><i v-if="agreeServerRules" class="ti ti-check" style="color: var(--MI_THEME-success)"></i></template>
|
2023-04-19 12:24:31 +00:00
|
|
|
|
|
|
|
<ol class="_gaps_s" :class="$style.rules">
|
|
|
|
<li v-for="item in instance.serverRules" :class="$style.rule"><div :class="$style.ruleText" v-html="item"></div></li>
|
|
|
|
</ol>
|
|
|
|
|
2023-07-20 01:18:40 +00:00
|
|
|
<MkSwitch :modelValue="agreeServerRules" style="margin-top: 16px;" @update:modelValue="updateAgreeServerRules">{{ i18n.ts.agree }}</MkSwitch>
|
2023-04-19 12:24:31 +00:00
|
|
|
</MkFolder>
|
|
|
|
|
2023-10-07 04:13:13 +00:00
|
|
|
<MkFolder v-if="availableTos || availablePrivacyPolicy" :defaultOpen="true">
|
|
|
|
<template #label>{{ tosPrivacyPolicyLabel }}</template>
|
2024-10-09 09:08:14 +00:00
|
|
|
<template #suffix><i v-if="agreeTosAndPrivacyPolicy" class="ti ti-check" style="color: var(--MI_THEME-success)"></i></template>
|
2023-10-07 04:13:13 +00:00
|
|
|
<div class="_gaps_s">
|
2024-01-30 10:53:53 +00:00
|
|
|
<div v-if="availableTos"><a :href="instance.tosUrl ?? undefined" class="_link" target="_blank">{{ i18n.ts.termsOfService }} <i class="ti ti-external-link"></i></a></div>
|
|
|
|
<div v-if="availablePrivacyPolicy"><a :href="instance.privacyPolicyUrl ?? undefined" class="_link" target="_blank">{{ i18n.ts.privacyPolicy }} <i class="ti ti-external-link"></i></a></div>
|
2023-10-07 04:13:13 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<MkSwitch :modelValue="agreeTosAndPrivacyPolicy" style="margin-top: 16px;" @update:modelValue="updateAgreeTosAndPrivacyPolicy">{{ i18n.ts.agree }}</MkSwitch>
|
2023-04-19 12:24:31 +00:00
|
|
|
</MkFolder>
|
|
|
|
|
2023-05-19 04:58:09 +00:00
|
|
|
<MkFolder :defaultOpen="true">
|
2023-04-19 12:24:31 +00:00
|
|
|
<template #label>{{ i18n.ts.basicNotesBeforeCreateAccount }}</template>
|
2024-10-09 09:08:14 +00:00
|
|
|
<template #suffix><i v-if="agreeNote" class="ti ti-check" style="color: var(--MI_THEME-success)"></i></template>
|
2023-04-19 12:24:31 +00:00
|
|
|
|
2023-12-22 11:16:31 +00:00
|
|
|
<a href="https://misskey-hub.net/docs/for-users/onboarding/warning/" class="_link" target="_blank">{{ i18n.ts.basicNotesBeforeCreateAccount }} <i class="ti ti-external-link"></i></a>
|
2023-04-19 12:24:31 +00:00
|
|
|
|
2023-07-20 01:18:40 +00:00
|
|
|
<MkSwitch :modelValue="agreeNote" style="margin-top: 16px;" data-cy-signup-rules-notes-agree @update:modelValue="updateAgreeNote">{{ i18n.ts.agree }}</MkSwitch>
|
2023-04-19 12:24:31 +00:00
|
|
|
</MkFolder>
|
|
|
|
|
2023-04-20 01:11:48 +00:00
|
|
|
<div v-if="!agreed" style="text-align: center;">{{ i18n.ts.pleaseAgreeAllToContinue }}</div>
|
|
|
|
|
|
|
|
<div class="_buttonsCenter">
|
|
|
|
<MkButton inline rounded @click="emit('cancel')">{{ i18n.ts.cancel }}</MkButton>
|
|
|
|
<MkButton inline primary rounded gradate :disabled="!agreed" data-cy-signup-rules-continue @click="emit('done')">{{ i18n.ts.continue }} <i class="ti ti-arrow-right"></i></MkButton>
|
|
|
|
</div>
|
2023-04-19 12:24:31 +00:00
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-12-21 02:36:45 +00:00
|
|
|
import { computed, ref } from 'vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { instance } from '@/instance.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
2023-04-19 12:24:31 +00:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
|
|
|
import MkFolder from '@/components/MkFolder.vue';
|
|
|
|
import MkSwitch from '@/components/MkSwitch.vue';
|
2023-04-22 07:04:03 +00:00
|
|
|
import MkInfo from '@/components/MkInfo.vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import * as os from '@/os.js';
|
2023-04-19 12:24:31 +00:00
|
|
|
|
|
|
|
const availableServerRules = instance.serverRules.length > 0;
|
2023-10-07 04:13:13 +00:00
|
|
|
const availableTos = instance.tosUrl != null && instance.tosUrl !== '';
|
|
|
|
const availablePrivacyPolicy = instance.privacyPolicyUrl != null && instance.privacyPolicyUrl !== '';
|
2023-04-19 12:24:31 +00:00
|
|
|
|
|
|
|
const agreeServerRules = ref(false);
|
2023-10-07 04:13:13 +00:00
|
|
|
const agreeTosAndPrivacyPolicy = ref(false);
|
2023-04-19 12:24:31 +00:00
|
|
|
const agreeNote = ref(false);
|
|
|
|
|
|
|
|
const agreed = computed(() => {
|
2023-10-07 04:13:13 +00:00
|
|
|
return (!availableServerRules || agreeServerRules.value) && ((!availableTos && !availablePrivacyPolicy) || agreeTosAndPrivacyPolicy.value) && agreeNote.value;
|
2023-04-19 12:24:31 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
2023-04-20 01:11:48 +00:00
|
|
|
(ev: 'cancel'): void;
|
|
|
|
(ev: 'done'): void;
|
2023-04-19 12:24:31 +00:00
|
|
|
}>();
|
2023-07-20 01:18:40 +00:00
|
|
|
|
2023-10-07 04:13:13 +00:00
|
|
|
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 {
|
2024-01-30 10:53:53 +00:00
|
|
|
return '';
|
2023-10-07 04:13:13 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-07-20 01:18:40 +00:00
|
|
|
async function updateAgreeServerRules(v: boolean) {
|
|
|
|
if (v) {
|
|
|
|
const confirm = await os.confirm({
|
|
|
|
type: 'question',
|
|
|
|
title: i18n.ts.doYouAgree,
|
2024-01-19 23:11:59 +00:00
|
|
|
text: i18n.tsx.iHaveReadXCarefullyAndAgree({ x: i18n.ts.serverRules }),
|
2023-07-20 01:18:40 +00:00
|
|
|
});
|
|
|
|
if (confirm.canceled) return;
|
|
|
|
agreeServerRules.value = true;
|
|
|
|
} else {
|
|
|
|
agreeServerRules.value = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-07 04:13:13 +00:00
|
|
|
async function updateAgreeTosAndPrivacyPolicy(v: boolean) {
|
2023-07-20 01:18:40 +00:00
|
|
|
if (v) {
|
|
|
|
const confirm = await os.confirm({
|
|
|
|
type: 'question',
|
|
|
|
title: i18n.ts.doYouAgree,
|
2024-01-19 23:11:59 +00:00
|
|
|
text: i18n.tsx.iHaveReadXCarefullyAndAgree({
|
2023-10-07 04:13:13 +00:00
|
|
|
x: tosPrivacyPolicyLabel.value,
|
|
|
|
}),
|
2023-07-20 01:18:40 +00:00
|
|
|
});
|
|
|
|
if (confirm.canceled) return;
|
2023-10-07 04:13:13 +00:00
|
|
|
agreeTosAndPrivacyPolicy.value = true;
|
2023-07-20 01:18:40 +00:00
|
|
|
} else {
|
2023-10-07 04:13:13 +00:00
|
|
|
agreeTosAndPrivacyPolicy.value = false;
|
2023-07-20 01:18:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async function updateAgreeNote(v: boolean) {
|
|
|
|
if (v) {
|
|
|
|
const confirm = await os.confirm({
|
|
|
|
type: 'question',
|
|
|
|
title: i18n.ts.doYouAgree,
|
2024-01-19 23:11:59 +00:00
|
|
|
text: i18n.tsx.iHaveReadXCarefullyAndAgree({ x: i18n.ts.basicNotesBeforeCreateAccount }),
|
2023-07-20 01:18:40 +00:00
|
|
|
});
|
|
|
|
if (confirm.canceled) return;
|
|
|
|
agreeNote.value = true;
|
|
|
|
} else {
|
|
|
|
agreeNote.value = false;
|
|
|
|
}
|
|
|
|
}
|
2023-04-19 12:24:31 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.banner {
|
|
|
|
padding: 16px;
|
|
|
|
text-align: center;
|
|
|
|
font-size: 26px;
|
2024-10-09 09:08:14 +00:00
|
|
|
background-color: var(--MI_THEME-accentedBg);
|
|
|
|
color: var(--MI_THEME-accent);
|
2023-04-19 12:24:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.rules {
|
|
|
|
counter-reset: item;
|
|
|
|
list-style: none;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rule {
|
|
|
|
display: flex;
|
|
|
|
gap: 8px;
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
flex-shrink: 0;
|
|
|
|
display: flex;
|
|
|
|
position: sticky;
|
|
|
|
top: calc(var(--stickyTop, 0px) + 8px);
|
|
|
|
counter-increment: item;
|
|
|
|
content: counter(item);
|
|
|
|
width: 32px;
|
|
|
|
height: 32px;
|
|
|
|
line-height: 32px;
|
2024-10-09 09:08:14 +00:00
|
|
|
background-color: var(--MI_THEME-accentedBg);
|
|
|
|
color: var(--MI_THEME-accent);
|
2023-04-19 12:24:31 +00:00
|
|
|
font-size: 13px;
|
|
|
|
font-weight: bold;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
border-radius: 999px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.ruleText {
|
|
|
|
padding-top: 6px;
|
|
|
|
}
|
|
|
|
</style>
|