From eca0f057ca09179023eb4322a0704a5513ab89ff Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Tue, 25 Jan 2022 14:22:33 +0200 Subject: [PATCH] About: Hide list of most popular groups if there are no groups --- Web/Presenters/AboutPresenter.php | 2 +- .../templates/About/AboutInstance.xml | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Web/Presenters/AboutPresenter.php b/Web/Presenters/AboutPresenter.php index f7131772..bd84efbc 100644 --- a/Web/Presenters/AboutPresenter.php +++ b/Web/Presenters/AboutPresenter.php @@ -63,7 +63,7 @@ final class AboutPresenter extends OpenVKPresenter $this->template->usersStats = (new Users)->getStatistics(); $this->template->clubsCount = (new Clubs)->getCount(); $this->template->postsCount = (new Posts)->getCount(); - $this->template->popularClubs = (new Clubs)->getPopularClubs(); + $this->template->popularClubs = iterator_to_array((new Clubs)->getPopularClubs()); $this->template->admins = iterator_to_array((new Users)->getInstanceAdmins()); } diff --git a/Web/Presenters/templates/About/AboutInstance.xml b/Web/Presenters/templates/About/AboutInstance.xml index 61bd9d2f..af63d9ee 100644 --- a/Web/Presenters/templates/About/AboutInstance.xml +++ b/Web/Presenters/templates/About/AboutInstance.xml @@ -42,15 +42,17 @@ -

{_most_popular_groups}

-
    -
  1. - {$entry->club->getName()} -
    - {tr("participants", $entry->subscriptions)} -
    -
  2. -
+ {if sizeof($popularClubs) !== 0} +

{_most_popular_groups}

+
    +
  1. + {$entry->club->getName()} +
    + {tr("participants", $entry->subscriptions)} +
    +
  2. +
+ {/if}

{_rules}