mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Groups: Do not show group pin button in group list when the group cannot be pinned
This commit is contained in:
parent
b765038bc3
commit
948719ec3d
2 changed files with 7 additions and 5 deletions
|
@ -540,6 +540,8 @@ class User extends RowModel
|
|||
$manager = $club->getManager($this);
|
||||
if(!is_null($manager))
|
||||
return $manager->isClubPinned();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getMeetings(int $page = 1): \Traversable
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
{$x->getDescription()}
|
||||
{/block}
|
||||
|
||||
{var clubPinned = $thisUser->isClubPinned($x)}
|
||||
{if $x->canBeModifiedBy($thisUser ?? NULL) || $clubPinned || $thisUser->getPinnedClubCount() <= 10}
|
||||
{block actions}
|
||||
{var clubPinned = $thisUser->isClubPinned($x)}
|
||||
{if $x->canBeModifiedBy($thisUser ?? NULL) && ($clubPinned || $thisUser->getPinnedClubCount() <= 10)}
|
||||
<a class="profile_link" href="/groups_pin?club={$x->getId()}&hash={rawurlencode($csrfToken)}" id="_pinGroup" data-group-name="{$x->getName()}" data-group-url="{$x->getUrl()}">
|
||||
{if $clubPinned}
|
||||
{_remove_from_left_menu}
|
||||
|
@ -61,5 +61,5 @@
|
|||
{_add_to_left_menu}
|
||||
{/if}
|
||||
</a>
|
||||
{/block}
|
||||
{/if}
|
||||
{/block}
|
||||
|
|
Loading…
Reference in a new issue