2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2023-01-06 05:40:17 +01:00
|
|
|
<div class="_gaps_m">
|
2023-05-14 03:21:56 +02:00
|
|
|
<div :class="$style.avatarAndBanner" :style="{ backgroundImage: $i.bannerUrl ? `url(${ $i.bannerUrl })` : null }">
|
|
|
|
<div :class="$style.avatarContainer">
|
2023-10-22 09:05:32 +02:00
|
|
|
<MkAvatar :class="$style.avatar" :user="$i" forceShowDecoration @click="changeAvatar"/>
|
2023-06-01 10:19:46 +02:00
|
|
|
<MkButton primary rounded @click="changeAvatar">{{ i18n.ts._profile.changeAvatar }}</MkButton>
|
2020-11-28 16:18:54 +01:00
|
|
|
</div>
|
2023-05-14 03:21:56 +02:00
|
|
|
<MkButton primary rounded :class="$style.bannerEdit" @click="changeBanner">{{ i18n.ts._profile.changeBanner }}</MkButton>
|
2021-11-28 12:07:37 +01:00
|
|
|
</div>
|
2020-11-25 13:31:34 +01:00
|
|
|
|
2023-05-19 02:43:38 +02:00
|
|
|
<MkInput v-model="profile.name" :max="30" manualSave>
|
2022-01-28 03:39:49 +01:00
|
|
|
<template #label>{{ i18n.ts._profile.name }}</template>
|
2023-01-07 07:09:46 +01:00
|
|
|
</MkInput>
|
2020-11-25 13:31:34 +01:00
|
|
|
|
2023-05-19 02:43:38 +02:00
|
|
|
<MkTextarea v-model="profile.description" :max="500" tall manualSave>
|
2022-01-28 03:39:49 +01:00
|
|
|
<template #label>{{ i18n.ts._profile.description }}</template>
|
|
|
|
<template #caption>{{ i18n.ts._profile.youCanIncludeHashtags }}</template>
|
2023-01-07 07:09:46 +01:00
|
|
|
</MkTextarea>
|
2020-11-25 13:31:34 +01:00
|
|
|
|
2023-05-19 02:43:38 +02:00
|
|
|
<MkInput v-model="profile.location" manualSave>
|
2022-01-28 03:39:49 +01:00
|
|
|
<template #label>{{ i18n.ts.location }}</template>
|
2022-12-20 07:24:31 +01:00
|
|
|
<template #prefix><i class="ti ti-map-pin"></i></template>
|
2023-01-07 07:09:46 +01:00
|
|
|
</MkInput>
|
2020-11-25 13:31:34 +01:00
|
|
|
|
2023-05-19 02:43:38 +02:00
|
|
|
<MkInput v-model="profile.birthday" type="date" manualSave>
|
2022-01-28 03:39:49 +01:00
|
|
|
<template #label>{{ i18n.ts.birthday }}</template>
|
2022-12-20 07:24:31 +01:00
|
|
|
<template #prefix><i class="ti ti-cake"></i></template>
|
2023-01-07 07:09:46 +01:00
|
|
|
</MkInput>
|
2020-11-25 13:31:34 +01:00
|
|
|
|
2023-01-07 07:09:46 +01:00
|
|
|
<MkSelect v-model="profile.lang">
|
2022-01-28 03:39:49 +01:00
|
|
|
<template #label>{{ i18n.ts.language }}</template>
|
2022-02-26 07:13:44 +01:00
|
|
|
<option v-for="x in Object.keys(langmap)" :key="x" :value="x">{{ langmap[x].nativeName }}</option>
|
2023-01-07 07:09:46 +01:00
|
|
|
</MkSelect>
|
2021-02-13 04:28:26 +01:00
|
|
|
|
2023-01-05 13:04:56 +01:00
|
|
|
<FormSlot>
|
2023-01-09 01:41:25 +01:00
|
|
|
<MkFolder>
|
2022-12-20 07:24:31 +01:00
|
|
|
<template #icon><i class="ti ti-list"></i></template>
|
2022-02-20 08:53:06 +01:00
|
|
|
<template #label>{{ i18n.ts._profile.metadataEdit }}</template>
|
|
|
|
|
2023-05-06 00:06:12 +02:00
|
|
|
<div :class="$style.metadataRoot">
|
|
|
|
<div :class="$style.metadataMargin">
|
enhance: account migration (#10592)
* copy block and mute then create follow and unfollow jobs
* copy block and mute and update lists when detecting an account has moved
* no need to care promise orders
* refactor updating actor and target
* automatically accept if a locked account had accepted an old account
* fix exception format
* prevent the old account from calling some endpoints
* do not unfollow when moving
* adjust following and follower counts
* check movedToUri when receiving a follow request
* skip if no need to adjust
* Revert "disable account migration"
This reverts commit 2321214c98591bcfe1385c1ab5bf0ff7b471ae1d.
* fix translation specifier
* fix checking alsoKnownAs and uri
* fix updating account
* fix refollowing locked account
* decrease followersCount if followed by the old account
* adjust following and followers counts when unfollowing
* fix copying mutings
* prohibit moved account from moving again
* fix move service
* allow app creation after moving
* fix lint
* remove unnecessary field
* fix cache update
* add e2e test
* add e2e test of accepting the new account automatically
* force follow if any error happens
* remove unnecessary joins
* use Array.map instead of for const of
* ユーザーリストの移行は追加のみを行う
* nanka iroiro
* fix misskey-js?
* :v:
* 移行を行ったアカウントからのフォローリクエストの自動許可を調整
* newUriを外に出す
* newUriを外に出す2
* clean up
* fix newUri
* prevent moving if the destination account has already moved
* set alsoKnownAs via /i/update
* fix database initialization
* add return type
* prohibit updating alsoKnownAs after moving
* skip to add to alsoKnownAs if toUrl is known
* skip adding to the list if it already has
* use Acct.parse instead
* rename error code
* :art:
* 制限を5から10に緩和
* movedTo(Uri), alsoKnownAsはユーザーidを返すように
* test api res
* fix
* 元アカウントはミュートし続ける
* :art:
* unfollow
* fix
* getUserUriをUserEntityServiceに
* ?
* job!
* :art:
* instance => server
* accountMovedShort, forbiddenBecauseYouAreMigrated
* accountMovedShort
* fix test
* import, pin禁止
* 実績を凍結する
* clean up
* :v:
* change message
* ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに
* Revert "ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに"
This reverts commit 3bd7be35d8aa455cb01ae58f8172a71a50485db1.
* validateAlsoKnownAs
* 移行後2時間以内はインポート可能なファイルサイズを拡大
* clean up
* どうせactorをupdatePersonで更新するならupdatePersonしか移行処理を発行しないことにする
* handle error?
* リモートからの移行処理の条件を是正
* log, port
* fix
* fix
* enhance(dev): non-production環境でhttpサーバー間でもユーザー、ノートの連合が可能なように
* refactor (use checkHttps)
* MISSKEY_WEBFINGER_USE_HTTP
* Environment Variable readme
* NEVER USE IN PRODUCTION
* fix punyHost
* fix indent
* fix
* experimental
---------
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-04-29 17:09:29 +02:00
|
|
|
<MkButton :disabled="fields.length >= 16" inline style="margin-right: 8px;" @click="addField"><i class="ti ti-plus"></i> {{ i18n.ts.add }}</MkButton>
|
2023-05-06 00:06:12 +02:00
|
|
|
<MkButton v-if="!fieldEditMode" :disabled="fields.length <= 1" inline danger style="margin-right: 8px;" @click="fieldEditMode = !fieldEditMode"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
|
|
|
|
<MkButton v-else inline style="margin-right: 8px;" @click="fieldEditMode = !fieldEditMode"><i class="ti ti-arrows-sort"></i> {{ i18n.ts.rearrange }}</MkButton>
|
enhance: account migration (#10592)
* copy block and mute then create follow and unfollow jobs
* copy block and mute and update lists when detecting an account has moved
* no need to care promise orders
* refactor updating actor and target
* automatically accept if a locked account had accepted an old account
* fix exception format
* prevent the old account from calling some endpoints
* do not unfollow when moving
* adjust following and follower counts
* check movedToUri when receiving a follow request
* skip if no need to adjust
* Revert "disable account migration"
This reverts commit 2321214c98591bcfe1385c1ab5bf0ff7b471ae1d.
* fix translation specifier
* fix checking alsoKnownAs and uri
* fix updating account
* fix refollowing locked account
* decrease followersCount if followed by the old account
* adjust following and followers counts when unfollowing
* fix copying mutings
* prohibit moved account from moving again
* fix move service
* allow app creation after moving
* fix lint
* remove unnecessary field
* fix cache update
* add e2e test
* add e2e test of accepting the new account automatically
* force follow if any error happens
* remove unnecessary joins
* use Array.map instead of for const of
* ユーザーリストの移行は追加のみを行う
* nanka iroiro
* fix misskey-js?
* :v:
* 移行を行ったアカウントからのフォローリクエストの自動許可を調整
* newUriを外に出す
* newUriを外に出す2
* clean up
* fix newUri
* prevent moving if the destination account has already moved
* set alsoKnownAs via /i/update
* fix database initialization
* add return type
* prohibit updating alsoKnownAs after moving
* skip to add to alsoKnownAs if toUrl is known
* skip adding to the list if it already has
* use Acct.parse instead
* rename error code
* :art:
* 制限を5から10に緩和
* movedTo(Uri), alsoKnownAsはユーザーidを返すように
* test api res
* fix
* 元アカウントはミュートし続ける
* :art:
* unfollow
* fix
* getUserUriをUserEntityServiceに
* ?
* job!
* :art:
* instance => server
* accountMovedShort, forbiddenBecauseYouAreMigrated
* accountMovedShort
* fix test
* import, pin禁止
* 実績を凍結する
* clean up
* :v:
* change message
* ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに
* Revert "ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに"
This reverts commit 3bd7be35d8aa455cb01ae58f8172a71a50485db1.
* validateAlsoKnownAs
* 移行後2時間以内はインポート可能なファイルサイズを拡大
* clean up
* どうせactorをupdatePersonで更新するならupdatePersonしか移行処理を発行しないことにする
* handle error?
* リモートからの移行処理の条件を是正
* log, port
* fix
* fix
* enhance(dev): non-production環境でhttpサーバー間でもユーザー、ノートの連合が可能なように
* refactor (use checkHttps)
* MISSKEY_WEBFINGER_USE_HTTP
* Environment Variable readme
* NEVER USE IN PRODUCTION
* fix punyHost
* fix indent
* fix
* experimental
---------
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-04-29 17:09:29 +02:00
|
|
|
<MkButton inline primary @click="saveFields"><i class="ti ti-check"></i> {{ i18n.ts.save }}</MkButton>
|
|
|
|
</div>
|
2023-05-06 00:06:12 +02:00
|
|
|
|
|
|
|
<Sortable
|
|
|
|
v-model="fields"
|
|
|
|
class="_gaps_s"
|
2023-05-19 02:43:38 +02:00
|
|
|
itemKey="id"
|
2023-05-06 00:06:12 +02:00
|
|
|
:animation="150"
|
|
|
|
:handle="'.' + $style.dragItemHandle"
|
|
|
|
@start="e => e.item.classList.add('active')"
|
|
|
|
@end="e => e.item.classList.remove('active')"
|
|
|
|
>
|
|
|
|
<template #item="{element, index}">
|
|
|
|
<div :class="$style.fieldDragItem">
|
|
|
|
<button v-if="!fieldEditMode" class="_button" :class="$style.dragItemHandle" tabindex="-1"><i class="ti ti-menu"></i></button>
|
|
|
|
<button v-if="fieldEditMode" :disabled="fields.length <= 1" class="_button" :class="$style.dragItemRemove" @click="deleteField(index)"><i class="ti ti-x"></i></button>
|
|
|
|
<div :class="$style.dragItemForm">
|
2023-05-19 02:43:38 +02:00
|
|
|
<FormSplit :minWidth="200">
|
2023-05-06 00:06:12 +02:00
|
|
|
<MkInput v-model="element.name" small>
|
|
|
|
<template #label>{{ i18n.ts._profile.metadataLabel }}</template>
|
|
|
|
</MkInput>
|
|
|
|
<MkInput v-model="element.value" small>
|
|
|
|
<template #label>{{ i18n.ts._profile.metadataContent }}</template>
|
|
|
|
</MkInput>
|
|
|
|
</FormSplit>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</Sortable>
|
2023-09-21 08:14:08 +02:00
|
|
|
|
|
|
|
<MkInfo>{{ i18n.ts._profile.verifiedLinkDescription }}</MkInfo>
|
2022-02-20 08:53:06 +01:00
|
|
|
</div>
|
2023-01-09 01:41:25 +01:00
|
|
|
</MkFolder>
|
2022-01-28 03:39:49 +01:00
|
|
|
<template #caption>{{ i18n.ts._profile.metadataDescription }}</template>
|
2021-11-28 12:07:37 +01:00
|
|
|
</FormSlot>
|
2020-11-25 13:31:34 +01:00
|
|
|
|
2023-10-21 11:38:07 +02:00
|
|
|
<MkFolder>
|
|
|
|
<template #icon><i class="ti ti-sparkles"></i></template>
|
|
|
|
<template #label>{{ i18n.ts.avatarDecorations }}</template>
|
|
|
|
|
|
|
|
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-gap: 12px;">
|
|
|
|
<div
|
|
|
|
v-for="avatarDecoration in avatarDecorations"
|
|
|
|
:key="avatarDecoration.id"
|
|
|
|
:class="[$style.avatarDecoration, { [$style.avatarDecorationActive]: $i.avatarDecorations.some(x => x.id === avatarDecoration.id) }]"
|
2023-10-22 06:02:24 +02:00
|
|
|
@click="openDecoration(avatarDecoration)"
|
2023-10-21 11:38:07 +02:00
|
|
|
>
|
2023-11-05 00:25:08 +01:00
|
|
|
<div :class="$style.avatarDecorationName"><MkCondensedLine :minScale="0.5">{{ avatarDecoration.name }}</MkCondensedLine></div>
|
2023-10-22 09:16:02 +02:00
|
|
|
<MkAvatar style="width: 60px; height: 60px;" :user="$i" :decoration="{ url: avatarDecoration.url }" forceShowDecoration/>
|
2023-10-24 07:38:15 +02:00
|
|
|
<i v-if="avatarDecoration.roleIdsThatCanBeUsedThisDecoration.length > 0 && !$i.roles.some(r => avatarDecoration.roleIdsThatCanBeUsedThisDecoration.includes(r.id))" :class="$style.avatarDecorationLock" class="ti ti-lock"></i>
|
2023-10-21 11:38:07 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</MkFolder>
|
|
|
|
|
2023-01-09 01:41:25 +01:00
|
|
|
<MkFolder>
|
2022-12-27 06:25:20 +01:00
|
|
|
<template #label>{{ i18n.ts.advancedSettings }}</template>
|
|
|
|
|
2023-01-06 05:40:17 +01:00
|
|
|
<div class="_gaps_m">
|
2023-11-02 08:51:03 +01:00
|
|
|
<MkSwitch :disabled="profile.isGorilla" v-model="profile.isCat">{{ i18n.ts.flagAsCat }}<template #caption>{{ i18n.ts.flagAsCatDescription }}</template></MkSwitch>
|
|
|
|
<MkSwitch :disabled="profile.isCat" v-model="profile.isGorilla">{{ i18n.ts.flagAsGorilla }}<template #caption>{{ i18n.ts.flagAsGorillaDescription }}</template></MkSwitch>
|
2023-01-07 06:59:54 +01:00
|
|
|
<MkSwitch v-model="profile.isBot">{{ i18n.ts.flagAsBot }}<template #caption>{{ i18n.ts.flagAsBotDescription }}</template></MkSwitch>
|
2022-12-27 06:25:20 +01:00
|
|
|
</div>
|
2023-01-09 01:41:25 +01:00
|
|
|
</MkFolder>
|
2022-12-27 06:25:20 +01:00
|
|
|
|
2023-03-08 00:56:47 +01:00
|
|
|
<MkSelect v-model="reactionAcceptance">
|
|
|
|
<template #label>{{ i18n.ts.reactionAcceptance }}</template>
|
|
|
|
<option :value="null">{{ i18n.ts.all }}</option>
|
|
|
|
<option value="likeOnlyForRemote">{{ i18n.ts.likeOnlyForRemote }}</option>
|
2023-05-19 02:43:38 +02:00
|
|
|
<option value="nonSensitiveOnly">{{ i18n.ts.nonSensitiveOnly }}</option>
|
|
|
|
<option value="nonSensitiveOnlyForLocalLikeOnlyForRemote">{{ i18n.ts.nonSensitiveOnlyForLocalLikeOnlyForRemote }}</option>
|
|
|
|
<option value="likeOnly">{{ i18n.ts.likeOnly }}</option>
|
2023-03-08 00:56:47 +01:00
|
|
|
</MkSelect>
|
2021-11-28 12:07:37 +01:00
|
|
|
</div>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
2022-01-16 13:31:09 +01:00
|
|
|
<script lang="ts" setup>
|
2023-05-06 00:06:12 +02:00
|
|
|
import { computed, reactive, ref, watch, defineAsyncComponent, onMounted, onUnmounted } from 'vue';
|
2022-09-06 11:21:49 +02:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-01-07 07:09:46 +01:00
|
|
|
import MkInput from '@/components/MkInput.vue';
|
|
|
|
import MkTextarea from '@/components/MkTextarea.vue';
|
2023-01-07 06:59:54 +01:00
|
|
|
import MkSwitch from '@/components/MkSwitch.vue';
|
2023-01-07 07:09:46 +01:00
|
|
|
import MkSelect from '@/components/MkSelect.vue';
|
2022-02-20 08:53:06 +01:00
|
|
|
import FormSplit from '@/components/form/split.vue';
|
2023-01-09 01:41:25 +01:00
|
|
|
import MkFolder from '@/components/MkFolder.vue';
|
2021-11-28 12:07:37 +01:00
|
|
|
import FormSlot from '@/components/form/slot.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { selectFile } from '@/scripts/select-file.js';
|
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { $i } from '@/account.js';
|
|
|
|
import { langmap } from '@/scripts/langmap.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|
|
|
import { claimAchievement } from '@/scripts/achievements.js';
|
|
|
|
import { defaultStore } from '@/store.js';
|
2023-09-21 08:14:08 +02:00
|
|
|
import MkInfo from '@/components/MkInfo.vue';
|
2023-03-08 00:56:47 +01:00
|
|
|
|
2023-05-06 00:06:12 +02:00
|
|
|
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
|
|
|
|
|
2023-03-08 00:56:47 +01:00
|
|
|
const reactionAcceptance = computed(defaultStore.makeGetterSetter('reactionAcceptance'));
|
2023-10-21 11:38:07 +02:00
|
|
|
let avatarDecorations: any[] = $ref([]);
|
2022-01-16 13:31:09 +01:00
|
|
|
|
|
|
|
const profile = reactive({
|
|
|
|
name: $i.name,
|
|
|
|
description: $i.description,
|
|
|
|
location: $i.location,
|
|
|
|
birthday: $i.birthday,
|
|
|
|
lang: $i.lang,
|
|
|
|
isBot: $i.isBot,
|
|
|
|
isCat: $i.isCat,
|
2023-11-02 08:51:03 +01:00
|
|
|
isGorilla: $i.isGorilla,
|
2022-01-16 13:31:09 +01:00
|
|
|
});
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2022-01-16 13:31:09 +01:00
|
|
|
watch(() => profile, () => {
|
|
|
|
save();
|
|
|
|
}, {
|
|
|
|
deep: true,
|
|
|
|
});
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2023-05-06 00:06:12 +02:00
|
|
|
const fields = ref($i?.fields.map(field => ({ id: Math.random().toString(), name: field.name, value: field.value })) ?? []);
|
|
|
|
const fieldEditMode = ref(false);
|
2022-02-20 08:53:06 +01:00
|
|
|
|
2023-10-21 11:38:07 +02:00
|
|
|
os.api('get-avatar-decorations').then(_avatarDecorations => {
|
|
|
|
avatarDecorations = _avatarDecorations;
|
|
|
|
});
|
|
|
|
|
2022-02-20 08:53:06 +01:00
|
|
|
function addField() {
|
2023-05-06 00:06:12 +02:00
|
|
|
fields.value.push({
|
|
|
|
id: Math.random().toString(),
|
2022-02-20 08:53:06 +01:00
|
|
|
name: '',
|
|
|
|
value: '',
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-05-06 00:06:12 +02:00
|
|
|
while (fields.value.length < 4) {
|
2022-02-20 08:53:06 +01:00
|
|
|
addField();
|
|
|
|
}
|
|
|
|
|
2023-06-09 07:08:35 +02:00
|
|
|
function deleteField(index: number) {
|
2023-05-06 00:06:12 +02:00
|
|
|
fields.value.splice(index, 1);
|
|
|
|
}
|
|
|
|
|
2022-02-20 08:53:06 +01:00
|
|
|
function saveFields() {
|
|
|
|
os.apiWithDialog('i/update', {
|
2023-05-06 00:06:12 +02:00
|
|
|
fields: fields.value.filter(field => field.name !== '' && field.value !== '').map(field => ({ name: field.name, value: field.value })),
|
2022-02-20 08:53:06 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-01-16 13:31:09 +01:00
|
|
|
function save() {
|
|
|
|
os.apiWithDialog('i/update', {
|
2023-03-10 10:48:57 +01:00
|
|
|
// 空文字列をnullにしたいので??は使うな
|
|
|
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
|
|
name: profile.name || null,
|
|
|
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
|
|
description: profile.description || null,
|
|
|
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
|
|
location: profile.location || null,
|
|
|
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
|
|
birthday: profile.birthday || null,
|
|
|
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
|
|
lang: profile.lang || null,
|
2022-01-16 13:31:09 +01:00
|
|
|
isBot: !!profile.isBot,
|
|
|
|
isCat: !!profile.isCat,
|
2023-11-02 08:51:03 +01:00
|
|
|
isGorilla: !!profile.isGorilla,
|
2022-01-16 13:31:09 +01:00
|
|
|
});
|
2023-01-21 05:14:55 +01:00
|
|
|
claimAchievement('profileFilled');
|
|
|
|
if (profile.name === 'syuilo' || profile.name === 'しゅいろ') {
|
|
|
|
claimAchievement('setNameToSyuilo');
|
|
|
|
}
|
|
|
|
if (profile.isCat) {
|
|
|
|
claimAchievement('markedAsCat');
|
|
|
|
}
|
2023-11-02 08:51:03 +01:00
|
|
|
if (profile.isGorilla) {
|
2023-11-04 02:12:13 +01:00
|
|
|
claimAchievement('markedAsGorilla');
|
2023-11-02 08:51:03 +01:00
|
|
|
}
|
2022-01-16 13:31:09 +01:00
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-01-16 13:31:09 +01:00
|
|
|
function changeAvatar(ev) {
|
2022-01-28 03:53:12 +01:00
|
|
|
selectFile(ev.currentTarget ?? ev.target, i18n.ts.avatar).then(async (file) => {
|
2022-06-11 08:45:44 +02:00
|
|
|
let originalOrCropped = file;
|
|
|
|
|
|
|
|
const { canceled } = await os.confirm({
|
|
|
|
type: 'question',
|
|
|
|
text: i18n.t('cropImageAsk'),
|
2023-02-10 02:45:32 +01:00
|
|
|
okText: i18n.ts.cropYes,
|
|
|
|
cancelText: i18n.ts.cropNo,
|
2022-06-11 08:45:44 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
if (!canceled) {
|
|
|
|
originalOrCropped = await os.cropImage(file, {
|
|
|
|
aspectRatio: 1,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-01-16 13:31:09 +01:00
|
|
|
const i = await os.apiWithDialog('i/update', {
|
2022-06-11 08:45:44 +02:00
|
|
|
avatarId: originalOrCropped.id,
|
2022-01-16 13:31:09 +01:00
|
|
|
});
|
|
|
|
$i.avatarId = i.avatarId;
|
|
|
|
$i.avatarUrl = i.avatarUrl;
|
2023-01-21 05:14:55 +01:00
|
|
|
claimAchievement('profileFilled');
|
2022-01-16 13:31:09 +01:00
|
|
|
});
|
|
|
|
}
|
2021-02-13 04:28:26 +01:00
|
|
|
|
2022-01-16 13:31:09 +01:00
|
|
|
function changeBanner(ev) {
|
2022-01-28 03:53:12 +01:00
|
|
|
selectFile(ev.currentTarget ?? ev.target, i18n.ts.banner).then(async (file) => {
|
2022-06-11 08:45:44 +02:00
|
|
|
let originalOrCropped = file;
|
|
|
|
|
|
|
|
const { canceled } = await os.confirm({
|
|
|
|
type: 'question',
|
|
|
|
text: i18n.t('cropImageAsk'),
|
2023-02-10 02:45:32 +01:00
|
|
|
okText: i18n.ts.cropYes,
|
|
|
|
cancelText: i18n.ts.cropNo,
|
2022-06-11 08:45:44 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
if (!canceled) {
|
|
|
|
originalOrCropped = await os.cropImage(file, {
|
|
|
|
aspectRatio: 2,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-01-16 13:31:09 +01:00
|
|
|
const i = await os.apiWithDialog('i/update', {
|
2022-06-11 08:45:44 +02:00
|
|
|
bannerId: originalOrCropped.id,
|
2022-01-16 13:31:09 +01:00
|
|
|
});
|
|
|
|
$i.bannerId = i.bannerId;
|
|
|
|
$i.bannerUrl = i.bannerUrl;
|
|
|
|
});
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2023-10-22 06:02:24 +02:00
|
|
|
function openDecoration(avatarDecoration) {
|
|
|
|
os.popup(defineAsyncComponent(() => import('./profile.avatar-decoration-dialog.vue')), {
|
|
|
|
decoration: avatarDecoration,
|
|
|
|
}, {}, 'closed');
|
2023-10-21 11:38:07 +02:00
|
|
|
}
|
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.profile,
|
2022-12-19 11:01:30 +01:00
|
|
|
icon: 'ti ti-user',
|
2020-01-29 20:37:25 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2023-05-14 03:21:56 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.avatarAndBanner {
|
2020-11-28 16:18:54 +01:00
|
|
|
position: relative;
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center;
|
2022-07-17 22:03:39 +02:00
|
|
|
border: solid 1px var(--divider);
|
2021-11-28 12:07:37 +01:00
|
|
|
border-radius: 10px;
|
2022-07-13 14:41:06 +02:00
|
|
|
overflow: clip;
|
2023-05-14 03:21:56 +02:00
|
|
|
}
|
2020-01-29 23:13:36 +01:00
|
|
|
|
2023-05-14 03:21:56 +02:00
|
|
|
.avatarContainer {
|
|
|
|
display: inline-block;
|
|
|
|
text-align: center;
|
|
|
|
padding: 16px;
|
|
|
|
}
|
2021-11-28 12:07:37 +01:00
|
|
|
|
2023-05-14 03:21:56 +02:00
|
|
|
.avatar {
|
|
|
|
display: inline-block;
|
|
|
|
width: 72px;
|
|
|
|
height: 72px;
|
|
|
|
margin: 0 auto 16px auto;
|
|
|
|
}
|
2020-11-28 16:18:54 +01:00
|
|
|
|
2023-05-14 03:21:56 +02:00
|
|
|
.bannerEdit {
|
|
|
|
position: absolute;
|
|
|
|
top: 16px;
|
|
|
|
right: 16px;
|
|
|
|
}
|
|
|
|
|
2023-05-06 00:06:12 +02:00
|
|
|
.metadataRoot {
|
|
|
|
container-type: inline-size;
|
|
|
|
}
|
|
|
|
|
|
|
|
.metadataMargin {
|
|
|
|
margin-bottom: 1.5em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fieldDragItem {
|
|
|
|
display: flex;
|
|
|
|
padding-bottom: .75em;
|
|
|
|
align-items: flex-end;
|
|
|
|
border-bottom: solid 0.5px var(--divider);
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
border-bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* (drag button) 32px + (drag button margin) 8px + (input width) 200px * 2 + (input gap) 12px = 452px */
|
|
|
|
@container (max-width: 452px) {
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dragItemHandle {
|
|
|
|
cursor: grab;
|
|
|
|
width: 32px;
|
|
|
|
height: 32px;
|
|
|
|
margin: 0 8px 0 0;
|
|
|
|
opacity: 0.5;
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
cursor: grabbing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dragItemRemove {
|
|
|
|
@extend .dragItemHandle;
|
|
|
|
|
|
|
|
color: #ff2a2a;
|
|
|
|
opacity: 1;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover, &:focus {
|
|
|
|
opacity: .7;
|
|
|
|
}
|
|
|
|
&:active {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dragItemForm {
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
2023-10-21 11:38:07 +02:00
|
|
|
|
|
|
|
.avatarDecoration {
|
|
|
|
cursor: pointer;
|
2023-10-22 02:43:55 +02:00
|
|
|
padding: 16px 16px 28px 16px;
|
2023-10-21 11:38:07 +02:00
|
|
|
border: solid 2px var(--divider);
|
|
|
|
border-radius: 8px;
|
|
|
|
text-align: center;
|
2023-10-22 02:43:55 +02:00
|
|
|
font-size: 90%;
|
|
|
|
overflow: clip;
|
|
|
|
contain: content;
|
2023-10-21 11:38:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.avatarDecorationActive {
|
2023-10-22 02:43:55 +02:00
|
|
|
background-color: var(--accentedBg);
|
2023-10-21 11:38:07 +02:00
|
|
|
border-color: var(--accent);
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatarDecorationName {
|
|
|
|
position: relative;
|
|
|
|
z-index: 10;
|
|
|
|
font-weight: bold;
|
2023-10-22 02:43:55 +02:00
|
|
|
margin-bottom: 20px;
|
2023-10-21 11:38:07 +02:00
|
|
|
}
|
2023-10-24 07:38:15 +02:00
|
|
|
|
|
|
|
.avatarDecorationLock {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 12px;
|
|
|
|
right: 12px;
|
|
|
|
}
|
2023-05-06 00:06:12 +02:00
|
|
|
</style>
|