Отключить мультиаккаунтность и уточнить статусы профиля

This commit is contained in:
AidarKC
2026-11-27 13:22:15 +03:00
parent ae430e84c7
commit 91a8bb9c3c
40 changed files with 312 additions and 383 deletions
+8 -12
View File
@@ -15,7 +15,7 @@ export function escapeProfileHtml(text) {
const esc = escapeProfileHtml;
// Карточка статуса у аватара: кто подтвердил этот аккаунт и кого подтвердил он сам.
function statusSideHtml({ kind, title, active, received, given, verb }) {
function statusSideHtml({ kind, title, active, received, given, verb, showGiven = true }) {
const isOfficial = kind === 'primary';
const receivedKind = isOfficial ? 'primary_received' : 'shine_received';
const givenKind = isOfficial ? 'primary_given' : 'shine_given';
@@ -25,9 +25,9 @@ function statusSideHtml({ kind, title, active, received, given, verb }) {
<button type="button" class="pf-sc__row" data-profile-list="${receivedKind}" aria-label="${esc(title)}${th('remaining.html_profile_card.confirmed_by')}${Number(received || 0)}">
<strong>${Number(received || 0)}</strong><span>${th('screens.profile_card.text_017')}</span>
</button>
<button type="button" class="pf-sc__row" data-profile-list="${givenKind}" aria-label="${esc(title)}: ${esc(verb)} ${Number(given || 0)}">
${showGiven ? `<button type="button" class="pf-sc__row" data-profile-list="${givenKind}" aria-label="${esc(title)}: ${esc(verb)} ${Number(given || 0)}">
<strong>${Number(given || 0)}</strong><span>${esc(verb)}</span>
</button>
</button>` : ''}
</section>`;
}
@@ -92,15 +92,11 @@ export function profileCardHtml({ card, login = '', tilesHtml = '', tilesWrapCla
const shineGiven = Number(stats.shineGivenCount || 0);
const primaryReceived = Number(stats.primaryReceivedCount || 0);
const primaryGiven = Number(stats.primaryGivenCount || 0);
// Статусы по бокам аватара: слева «Официальный», справа «Сияние». На своём профиле – всегда
// (пустая сторона бледнее), на чужом – если статус есть или уже есть подтверждения.
const verb = card?.gender === 'female' ? t('screens.profile_card.text_009') : card?.gender === 'male' ? t('screens.profile_card.text_010') : t('screens.profile_card.text_011');
const officialSide = (isSelf || official || primaryReceived || primaryGiven)
? statusSideHtml({ kind: 'primary', title: t('screens.profile_card.text_001'), active: official, received: primaryReceived, given: primaryGiven, verb })
: '';
const shineSide = (isSelf || shining || shineReceived || shineGiven)
? statusSideHtml({ kind: 'shine', title: t('screens.profile_card.text_002'), active: shining, received: shineReceived, given: shineGiven, verb })
: '';
const verb = t('screens.registration_identity.given');
const officialSide = official
? statusSideHtml({ kind: 'primary', title: t('screens.profile_card.text_001'), active: true, received: primaryReceived, given: primaryGiven, verb }) : '';
const shineSide = shining
? statusSideHtml({ kind: 'shine', title: t('screens.profile_card.text_002'), active: true, received: shineReceived, given: shineGiven, verb, showGiven: official }) : '';
return `
<div class="pf-hero" aria-label="${th('remaining.html_profile_card.profile')}${esc(cardLogin)}">