This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
dogstats/web/pages/tournaments/event.html

108 lines
5.8 KiB
HTML
Raw Normal View History

2023-10-26 21:18:32 +02:00
<!-- FILEPATH: /home/chris/git/tournamentstats/web/pages/tournaments/dog.html -->
<div class="container">
<div class="row">
<div class="col-3">
<div class="card">
<img src="<?= $tdata['logo'] ?>/300x170/fixedsize" class="card-img-top" alt="<?= escape($tdata['name']); ?>'s profile Picture">
<div class="card-body">
<h5 class="card-title"><?= escape($tdata['name']); ?></h5>
<p class="card-text">
<ul>
<li>Datum: <?= escape($tdata['date']) ?></li>
<?php if($tdata['duration']): ?><li>Dauer: <?= escape($tdata['duration']); ?> Tag/e</li> <?php endif; ?>
<?php if($tdata['referee']): ?><li>Richter: <?= escape($tdata['referee']); ?></li> <?php endif; ?>
<?php if($tdata['size']): ?><li>Größe: <?= escape($tdata['size']); ?> cm</li> <?php endif; ?>
<?php if($tdata['url']): ?><li>Webseite: <a href="<?= $tdata['url']; ?>"><?= escape($tdata['url']); ?></a></li> <?php endif; ?>
</ul>
2023-10-26 21:48:04 +02:00
2023-10-26 21:18:32 +02:00
<div class="d-flex justify-content-end">
2023-10-26 21:48:04 +02:00
<?php if($admin===true): ?>
2023-10-26 21:18:32 +02:00
<button type="button" class="btn btn-secondary" hx-get="/tournaments/edit/<?= $tournament_id; ?>" hx-target="#main">
<i class="fas fa-edit"></i>
</button>
2023-10-26 21:48:04 +02:00
<?php endif; ?>
<?php if($joined===false): ?>
<button type="button" class="btn btn-secondary" hx-get="/tournaments/manage/join/<?= $tournament_id; ?>" hx-swap="outerHTML">
<i class="fas fa-plus-circle"></i> Diesem Event beitreten
</button>
<?php elseif($admin===false): ?>
<button type="button" class="btn btn-danger" hx-get="/tournaments/manage/leave/<?= $tournament_id; ?>" hx-swap="outerHTML" hx-confirm="Möchtest du dieses Event wirklich verlassen?">
<i class="fas fa-minus-circle"></i> Event verlassen
</button>
<?php endif; ?>
2023-10-26 21:18:32 +02:00
</div>
</div>
2023-10-27 11:52:31 +02:00
</div>
2023-10-31 10:02:32 +01:00
<?php if(($admins && count($admins)>1) || ($members && count($members)>0)): ?>
2023-10-27 11:52:31 +02:00
<div class="card p-2">
2023-10-27 12:39:11 +02:00
<?php if($admins && count($admins)>0): ?> <h6>Admins</h6> <?php endif; ?>
2023-10-30 22:20:13 +01:00
<?php foreach($admins as $adm) : ?>
<img src="https://pictshare.net/identicon/<?= $adm['email']?>" height="50" width="50" class="rounded-circle" alt="<?= escape($adm['name']); ?>" title="<?= escape($adm['firstname'].' '.$adm['lastname']); ?>">
2023-10-27 12:39:11 +02:00
<?php endforeach; ?>
<?php if($members && count($members)>0): ?> <hr/> <h6>Mitglieder</h6> <?php endif; ?>
<?php foreach($members as $member) : ?>
<img src="https://pictshare.net/identicon/<?= $member['email']?>" height="50" width="50" class="rounded-circle" alt="<?= escape($member['name']); ?>" title="<?= escape($member['firstname'].' '.$member['lastname']); ?>">
2023-10-27 11:52:31 +02:00
<?php endforeach; ?>
</div>
2023-10-31 10:02:32 +01:00
<?php endif; ?>
2023-10-26 21:18:32 +02:00
</div>
2023-10-27 12:39:11 +02:00
<div class="col-6" id="sitemain">
2023-10-31 10:02:32 +01:00
<?php if($tdata['text']): ?>
<div class="card p-2 mb-4">
2023-10-27 12:39:11 +02:00
<h4>Beschreibungstext</h4>
<p class="card-text">
<pre><?= escape($tdata['text']); ?></pre>
</p>
</div>
2023-10-31 10:02:32 +01:00
<?php endif; ?>
2023-10-30 22:20:13 +01:00
2023-10-31 10:02:32 +01:00
<div class="card p-2">
2023-10-30 22:20:13 +01:00
<h4>Läufe</h4>
<p class="card-text">
<?php if($admin===true): ?>
<button hx-get="/runs/add/<?= $tournament_id; ?>" hx-push-url="/runs/add/<?= $tournament_id; ?>" hx-target="#main" class="btn btn-primary"><i class="fas fa-plus-circle"></i> Lauf hinzufügen</button>
<?php endif; ?>
<table class="table">
<thead>
<tr>
<th>Bezeichnung</th>
<th>Lauf</th>
<th>Parcourlänge</th>
<th>Normzeit</th>
<th>Maxzeit</th>
<th>Richter</th>
</tr>
</thead>
<tbody>
<?php foreach($tdata['runs'] as $rid) : ?>
<?php
$run = new Run();
$run->load($rid);
?>
<tr>
<td><a href="/runs/overview/<?= $rid; ?>" hx-get="/runs/overview/<?= $rid; ?>" hx-push-url="/runs/overview/<?= $rid; ?>" hx-target="#main"><?= escape($run->data['name']); ?></a></td>
<td><?= escape($run->data['category']); ?></td>
<td><?= escape($run->data['length']); ?>m</td>
<td><?= escape($run->data['time_standard']); ?>s</td>
<td><?= escape($run->data['time_max']); ?>s</td>
<td><?= escape($run->data['referee']); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</p>
</div>
2023-10-26 21:18:32 +02:00
</div>
</div>
</div>