Skip to content

Commit

Permalink
Merge pull request #436 from freezingsaddles/consistency
Browse files Browse the repository at this point in the history
Styling consistency is key
  • Loading branch information
merlinorg authored Jan 22, 2025
2 parents 185c787 + bdddab6 commit 96b7f2e
Show file tree
Hide file tree
Showing 19 changed files with 392 additions and 368 deletions.
94 changes: 46 additions & 48 deletions freezing/web/templates/alt_scoring/indiv_hains.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,52 @@ <h2 class="mb-3">
</p>
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="hamster" class="table table-condensed">
<thead>
<tr>
<th>
Rank
</th>
<th>
Hamster
</th>
<th>
Times Hamstered
</th>
<th>
Segment Miles
</th>
<th>
Total Miles
</th>
<th>
Hamster %
</th>
</tr>
</thead>
{% for id, a, b, c in indiv_hains %}
<tr class="{{ id | myself }}">
<td>
{{ loop.index }}
</td>
<td>
<a href="/people/{{ id }}" class="hover-underline">{{ a }}</a>
</td>
<td>
{{ b }}
</td>
<td>
{{ b * 2.5 }}
</td>
<td>
{{ c|round(1) }}
</td>
<td>
{{ ((b*250)/c)|round(1) }}
</td>
</tr>
{% endfor %}
</table>
</div>
<table id="hamster" class="table table-condensed">
<thead>
<tr>
<th>
Rank
</th>
<th>
Hamster
</th>
<th>
Times Hamstered
</th>
<th>
Segment Miles
</th>
<th>
Total Miles
</th>
<th>
Hamster %
</th>
</tr>
</thead>
{% for id, a, b, c in indiv_hains %}
<tr class="{{ id | myself }}">
<td>
{{ loop.index }}
</td>
<td>
<a href="/people/{{ id }}" class="hover-underline">{{ a }}</a>
</td>
<td>
{{ b }}
</td>
<td>
{{ b * 2.5 }}
</td>
<td>
{{ c|round(1) }}
</td>
<td>
{{ ((b*250)/c)|round(1) }}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}
Expand Down
148 changes: 73 additions & 75 deletions freezing/web/templates/alt_scoring/indiv_worst_day_points.html
Original file line number Diff line number Diff line change
@@ -1,82 +1,80 @@
{% extends "base.html" %}
{% block content %}
<h2 class="mb-3">
Steve O's Worst Day Points Proposal
</h2>
<p>
Take the median number of riders per day and then, for each day, your Adjusted Points are
your points in the old system (1 point per mile, 10 points per day for riding at least 1 mile) multiplied
by 1.025^(median-[total number of riders today]).
At this moment in time, the median number of riders is {{ median }}.
</p>
<p>
NOTE: This is calculated at the time you view the chart. This means that today's points will
change as more people ride. If you are the first rider of the day, you will get literally a
bajillion points (A sleaze ride of exactly one mile is worth almost 1500 points if you're
the only rider of the day). As more people ride, your points go down.
</p>
<div class="card">
<h5 class="card-header">
Steve O's Worst Day Points Proposal
</h5>
<div class="card-body">
<p>
Take the median number of riders per day and then, for each day, your Adjusted Points are
your points in the old system (1 point per mile, 10 points per day for riding at least 1 mile) multiplied
by 1.025^(median-[total number of riders today]).
At this moment in time, the median number of riders is {{ median }}.
</p>
<p>
NOTE: This is calculated at the time you view the chart. This means that today's points will
change as more people ride. If you are the first rider of the day, you will get literally a
bajillion points (A sleaze ride of exactly one mile is worth almost 1500 points if you're
the only rider of the day). As more people ride, your points go down.
</p>
<div class="table-responsive">
<table id="steve-o" class="table table-condensed">
<thead>
<tr>
<th class="number">
Rank
</th>
<th>
Rider
</th>
<th>
Team
</th>
<th class="number">
Miles
</th>
<th class="number">
Old Points
</th>
<th class="number">
Adjusted Points
</th>
<th class="number">
Bump %
</th>
<th class="number">
Days Ridden
</th>
</tr>
</thead>
{% for id, a, b, c, d, e, f in data %}
<tr class="{{ id | myself }}">
<td class="number">
{{ loop.index }}
</td>
<td>
{{ a }}
</td>
<td>
{{ b }}
</td>
<td class="number">
{{ c|round(1) }}
</td>
<td class="number">
{{ d|round(1) }}
</td>
<td class="number">
{{ e|round(1) }}
</td>
<td class="number">
{{ (100*(e-d)/d)|round(1) if d > 0 else 0}}%
</td>
<td class="number">
{{ f }}
</td>
</tr>
{% endfor %}
</table>
</div>
<table id="steve-o" class="table table-condensed">
<thead>
<tr>
<th class="number">
Rank
</th>
<th>
Rider
</th>
<th>
Team
</th>
<th class="number">
Miles
</th>
<th class="number">
Old Points
</th>
<th class="number">
Adjusted Points
</th>
<th class="number">
Bump %
</th>
<th class="number">
Days Ridden
</th>
</tr>
</thead>
{% for id, a, b, c, d, e, f in data %}
<tr class="{{ id | myself }}">
<td class="number">
{{ loop.index }}
</td>
<td>
{{ a }}
</td>
<td>
{{ b }}
</td>
<td class="number">
{{ c|round(1) }}
</td>
<td class="number">
{{ d|round(1) }}
</td>
<td class="number">
{{ e|round(1) }}
</td>
<td class="number">
{{ (100*(e-d)/d)|round(1) if d > 0 else 0}}%
</td>
<td class="number">
{{ f }}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}
Expand Down
45 changes: 32 additions & 13 deletions freezing/web/templates/alt_scoring/team_daily.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
{% extends "base.html" %}
{% block content %}
<h2 class="mb-3">
Team Wins by Day
</h2>
<p>
For each day, the team with the highest daily total gets {{ team_total|length }} points. Second gets {{ team_total|length - 1 }}, down to 1 for the last place team.
</p>
<div class="card">
<h5 class="card-header">
Team Points by Day
</h5>
<div class="card-body">
<p>
For each day, the team with the highest daily total gets {{ team_total|length }} points. Second gets {{ team_total|length - 1 }}, down to 1 for the last place team.
</p>
<ol>
{% for a,b in team_total %}
<li>
<strong>{{ b }}</strong> {{ a }}
</li>
<div class="card-body py-1">
<table class="table table-condensed">
<tr>
<th class="number rank">
Rank
</th>
<th>
Team
</th>
<th class="number">
Points
</th>
</tr>
{% for a, b in team_total %}
<tr>
<td class="number rank">
{{ loop.index }}
</td>
<td>
{{ b }}
</td>
<td class="number">
{{ a| round(1) }}
</td>
</tr>
{% endfor %}
</ol>
</table>
</div>
</div>
{% endblock %}
11 changes: 4 additions & 7 deletions freezing/web/templates/alt_scoring/team_riders.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{% extends "base.html" %}
{% block content %}
<h2 class="mb-3">
Ride Days by Team
</h2>
<div class="card">
<h5 class="card-header">
Team Riders
</h5>
<div class="card-body">
<p>
Ride days per team
</p>
<div class="card-body py-1">
<table class="table table-condensed">
<tr>
<th class="number rank">
Expand Down
4 changes: 2 additions & 2 deletions freezing/web/templates/leaderboard/indiv.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
</script>
{% endblock %}
{% block content %}
<h1>
<h2 class="mb-3">
Individual Leaderboard (Chart)
</h1>
</h2>
<p>
This leaderboard is also available as a <a href="/leaderboard/individual_text">text-only version</a>.
</p>
Expand Down
34 changes: 16 additions & 18 deletions freezing/web/templates/leaderboard/indiv_text.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{% extends "base.html" %}
{% block head %}
<style>
li.bigly::marker {
font-size: 1.25em;
li.large a {
font-size: 1.25rem
}
li.large::marker {
font-size: 1.125rem;
}
li:nth-of-type(11) {
margin-top: .25rem;
}
.myself {
background-color: #ffff0020;
Expand All @@ -12,29 +18,21 @@
</style>
{% endblock %}
{% block content %}
<h1>
<h2 class="mb-3">
Individual Leaderboard (Text)
</h1>
</h2>
<p>
This leaderboard is also available as a <a href="/leaderboard/individual">chart version</a>.
</p>
<ol>
{% for indiv_row in indiv_rows[:10] %}
<li class="bigly {{ indiv_row._mapping['athlete_id'] | myself }}">
<h4 class="mb-0">
<a href="/people/{{ indiv_row._mapping['athlete_id'] }}"
class="hover-underline">{{ indiv_row._mapping['athlete_name'] }}</a>
{{ indiv_row._mapping['total_score']|round|int|groupnum }} points
</h4>
({{ indiv_row._mapping['days_ridden'] }} days, {{ indiv_row._mapping['total_distance']|round|int|groupnum }} miles) {{ indiv_row._mapping['team_name'] }}
</li>
{% endfor %}
{% for indiv_row in indiv_rows[10:] %}
<li class="{{ indiv_row._mapping['athlete_id'] | myself }}">
{% for indiv_row in indiv_rows %}
<li class="{{ 'large' if loop.index <= 10 else '' }} {{ indiv_row._mapping['athlete_id'] | myself }}">
<a href="/people/{{ indiv_row._mapping['athlete_id'] }}"
class="hover-underline">{{ indiv_row._mapping['athlete_name'] }}</a>
class="hover-underline">{{ indiv_row._mapping['athlete_name'] }}</a>
<strong>{{ indiv_row._mapping['total_score']|round|int|groupnum }}</strong> points
({{ indiv_row._mapping['days_ridden'] }} days, {{ indiv_row._mapping['total_distance']|round|int|groupnum }} miles) {{ indiv_row._mapping['team_name'] }}
({{ indiv_row._mapping['days_ridden'] }} days,
{{ indiv_row._mapping['total_distance']|round|int|groupnum }} miles) –
{{ indiv_row._mapping['team_name'] }}
</li>
{% endfor %}
</ol>
Expand Down
Loading

0 comments on commit 96b7f2e

Please sign in to comment.