ad ability to blacklist when you ar blacklisted

This commit is contained in:
mrilyew 2024-12-13 17:43:40 +03:00
parent 5a5723151b
commit 8efb1409cf
2 changed files with 8 additions and 5 deletions

View file

@ -34,15 +34,16 @@ final class UserPresenter extends OpenVKPresenter
if(!is_null($user) && $user->isDeactivated()) { if(!is_null($user) && $user->isDeactivated()) {
$this->template->_template = "User/deactivated.xml"; $this->template->_template = "User/deactivated.xml";
$this->template->user = $user;
} else if($this->user->identity->isBlacklistedBy($user)) {
$this->template->_template = "User/blacklisted.xml";
$this->template->blacklist_status = $user->isBlacklistedBy($this->user->identity);
$this->template->ignore_status = $user->isIgnoredBy($this->user->identity);
$this->template->user = $user; $this->template->user = $user;
} else if($user->isBlacklistedBy($this->user->identity)) { } else if($user->isBlacklistedBy($this->user->identity)) {
$this->template->_template = "User/blacklisted_pov.xml"; $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->ignore_status = $user->isIgnoredBy($this->user->identity);
$this->template->user = $user; $this->template->user = $user;
} else if(!is_null($user) && !$user->canBeViewedBy($this->user->identity)) { } else if(!is_null($user) && !$user->canBeViewedBy($this->user->identity)) {

View file

@ -18,6 +18,8 @@
</div> </div>
<div id="profile_links" n:if="isset($thisUser)"> <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 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="$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()}"> <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} {if !$ignore_status}{_ignore_user}{else}{_unignore_user}{/if}
</a> </a>