Skip to content

Commit

Permalink
156: fix PR comments and improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Atmos4 committed Dec 16, 2023
1 parent 8efa80e commit 4589f61
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 62 deletions.
2 changes: 1 addition & 1 deletion app/pages/events/entry_list/entry_list_tab_race.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$raceEntries = RaceService::getRaceEntries($raceId);
?>
<?php if (!$raceEntries): ?>
<p>Pas d'inscrits sur cette course</p>
<p style="padding: 1rem" class="center">Pas d'inscrits sur cette course</p>
<?php return;
endif ?>
<figure>
Expand Down
116 changes: 55 additions & 61 deletions app/pages/events/event_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,70 +125,64 @@
<?php endif; ?>

<?php if (count($event->races)): ?>
<h4>Courses : </h4>
<table role="grid">

<?php foreach ($event->races as $race):
$race_entry = $race->entries[0] ?? null; ?>
<details>
<summary>
<?= ConditionalIcon($race_entry && $race_entry->present) . " " . $race->name ?>
</summary>
<div class="row">
<div class="col-sm-12 col-md-6">
<ul class="fa-ul">
<li><span class="fa-li"><i class="fa fa-calendar"></i></span>
<?= format_date($race->date) ?>
</li>
<li><span class="fa-li"><i class="fa fa-location-dot"></i></span>
<?= $race->place ?>
<h4>Courses :
<a href="#" title="Afficher tous les détails" onclick="
htmx.findAll(htmx.closest(this, 'article'),'details').forEach(e => {e.open=!e.open});
return false
">
<i class="fa fa-up-down"></i>
</a>
</h4>

<?php foreach ($event->races as $race):
$race_entry = $race->entries[0] ?? null; ?>
<details>
<summary>
<?= ConditionalIcon($race_entry && $race_entry->present) . " " . $race->name ?>
</summary>
<div class="row">
<div class="col-sm-12 col-md-6">
<ul class="fa-ul">
<li><span class="fa-li"><i class="fa fa-calendar"></i></span>
<?= format_date($race->date) ?>
</li>
<li><span class="fa-li"><i class="fa fa-location-dot"></i></span>
<?= $race->place ?>
</li>
</ul>
</div>
<div class="col-sm-12 col-md-6">
<ul class="fa-ul">
<?php if ($race_entry?->present): ?>
<li><span class="fa-li"><i class="fa fa-check"></i></span><ins>Je participe</ins></li>
<?php else: ?>
<li><span class="fa-li"><i class="fa fa-xmark"></i></span><del>
<?= $race_entry ? "Je ne participe pas" : "Pas inscrit" ?>
</del></li>
<?php endif; ?>
<?php if ($race_entry?->category): ?>
<li><span class="fa-li"><i class="fa fa-person-running"></i></span>
<?= $race_entry->category?->name ?>
</li>
</ul>
</div>
<div class="col-sm-12 col-md-6">
<ul class="fa-ul">
<?php if ($race_entry?->present): ?>
<li><span class="fa-li"><i class="fa fa-check"></i></span><ins>Je participe</ins></li>
<?php else: ?>
<li><span class="fa-li"><i class="fa fa-xmark"></i></span><del>
<?= $race_entry ? "Je ne participe pas" : "Pas inscrit" ?>
</del></li>
<?php endif; ?>
<?php if ($race_entry?->category): ?>
<li><span class="fa-li"><i class="fa fa-person-running"></i></span>
<?= $race_entry->category?->name ?>
</li>
<?php endif ?>
</ul>
</div>
<?php endif ?>
</ul>
</div>
<?php if ($race_entry?->comment): ?>
<div>
<cite>Remarque : </cite>
<?= $race_entry->comment ?>
</div>
<br>
<?php endif;
if ($can_edit): ?>
<nav>
<li></li>
<li>
<?php if ($event->open): ?>
<a role="button" class="outline secondary" href='/evenements/course/<?= $race->id ?>/inscrits'> <i
class="fa fa-users"></i>
Inscrits</a>
<?php endif ?>
<a role="button" class="outline secondary"
href='/evenements/<?= $event->id ?>/course/<?= $race->id ?>'>
<i class="fa fa-pen"></i>
Modifier</a>
</li>
</nav>
</div>
<?php if ($race_entry?->comment): ?>
<div>
<cite>Remarque : </cite>
<?= $race_entry->comment ?>
</div>
<br>
<?php endif;
if ($can_edit): ?>
<a role="button" class="outline secondary" href='/evenements/<?= $event->id ?>/course/<?= $race->id ?>'>
<i class="fa fa-pen"></i>
Modifier</a>

<?php endif ?>
</details>
<?php endforeach; ?>
</table>
<?php endif ?>
</details>
<?php endforeach; ?>
<?php endif; ?>


Expand Down

0 comments on commit 4589f61

Please sign in to comment.