Compare commits

..

2 commits

Author SHA1 Message Date
mrilyew
504f50af9a fields blacklisted_by_me, blacklisted 2024-12-12 15:31:43 +03:00
mrilyew
9afebf7d02 add ignore button to blacklisted users 2024-12-12 15:22:12 +03:00
5 changed files with 27 additions and 1 deletions

View file

@ -1418,6 +1418,20 @@ class User extends RowModel
case 'real_id':
$res->real_id = $this->getRealId();
break;
case "blacklisted_by_me":
if(!$user) {
continue;
}
$res->blacklisted_by_me = (int)$this->isBlacklistedBy($user);
break;
case "blacklisted":
if(!$user) {
continue;
}
$res->blacklisted = (int)$user->isBlacklistedBy($this);
break;
}
}

View file

@ -37,9 +37,13 @@ final class UserPresenter extends OpenVKPresenter
$this->template->user = $user;
} else if($user->isBlacklistedBy($this->user->identity)) {
$this->template->_template = "User/blacklisted_pov.xml";
$this->template->ignore_status = $user->isIgnoredBy($this->user->identity);
$this->template->user = $user;
} else if($this->user->identity->isBlacklistedBy($user)) {
$this->template->_template = "User/blacklisted.xml";
$this->template->ignore_status = $user->isIgnoredBy($this->user->identity);
$this->template->user = $user;
} else if(!is_null($user) && !$user->canBeViewedBy($this->user->identity)) {
$this->template->_template = "User/private.xml";

View file

@ -165,8 +165,10 @@
</form>
{/if}
<a n:if="!$blacklist_status" id="_bl_toggler" data-name="{$user->getMorphedName('genitive', false)}" data-val="1" data-id="{$user->getRealId()}" class="profile_link" style="display:block;width:96%;">{_bl_add}</a>
{* 4 admins *}
<a n:if="$blacklist_status" id="_bl_toggler" data-val="0" data-id="{$user->getRealId()}" class="profile_link" style="display:block;width:96%;">{_bl_remove}</a>
<a class="profile_link" style="display:block;width:96%;" href="javascript:reportUser({$user->getId()})">{_report}</a>
<a n:if="!$blacklist_status" id="_bl_toggler" data-name="{$user->getMorphedName('genitive', false)}" data-val="1" data-id="{$user->getRealId()}" class="profile_link" style="display:block;width:96%;">{_bl_add}</a>
<a n:if="!$user->isHideFromGlobalFeedEnabled()" class="profile_link" style="display:block;width:96%;" id="__ignoreSomeone" data-val='{!$ignore_status ? 1 : 0}' data-id="{$user->getId()}">
{if !$ignore_status}{_ignore_user}{else}{_unignore_user}{/if}
</a>

View file

@ -18,6 +18,9 @@
</div>
<div id="profile_links" n:if="isset($thisUser)">
<a class="profile_link" style="display:block;width:96%;" href="javascript:reportUser({$user->getId()})">{_report}</a>
<a n:if="!$user->isHideFromGlobalFeedEnabled()" class="profile_link" style="display:block;width:96%;" id="__ignoreSomeone" data-val='{!$ignore_status ? 1 : 0}' data-id="{$user->getId()}">
{if !$ignore_status}{_ignore_user}{else}{_unignore_user}{/if}
</a>
</div>
</div>

View file

@ -18,6 +18,9 @@
</div>
<div id="profile_links" n:if="isset($thisUser)">
<a n:if="!$blacklist_status" id="_bl_toggler" data-val="0" data-id="{$user->getRealId()}" class="profile_link" style="display:block;width:96%;">{_bl_remove}</a>
<a n:if="!$user->isHideFromGlobalFeedEnabled()" class="profile_link" style="display:block;width:96%;" id="__ignoreSomeone" data-val='{!$ignore_status ? 1 : 0}' data-id="{$user->getId()}">
{if !$ignore_status}{_ignore_user}{else}{_unignore_user}{/if}
</a>
<a class="profile_link" style="display:block;width:96%;" href="javascript:reportUser({$user->getId()})">{_report}</a>
</div>
</div>