From 948719ec3d99e5cdd5c2cbf8e369dfed4cfd4998 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Fri, 24 Dec 2021 22:08:03 +0200 Subject: [PATCH] Groups: Do not show group pin button in group list when the group cannot be pinned --- Web/Models/Entities/User.php | 2 ++ Web/Presenters/templates/User/Groups.xml | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index e0212578..e810bf0f 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -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 diff --git a/Web/Presenters/templates/User/Groups.xml b/Web/Presenters/templates/User/Groups.xml index ad80222c..18860fd8 100644 --- a/Web/Presenters/templates/User/Groups.xml +++ b/Web/Presenters/templates/User/Groups.xml @@ -51,9 +51,9 @@ {$x->getDescription()} {/block} -{var clubPinned = $thisUser->isClubPinned($x)} -{if $x->canBeModifiedBy($thisUser ?? NULL) || $clubPinned || $thisUser->getPinnedClubCount() <= 10} - {block actions} +{block actions} + {var clubPinned = $thisUser->isClubPinned($x)} + {if $x->canBeModifiedBy($thisUser ?? NULL) && ($clubPinned || $thisUser->getPinnedClubCount() <= 10)} {if $clubPinned} {_remove_from_left_menu} @@ -61,5 +61,5 @@ {_add_to_left_menu} {/if} - {/block} -{/if} \ No newline at end of file + {/if} +{/block}