About: Hide list of most popular groups if there are no groups

This commit is contained in:
Maxim Leshchenko 2022-01-25 14:22:33 +02:00
parent 71186631f3
commit eca0f057ca
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE
2 changed files with 12 additions and 10 deletions

View file

@ -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());
}

View file

@ -42,15 +42,17 @@
</tbody>
</table>
<h4>{_most_popular_groups}</h4>
<ol>
<li n:foreach="$popularClubs as $entry" style="margin-top: 5px;">
<a href="{$entry->club->getURL()}">{$entry->club->getName()}</a>
<div>
{tr("participants", $entry->subscriptions)}
</div>
</li>
</ol>
{if sizeof($popularClubs) !== 0}
<h4>{_most_popular_groups}</h4>
<ol>
<li n:foreach="$popularClubs as $entry" style="margin-top: 5px;">
<a href="{$entry->club->getURL()}">{$entry->club->getName()}</a>
<div>
{tr("participants", $entry->subscriptions)}
</div>
</li>
</ol>
{/if}
<h4>{_rules}</h4>
<div style="margin-top: 16px;">