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->usersStats = (new Users)->getStatistics();
$this->template->clubsCount = (new Clubs)->getCount(); $this->template->clubsCount = (new Clubs)->getCount();
$this->template->postsCount = (new Posts)->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()); $this->template->admins = iterator_to_array((new Users)->getInstanceAdmins());
} }

View file

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