42 lines
1.7 KiB
PHP
42 lines
1.7 KiB
PHP
@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): ?>
|
||
<?php
|
||
$paginationRouteId = 'community.events';
|
||
$paginationRouteParams = ['communitySlug' => $community->getSlug()];
|
||
?>
|
||
|
||
<?php if ($pages > 1): ?>
|
||
@include(templates/pagination)
|
||
<?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): ?>
|
||
@include(templates/pagination)
|
||
<?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
|