38 lines
1.8 KiB
PHP
38 lines
1.8 KiB
PHP
<?php
|
|
use App\Models\Tour;
|
|
|
|
$current = auth_check() ? user() : null;
|
|
?>
|
|
|
|
<div class="container text-center text-light mt-5">
|
|
<h1 class="text-center">Tourenplan: aktuelle Touren</h1>
|
|
|
|
<div class="container text-primary mb-3">
|
|
<span class="offset-1 col-4 float-left mb-3"><a class="btn btn-success" href="/tour/index_old" class="text-center text-light"><h3>Abgeschlossene Touren</h3></a></span>
|
|
<span class="offset-1"><a href="/img_storage/pdf/Tourenplan.pdf" class="btn btn-success"><h3>Download</h3></a></span>
|
|
</div>
|
|
|
|
<div class="container text-primary" style="display:flex">
|
|
.<ul class="list-group offset-2 col-8">
|
|
<?php foreach ($tours as $tour): ?>
|
|
<a href="/tour/<?= e($tour->id) ?>">
|
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
<?= e($tour->start) ?> - <?= e($tour->name) ?> [<?= e($participantCount[$tour->id] ?? 0) ?>/<?= e($tour->max_participants) ?>]
|
|
|
|
<?php if ($current && Tour::hasParticipant((int) $tour->id, (int) $current->id)): ?>
|
|
<i class="fas fa-biking"></i>
|
|
<?php endif; ?>
|
|
|
|
<span class="badge <?= $tour->is_cancelled ? 'badge-danger' : 'badge-success' ?> badge-pill"><?= $tour->is_cancelled ? 'STORNIERT' : 'FINDET STATT' ?></span>
|
|
</li>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
|
|
<?php if ($current && ($current->role === 'ADMIN' || $current->role === 'MEMBER')): ?>
|
|
<div class="container text-primary">
|
|
<a href="/tour/create" class="btn btn-danger col-3 mt-2 "><h3>Neue Tour anlegen</h3></a>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|