rvr-nextgen/views/events/events.php

42 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2023-05-28 03:44:19 +02:00
@extends(templates/layout_normal)
@section(main)
<h2>
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
Events
</h2>
<p class="marginTop"><a href="<?= Container::$routeCollection->getRoute('community.events.new')->generateLink(['communitySlug' => $community->getSlug()]) ?>">New event</a></p>
<?php if ($numberOfEvents > 0): ?>
2023-05-28 18:32:19 +02:00
<?php
$paginationRouteId = 'community.events';
$paginationRouteParams = ['communitySlug' => $community->getSlug()];
?>
2023-05-28 03:44:19 +02:00
<?php if ($pages > 1): ?>
2023-05-28 18:32:19 +02:00
@include(templates/pagination)
2023-05-28 03:44:19 +02:00
<?php endif; ?>
<?php foreach ($events as $event): ?>
<a class="block" href="<?= Container::$routeCollection->getRoute('community.event')->generateLink(['communitySlug' => $community->getSlug(), 'eventSlug' => $event->getSlug()]) ?>">
<div class="box">
<p style="font-weight: bold;"><?= $event->getTitle() ?></p>
<p class="small"><?= $event->getStartDate()->format('Y-m-d') ?> <?= $event->getEndDate()->format('Y-m-d') ?></p>
<p class="small"><?= $event->getDescription() ?></p>
</div>
</a>
<?php endforeach; ?>
<?php if ($pages > 1): ?>
2023-05-28 18:32:19 +02:00
@include(templates/pagination)
2023-05-28 03:44:19 +02:00
<?php endif; ?>
<p class="marginTop"><a href="<?= Container::$routeCollection->getRoute('community.events.new')->generateLink(['communitySlug' => $community->getSlug()]) ?>">New event</a></p>
<?php else: ?>
<div class="box">
<p>There are no events yet.</p>
</div>
<?php endif; ?>
@endsection