Pronouns: some updated that i can't describe just bc i'm tired

This commit is contained in:
veselcraft 2023-11-26 17:45:19 +03:00
parent 6794d6421e
commit ec5c95e48f
No known key found for this signature in database
GPG key ID: 9CF0B42766CCF7BA
12 changed files with 1130 additions and 13 deletions

View file

@ -60,7 +60,7 @@ final class Users extends VKAPIRequestHandler
$response[$i]->verified = intval($usr->isVerified());
break;
case "sex":
$response[$i]->sex = $usr->isFemale() ? 1 : 2;
$response[$i]->sex = $usr->isFemale() ? 1 : ($usr->isNeutral() ? 0 : 2);
break;
case "has_photo":
$response[$i]->has_photo = is_null($usr->getAvatarPhoto()) ? 0 : 1;

View file

@ -170,7 +170,7 @@ final class Wall extends VKAPIRequestHandler
"last_name" => $user->getLastName(),
"can_access_closed" => false,
"is_closed" => false,
"sex" => $user->isFemale() ? 1 : 2,
"sex" => $user->isFemale() ? 1 : ($user->isNeutral() ? 0 : 2),
"screen_name" => $user->getShortCode(),
"photo_50" => $user->getAvatarUrl(),
"photo_100" => $user->getAvatarUrl(),
@ -349,7 +349,7 @@ final class Wall extends VKAPIRequestHandler
"last_name" => $user->getLastName(),
"can_access_closed" => false,
"is_closed" => false,
"sex" => $user->isFemale() ? 1 : 2,
"sex" => $user->isFemale() ? 1 : ($user->isNeutral() ? 0 : 2),
"screen_name" => $user->getShortCode(),
"photo_50" => $user->getAvatarUrl(),
"photo_100" => $user->getAvatarUrl(),

View file

@ -783,7 +783,7 @@ class User extends RowModel
function isFemale(): bool
{
return (bool) $this->getRecord()->sex == 1;
return $this->getRecord()->sex == 1;
}
function isNeutral(): bool

View file

@ -170,15 +170,16 @@ final class UserPresenter extends OpenVKPresenter
if ($this->postParam("politViews") <= 9 && $this->postParam("politViews") >= 0)
$user->setPolit_Views($this->postParam("politViews"));
bdump($this->postParam("pronouns"));
if ($this->postParam("pronouns") <= 2 && $this->postParam("pronouns") >= 0)
switch ($this->postParam("pronouns")) {
case 'male':
case '0':
$user->setSex(0);
break;
case 'female':
case '1':
$user->setSex(1);
break;
case 'neutral':
case '2':
$user->setSex(2);
break;
}

View file

@ -94,8 +94,8 @@
{/if}
{if $x->getPrivacySetting("page.info.read") > 1}
<tr>
<td><span class="nobold">{_gender}: </span></td>
<td>{$x->isFemale() ? tr("female") : tr("male")}</td>
<td><span class="nobold">{_pronouns}: </span></td>
<td>{$x->isFemale() ? tr("female") : ($x->isNeutral() ? tr("neutral") : tr("male"))}</td>
</tr>
<tr>
<td><span class="nobold">{_relationship}:</span></td>

View file

@ -451,8 +451,8 @@
<table id="basicInfo" class="ugc-table" border="0" cellspacing="0" cellpadding="0" border="0" cellspacing="0" cellpadding="0" n:if=" $user->getPrivacyPermission('page.info.read', $thisUser ?? NULL)">
<tbody>
<tr>
<td class="label"><span class="nobold">{_gender}: </span></td>
<td class="data">{$user->isFemale() ? tr("female") : tr("male")}</td>
<td class="label"><span class="nobold">{_pronouns}: </span></td>
<td class="data">{$user->isFemale() ? tr("female") : ($user->isNeutral() ? tr("neutral") : tr("male"))}</td>
</tr>
<tr>
<td class="label"><span class="nobold">{_relationship}:</span></td>

View file

@ -26,8 +26,8 @@
<div class="post-author">
<a href="{$author->getURL()}"><b class="post-author-name">{$author->getCanonicalName()}</b></a>
<img n:if="$author->isVerified()" class="name-checkmark" src="/assets/packages/static/openvk/img/checkmark.png">
{$post->isDeactivationMessage() ? ($author->isFemale() ? tr($deac . "_f") : tr($deac . "_m"))}
{$post->isUpdateAvatarMessage() && !$post->isPostedOnBehalfOfGroup() ? ($author->isFemale() ? tr("upd_f") : tr("upd_m"))}
{$post->isDeactivationMessage() ? ($author->isFemale() ? tr($deac . "_f") : ($author->isNeutral() ? tr($deac . "_g") : tr($deac . "_m")))}
{$post->isUpdateAvatarMessage() && !$post->isPostedOnBehalfOfGroup() ? ($author->isFemale() ? tr("upd_f") : ($author->isNeutral() ? tr("upd_n") : tr("upd_m")))}
{$post->isUpdateAvatarMessage() && $post->isPostedOnBehalfOfGroup() ? tr("upd_g") : ""}
{if ($onWallOf ?? false) &&!$post->isPostedOnBehalfOfGroup() && $post->getOwnerPost() !== $post->getTargetWall()}
{var $wallOwner = $post->getWallOwner()}

View file

@ -33,6 +33,8 @@
{else}
{if $author->isFemale()}
{_post_writes_f}
{elseif $author->isNeutral()}
{_post_writes_g}
{else}
{_post_writes_m}
{/if}

1107
Web/static/js/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -164,8 +164,10 @@
"post_writes_g" = "published";
"post_deact_m" = "deleted his profile saying:";
"post_deact_f" = "deleted her profile saying:";
"post_deact_g" = "deleted they profile saying:";
"post_deact_silent_m" = "silently deleted his profile.";
"post_deact_silent_f" = "silently deleted her profile.";
"post_deact_silent_f" = "silently deleted they profile.";
"post_on_your_wall" = "on your wall";
"post_on_group_wall" = "in $1";
"post_on_user_wall" = "on $1's wall";

View file

@ -146,8 +146,10 @@
"post_writes_g" = "опубликовали";
"post_deact_m" = "удалил страницу со словами:";
"post_deact_f" = "удалила страницу со словами:";
"post_deact_g" = "удалили страницу со словами:";
"post_deact_silent_m" = "молча удалил свою страницу.";
"post_deact_silent_f" = "молча удалила свою страницу.";
"post_deact_silent_g" = "молча удалили свою страницу.";
"post_on_your_wall" = "на вашей стене";
"post_on_group_wall" = "в $1";
"post_on_user_wall" = "на стене $1";
@ -376,6 +378,7 @@
"upd_m" = "обновил фотографию на своей странице";
"upd_f" = "обновила фотографию на своей странице";
"upd_n" = "обновили фотографию на своей странице";
"upd_g" = "обновило фотографию группы";
"add_photos" = "Добавить фотографии";

View file

@ -148,8 +148,10 @@
"post_writes_g" = "опублікували";
"post_deact_m" = "видалив сторінку зі словами:";
"post_deact_f" = "видалила сторінку зі словами:";
"post_deact_g" = "видалили сторінку зі словами:";
"post_deact_silent_m" = "мовчки видалив свою сторінку.";
"post_deact_silent_f" = "мовчки видалила свою сторінку.";
"post_deact_silent_g" = "мовчки видалили свою сторінку.";
"post_on_your_wall" = "на вашій стіні";
"post_on_group_wall" = "в $1";
"post_on_user_wall" = "на стіні $1";