Pārlūkot izejas kodu

Added description to main page and basic notices system.

master
Trey Del Bonis pirms 2 gadiem
vecāks
revīzija
f664e7bfb7
2 mainītis faili ar 33 papildinājumiem un 0 dzēšanām
  1. 6
    0
      app.py
  2. 27
    0
      templates/main.htm

+ 6
- 0
app.py Parādīt failu

@@ -66,6 +66,12 @@ async def render_main(req: Request):
'num_days': num_days,
'days': converted
},
'notices': [
{
'style': 'primary',
'text': 'There were so many incidents in August 2021 that news sites stopped reporting on it, so there\'s some missing data here.',
}
],
'request': req,
}


+ 27
- 0
templates/main.htm Parādīt failu

@@ -24,7 +24,34 @@
</div>

<div id="main" class="container">
<h1>Why?</h1>
<p>
If you're unfamiliar with Boston, there's a
<a href="https://en.wikipedia.org/wiki/Storrow_Drive">road along the Charles river</a>
known for having several low bridges going over it. People seem to have a
lot of problems with it when driving tall trucks, especially movers driving
U-Hauls.
</p>
<p>
I made this website because I thought it was funny. It works by searching
for news articles with certain keywords on Google on each day. This only
works well if the incidents are reported on on news sites/etc, but there are
false-positives (which you can report soon!). There's also a way to request
incident data directly the MassDOT, but that's a lot more work to pull data
from and I'm not sure how quickly it's updated so I'll leave that to someone
more dedicated to work on.
</p>

<h1>Articles</h1>

<div id="notices">
{% for n in notices %}
<div class="alert alert-{{ n.style }}">
{{ n.text }}
</div>
{% endfor %}
</div>

<div id="days">
{% for d in sb.days %}
<div class="day mb-3">

Notiek ielāde…
Atcelt
Saglabāt