Skip to content

Commit c91f235

Browse files
committed
feat: upcoming races layout
1 parent f3de8fe commit c91f235

3 files changed

Lines changed: 44 additions & 12 deletions

File tree

src/routes/races.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::filters;
12
use crate::{
23
domain::{
34
race::{RaceSearchParams, RaceView},

templates/members/members.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<div class="container">
1313
<section class="card flex-col">
1414
<h1>Search Members</h1>
15+
{% if users.total > 0 %}
1516
<form>
1617
<div class="form-control">
1718
<label for="user_search">Search</label>
@@ -28,9 +29,10 @@ <h1>Search Members</h1>
2829
/>
2930
</div>
3031
</form>
32+
{% endif %}
3133
<div id="user_list" class="flex-col gap-2">
34+
{% if users.items.len() > 0 %}
3235
<div class="table-responsive">
33-
{% if users.items.len() > 0 %}
3436
<table>
3537
<thead>
3638
<tr>

templates/races/upcoming.html

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,46 @@
1212
<div class="container">
1313
<section class="card flex-col">
1414
<h1>Upcoming Races</h1>
15-
{% if races.total > 0 %}
16-
<ul>
17-
{% for race in races.items %}
18-
<li>
19-
{{ race.name | title }} ({{ race.miles }} miles) - {{ race.start_date }}
20-
</li>
21-
{% endfor %}
22-
</ul>
23-
{% else %}
24-
<p>No upcoming races found.</p>
25-
{% endif %}
15+
<div id="upcoming_race_list" class="flex-col gap-2">
16+
{% if races.total > 0 %}
17+
<div class="table-responsive">
18+
<table>
19+
<thead>
20+
<tr>
21+
<th>Date</th>
22+
<th>Town</th>
23+
<th>Name</th>
24+
<th>Distance</th>
25+
<th>Website</th>
26+
</tr>
27+
</thead>
28+
<tbody>
29+
{% for race in races.items %}
30+
<tr>
31+
<td class="nowrap">
32+
{{ race.start_date | date }} at 10:00 AM
33+
</td>
34+
<td class="nowrap">{{ race.town }}</td>
35+
<td class="nowrap">{{ race.name | title }}</td>
36+
<td class="nowrap">{{ race.miles }} Miles</td>
37+
<td>
38+
{% if let Some(website) = race.race_url %}
39+
<a target="_blank" href="{{ website }}">{{ website}}</a>
40+
{% endif %}
41+
</td>
42+
</tr>
43+
{% endfor %}
44+
</tbody>
45+
</table>
46+
</div>
47+
<div class="muted text-right text-sm">
48+
{% if races.total == 1 %} {{ races.total }} upcoming races {% else %} {{
49+
races.total }} upcoming races {% endif %}
50+
</div>
51+
{% else %}
52+
<p>No upcoming races found.</p>
53+
{% endif %}
54+
</div>
2655
</section>
2756
</div>
2857
</main>

0 commit comments

Comments
 (0)