-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from freezingsaddles/djlint
djlint the frontend
- Loading branch information
Showing
51 changed files
with
2,634 additions
and
1,460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,38 +21,32 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
|
||
- name: install | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
port: ${{ secrets.PORT }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
script: | | ||
set -euo pipefail | ||
cd /opt/compose | ||
docker compose pull freezing-web | ||
docker compose up -d freezing-web | ||
- name: wait | ||
uses: iFaxity/[email protected] | ||
with: | ||
resource: https-get://freezingsaddles.org | ||
timeout: 5000 | ||
|
||
- name: install | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
port: ${{ secrets.PORT }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
script: | | ||
set -euo pipefail | ||
cd /opt/compose | ||
docker compose pull freezing-web | ||
docker compose up -d freezing-web | ||
- name: wait | ||
uses: iFaxity/[email protected] | ||
with: | ||
resource: https-get://freezingsaddles.org | ||
timeout: 5000 | ||
|
||
test: | ||
concurrency: build-deploy-and-test | ||
needs: [build, deploy] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
|
||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: test-wget-spider | ||
run: "URL=https://freezingsaddles.org test/wget-spider.sh" | ||
|
||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: test-wget-spider | ||
run: "URL=https://freezingsaddles.org test/wget-spider.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ name: Build Tag | |
on: | ||
push: | ||
tags: | ||
- '*' | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
echo "Running formatters" | ||
echo "*** black ***" | ||
black freezing | ||
echo "*** isort ***" | ||
isort freezing | ||
echo "*** djlint ***" | ||
djlint --reformat freezing/web/templates | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
echo "Running linting checks" | ||
echo "*** black ***" | ||
black --check freezing | ||
echo "*** isort ***" | ||
isort --check freezing | ||
echo "*** flake8 ***" | ||
flake8 freezing | ||
echo "*** mypy ***" | ||
echo "*** djlint ***" | ||
djlint --check freezing/web/templates | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<div class="card"> | ||
<h5 class="card-header">Freeze Points</h5> | ||
<div class="card-body"> | ||
<p>Thanks to VVill for coming up with this, (<a href="https://www.bikearlingtonforum.com/forums/topic/freeze-points-metric/">explained here</a>). Basically you get more points for riding in the cold, but distance doesn't matter so much.</p> | ||
<table class="table table-condensed"> | ||
<tr><th>Rank</th><th>Team</th><th>Points</th></tr> | ||
{% for a, b in indiv_freeze %} | ||
<tr> | ||
<td>{{loop.index}}</td> | ||
<td>{{a}}</td> | ||
<td>{{ '%0.1f' % b }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
</div> | ||
<div class="card"> | ||
<h5 class="card-header"> | ||
Freeze Points | ||
</h5> | ||
<div class="card-body"> | ||
<p> | ||
Thanks to VVill for coming up with this, (<a href="https://www.bikearlingtonforum.com/forums/topic/freeze-points-metric/">explained here</a>). Basically you get more points for riding in the cold, but distance doesn't matter so much. | ||
</p> | ||
<table class="table table-condensed"> | ||
<tr> | ||
<th> | ||
Rank | ||
</th> | ||
<th> | ||
Team | ||
</th> | ||
<th> | ||
Points | ||
</th> | ||
</tr> | ||
{% for a, b in indiv_freeze %} | ||
<tr> | ||
<td> | ||
{{ loop.index }} | ||
</td> | ||
<td> | ||
{{ a }} | ||
</td> | ||
<td> | ||
{{ '%0.1f' % b }} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,84 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<div class="card"> | ||
<h5 class="card-header">Hains Point Laps</h5> | ||
<div class="card-body"> | ||
<p class="lead">We're looking for the hamsterest hamster who ever hamstered.</p> | ||
<p>Segment Miles is based on the 2.5 mile <a href="https://www.strava.com/segments/1081507">Gate | ||
to Gate segment</a>, so it undercounts your mileage if you did a full lap. | ||
However, since this segment is the official measure of "A Hains Point Lap" as far as | ||
this contest is concerned, it was thought best to use 2.5 miles.</p> | ||
<p>If you feel the wrong decision has been made here, please be reminded that you are a hamster, and hamsters don't get the admin password to the web server.</p> | ||
<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 a, b, c in indiv_hains %} | ||
<tr> | ||
<td>{{loop.index}}</td> | ||
<td>{{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> | ||
</div> | ||
<div class="card"> | ||
<h5 class="card-header"> | ||
Hains Point Laps | ||
</h5> | ||
<div class="card-body"> | ||
<p class="lead"> | ||
We're looking for the hamsterest hamster who ever hamstered. | ||
</p> | ||
<p> | ||
Segment Miles is based on the 2.5 mile <a href="https://www.strava.com/segments/1081507">Gate | ||
to Gate segment</a>, so it undercounts your mileage if you did a full lap. | ||
However, since this segment is the official measure of "A Hains Point Lap" as far as | ||
this contest is concerned, it was thought best to use 2.5 miles. | ||
</p> | ||
<p> | ||
If you feel the wrong decision has been made here, please be reminded that you are a hamster, and hamsters don't get the admin password to the web server. | ||
</p> | ||
<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 a, b, c in indiv_hains %} | ||
<tr> | ||
<td> | ||
{{ loop.index }} | ||
</td> | ||
<td> | ||
{{ 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> | ||
</div> | ||
{% endblock %} | ||
{% block foot %} | ||
<script type="text/javascript" src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script> | ||
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"> | ||
<script type="text/javascript"> | ||
<script type="text/javascript" | ||
src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script> | ||
<link rel="stylesheet" | ||
href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"> | ||
<script type="text/javascript"> | ||
$(document).ready(function(){ | ||
$('#hamster').DataTable( { | ||
"paging": false, | ||
"order": [[ 2, "desc" ]] | ||
} ); | ||
}); | ||
</script> | ||
</script> | ||
{% endblock %} |
Oops, something went wrong.