Skip to content

Commit

Permalink
add ignore button to blacklisted users
Browse files Browse the repository at this point in the history
  • Loading branch information
mrilyew committed Dec 12, 2024
1 parent c714cc4 commit 9afebf7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Web/Presenters/UserPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ function renderView(int $id): void
$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";
Expand Down
4 changes: 3 additions & 1 deletion Web/Presenters/templates/User/View.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions Web/Presenters/templates/User/blacklisted.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
3 changes: 3 additions & 0 deletions Web/Presenters/templates/User/blacklisted_pov.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 9afebf7

Please sign in to comment.