Getting started on the system for new/old ride info

This commit is contained in:
2026-10-21 16:41:43 -07:00
parent 0ba31e4851
commit 3c4e95f72c
6 changed files with 107 additions and 28 deletions
+38 -5
View File
@@ -3,11 +3,35 @@ from datetime import date
from flask import render_template
from app import app
def get_ride_data( basename ):
##TODO: process just first line if file just has one line (treats)
try:
next_ride_file = open( getcwd() + sep + "data/"+date.strftime(basename,"%Y-%m-%d")+".txt")
lines = [ line for line in next_ride_file.read().split("\n") ]
next_ride_object = {
"treats": lines[0].split(","),
lines[1].split(",")[0]:lines[1].split(",")[1],
lines[2].split(",")[0]:lines[2].split(",")[1],
lines[3].split(",")[0]:lines[3].split(",")[1],
lines[4].split(",")[0]:lines[4].split(",")[1],
lines[5].split(",")[0]:lines[5].split(",")[1],
lines[6].split(",")[0]:lines[6].split(",")[1],
lines[7].split(",")[0]:lines[7].split(",")[1],
lines[8].split(",")[0]:lines[8].split(",")[1],
"winner1":list(lines[9].split(",")),
"winner2":list(lines[10].split(",")),
"winner3":list(lines[11].split(",")),
}
except:
next_ride_object = None
file = next_ride_object
return file
def get_rides():
rides_file = open( getcwd() + sep + "data/rides.txt")
rides = [ date.strptime( ride_date_str ,"%Y/%m/%d") for ride_date_str in rides_file.read().split("\n") ]
return rides
def get_next_ride_date( rides_list ):
rides_list.sort()
active_rides = []
@@ -16,22 +40,22 @@ def get_next_ride_date( rides_list ):
active_rides.append( ride_date )
next_ride = active_rides[0]
return next_ride
def get_week_day_name( a_date ):
return date.strftime( a_date ,"%A, %B %d" )
def get_short_day_name_and_date( a_date ):
return date.strftime( a_date ,"%b %d" )
@app.route('/')
@app.route('/index')
@app.route('/home')
def index():
rides = get_rides()
next_ride = get_next_ride_date(rides)
user = {'username': 'Jorge'}
month_and_day = get_week_day_name( next_ride )
short_day_name_and_date = get_short_day_name_and_date( next_ride )
next_ride_data = get_ride_data( next_ride )
posts = [
{
'author': {'username':'Guybrush'},
@@ -43,4 +67,13 @@ def index():
}
]
return render_template( 'index.html', title='Home', user=user, posts=posts, rides=rides, month_and_day=month_and_day, short_day_name_and_date=short_day_name_and_date, next_ride=next_ride) ## objects/variables to send over to templates.
return render_template( 'index.html', next_ride_data=next_ride_data, title='Home', user=user, posts=posts, rides=rides, month_and_day=month_and_day, short_day_name_and_date=short_day_name_and_date, next_ride=next_ride) ## objects/variables to send over to templates.
@app.route('/ride')
@app.route('/walk')
def ride():
rides = get_rides()
next_ride = get_next_ride_date(rides)
next_ride_data = get_ride_data( next_ride )
return render_template( 'ride.html', rides=rides, next_ride_data=next_ride_data, title='Home', next_ride=next_ride) ## objects/variables to send over to templates.
+3 -2
View File
@@ -23,7 +23,7 @@
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="pt"
inkscape:zoom="0.45254834"
inkscape:cx="1334.664"
inkscape:cx="1333.5592"
inkscape:cy="536.95921"
inkscape:window-width="2560"
inkscape:window-height="1440"
@@ -22425,7 +22425,8 @@
onmouseout="this.style=&quot;filter: drop-shadow(0 0 0 ffffff00 );&quot;"><path
id="path1-3"
style="stroke-width:0.201473;fill:#ff0060;fill-opacity:1"
d="m 372.48599,30.007683 c -14.02051,0 -25.38562,11.365122 -25.38562,25.385628 0,11.334873 16.5914,31.993864 22.94787,39.492689 1.28741,1.519109 3.5901,1.519109 4.8755,0 6.35647,-7.498825 22.94787,-28.157816 22.94787,-39.492689 0,-14.020506 -11.36511,-25.385628 -25.38562,-25.385628 z m 0,16.923752 c 4.67417,0 8.46188,3.787702 8.46188,8.461876 0,4.674176 -3.78771,8.461876 -8.46188,8.461876 -4.67417,0 -8.46188,-3.7877 -8.46188,-8.461876 0,-4.674174 3.78771,-8.461876 8.46188,-8.461876 z" /></a><a
d="m 372.48599,30.007683 c -14.02051,0 -25.38562,11.365122 -25.38562,25.385628 0,11.334873 16.5914,31.993864 22.94787,39.492689 1.28741,1.519109 3.5901,1.519109 4.8755,0 6.35647,-7.498825 22.94787,-28.157816 22.94787,-39.492689 0,-14.020506 -11.36511,-25.385628 -25.38562,-25.385628 z m 0,16.923752 c 4.67417,0 8.46188,3.787702 8.46188,8.461876 0,4.674176 -3.78771,8.461876 -8.46188,8.461876 -4.67417,0 -8.46188,-3.7877 -8.46188,-8.461876 0,-4.674174 3.78771,-8.461876 8.46188,-8.461876 z"
onload="this.style=&quot;fill='#ffff00'&quot;" /></a><a
id="a9"
xlink:href="https://maps.app.goo.gl/woEC7JjXsFYMxwBfA"
target="_locations"

Before

Width:  |  Height:  |  Size: 2.5 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

+23 -19
View File
@@ -7,7 +7,7 @@
viewBox="0 0 265.04398 215.25058"
version="1.1"
id="svg1"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
sodipodi:docname="wr_logo.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
@@ -24,14 +24,15 @@
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="0.36630324"
inkscape:cx="499.58609"
inkscape:cy="550.09069"
inkscape:cx="500.95107"
inkscape:cy="548.7257"
inkscape:window-width="2560"
inkscape:window-height="1417"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-height="1440"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
inkscape:current-layer="logo1"
showgrid="false" />
<defs
id="defs1">
<inkscape:path-effect
@@ -53,18 +54,21 @@
hide_knots="false" />
</defs>
<g
inkscape:label="Layer 1"
inkscape:label="logo"
inkscape:groupmode="layer"
id="layer1"
transform="translate(27.516669,-2.6458339)">
id="logo1"
transform="translate(27.516669,-2.6458339)"
style="display:inline">
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:114.914px;line-height:0.73;font-family:Stickup;-inkscape-font-specification:'Stickup, ';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;letter-spacing:-3.58894px;text-anchor:middle;mix-blend-mode:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:13.9221;stroke-linecap:square;paint-order:markers fill stroke"
style="display:inline;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:114.914px;line-height:0.73;font-family:Stickup;-inkscape-font-specification:'Stickup, ';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:center;letter-spacing:-3.58894px;text-anchor:middle;mix-blend-mode:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:13.9221;stroke-linecap:square;paint-order:markers fill stroke"
x="-29.733036"
y="134.02931"
id="text1-6"
id="walk_roller"
inkscape:label="walk roller"
transform="scale(1.0000915,0.99990852)"><tspan
transform="scale(1.0000915,0.99990852)"
onload=""
onmouseover="this.style.fill='#ff0000'"><tspan
sodipodi:role="line"
id="tspan1-3"
x="-29.733036"
@@ -73,7 +77,7 @@
dx="-0.025524953">walk </tspan><tspan
sodipodi:role="line"
x="-29.733036"
y="217.91634"
y="217.91653"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:114.914px;line-height:0.73;font-family:Stickup;-inkscape-font-specification:'Stickup, ';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;letter-spacing:-3.58894px;text-anchor:start;fill:#000000;fill-opacity:1;stroke-width:13.9221"
id="tspan2"
dx="0 0 0 0 -3.7843785">Roller</tspan></text>
@@ -82,7 +86,7 @@
style="font-weight:bold;font-size:59.2235px;line-height:0.73;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';text-align:center;text-anchor:middle;mix-blend-mode:normal;fill:#ffffff;fill-opacity:0.929412;stroke:none;stroke-width:13.9221;stroke-linecap:square;paint-order:markers fill stroke"
x="204.95403"
y="118.33827"
id="text1-6-3"
id="and"
inkscape:label="&amp;"
transform="scale(1.0000915,0.99990852)"><tspan
sodipodi:role="line"
@@ -93,25 +97,25 @@
<path
style="fill:none;fill-opacity:1;stroke:#f9f9f9;stroke-width:3.56477;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
d="m -25.326765,4.4280556 c -0.1219,2.2983561 1.380968,4.7139684 2.893958,5.9207504 1.705862,1.360617 3.392998,2.430523 5.559552,2.836106 1.764457,0.330315 3.56097,0.332953 5.342478,0.164733 0.763568,-0.07209 3.9331647,-0.645762 4.0322949,-2.168454 0.099118,-1.5225101 -2.1917186,-2.6161095 -3.7166909,-2.6724609 -3.868676,-0.1429422 -9.09188,2.1081889 -9.903634,6.0653469 -1.205212,5.875193 4.726269,9.132728 8.295732,8.693879 2.389213,-0.29374 3.5936093,-1.47067 3.3829814,-2.574317 -0.2106273,-1.103647 -1.9212724,-1.627593 -3.7558114,-1.404711 -3.471373,0.42175 -7.880139,3.103321 -8.588171,9.998974 -0.465075,4.529457 3.920834,7.645348 7.603,8.162446 3.957771,0.555794 8.7350073,-0.718401 12.4505666,-2.663781 2.32880438,-1.219307 5.089791,-3.213352 6.877394,-5.003776 C 8.6012314,26.322972 9.2163367,20.391573 9.0060345,15.541831 8.9094377,13.314304 8.2210749,5.6423664 5.0315102,5.9517322 2.9739357,6.1512971 2.2747932,9.2615277 1.854009,10.819844 c -0.6644416,2.460649 -0.86973226,4.974707 -1.06857895,7.509443 -0.35627524,4.541474 -0.29843199,8.08399 0.57706045,12.57063 0.3561335,1.82508 0.5629674,3.351253 1.2071454,5.044246 0.3883989,1.020764 2.6968591,4.755302 6.2113519,5.022528 3.1132512,0.236717 4.3719442,-0.16561 6.3775042,-1.138542"
id="path163"
id="El"
sodipodi:nodetypes="csssaasssssssssssssssc"
inkscape:label="El" />
<path
style="fill:none;fill-opacity:1;stroke:#f9f9f9;stroke-width:3.56477;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
d="m 28.872593,40.499055 c 4.644048,-11.977619 8.493541,-20.435066 10.144435,-24.433883 0.401335,-0.972119 0.752026,-1.964403 1.137787,-2.942802 0.297107,-0.753549 0.578546,-1.513947 0.906308,-2.254683 0.116743,-0.263829 0.252727,-0.518733 0.377225,-0.778992 0.01693,-0.03545 0.01199,-0.1148974 0.05035,-0.1065582 0.634218,0.1377192 0.01526,1.2976872 0.02649,1.9464752 0.01142,0.660215 0.05935,1.320423 0.04167,1.980501 -0.101331,3.784339 -0.645927,7.545141 -0.846241,11.325535 -0.07015,1.324245 -0.213772,2.653263 -0.124483,3.976357 0.03615,0.535658 -0.249082,1.437571 0.26624,1.588477 0.925049,0.270891 1.433763,-1.323608 1.941054,-2.14308 4.457355,-7.200315 5.213852,-10.094725 11.051969,-19.201338 0.46312,-0.7224035 0.909867,-2.4677912 1.626414,-1.9955373 0.100304,0.066105 -0.122931,0.2075746 -0.167023,0.3193037 -0.152021,0.3852407 -0.230133,0.7958611 -0.331101,1.1975096 -0.304174,1.20996 -0.561987,2.431174 -0.827105,3.650282 -3.337775,12.47746 -4.287556,25.218094 -4.995894,38.067015"
id="path164"
id="M"
sodipodi:nodetypes="caaaaaaaaaassaaaac"
inkscape:label="M" />
<path
style="fill:none;fill-opacity:1;stroke:#f9f9f9;stroke-width:3.56477;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
d="m 67.788702,20.633348 c -3.419878,-0.921091 -8.269193,2.974831 -9.329038,7.236369 -0.794581,3.194954 -0.582616,5.82604 0.721653,7.389518 1.211243,1.451954 3.52478,0.888064 4.153867,0.425467 6.662015,-5.589075 6.6044,-14.861099 6.948924,-14.831144 0.800437,0.06957 -1.08617,8.06017 -0.07231,12.918567 0.259537,1.243709 0.690149,2.675894 2.221275,1.586848 1.428289,-1.015896 2.095728,-3.399983 2.556851,-4.943165 0.906345,-3.033185 1.553042,-6.206143 2.020828,-9.338871 0.02057,-0.137584 0.297985,-2.7446 0.264107,-2.774613 -0.02675,-0.0237 0.06735,0.02848 0.103061,0.02932 0.21957,0.0051 0.609236,0.322618 0.796719,0.395595 1.096361,0.426771 2.233929,0.306226 3.385571,0.247138 0.696152,-0.03574 3.951493,-0.436441 4.450338,0.09686 0.04351,0.04648 -1.285836,2.678243 -1.367666,2.87685 -1.568176,3.806073 -3.567614,8.577443 -1.731068,12.6583 0.266924,0.593115 0.905391,1.837707 1.622136,2.300073 0.874107,0.563886 1.970762,-0.551989 2.452361,-1.141403 2.25159,-2.755645 3.186845,-6.06008 4.2322,-9.406252 0.484131,-1.565262 0.972926,-3.12907 1.466061,-4.691519 0.112526,-0.356074 -0.05394,3.907574 0.133553,5.848572 0.341671,3.536922 0.307661,10.109407 1.801177,10.506933 1.062613,0.282829 2.441231,-1.48057 2.840067,-2.097689 1.9201,-2.97096 2.46919,-4.76912 5.843211,-12.93338 0.37551,-0.908635 0.81431,-2.55981 1.62339,-3.119897 0.16873,-0.116803 0.72627,-0.506012 1.01188,-0.195367 0.91016,0.989975 -0.12229,3.844296 -0.36703,4.702392 -0.81106,2.843582 -1.69896,5.628655 -2.18211,8.700922 -0.21333,1.356438 -0.47359,3.338155 -0.0199,4.719408 0.0328,0.09975 0.16878,-0.317792 0.47536,-1.216013 1.28023,-3.750936 -0.79953,1.829102 1.0593,-3.039341 1.47732,-3.869216 2.86843,-7.364376 5.42408,-10.468617 1.29318,-1.570775 2.73833,-3.957575 6.32411,-3.268365 2.77982,0.5343 2.10087,4.488203 1.33844,8.230049 -0.76243,3.741845 -2.45219,8.966628 -0.48771,10.128582 0.93394,0.552412 2.64106,-0.378589 3.38916,-2.638351 1.4962,-4.519531 2.87764,-12.384158 2.89447,-11.941574 0.0337,0.885173 -0.74848,3.814902 -0.93589,5.74511 -0.33985,3.500216 -0.28869,8.746944 3.94299,8.941309 4.45072,0.204425 5.56776,-4.741935 6.28715,-7.80393 0.54297,-2.311094 -0.69866,-8.826201 -3.67656,-9.540474 -2.03582,-0.488328 -3.39586,-0.371742 -3.75246,1.568502 -0.56099,3.052305 3.82844,2.977305 7.22819,0.310314 2.63596,-2.067807 4.55071,-5.627453 3.64948,-10.689482"
id="path165"
id="arino"
sodipodi:nodetypes="csssssssssssssssssssasssssssssssssssssszsssc"
inkscape:label="arino" />
<path
style="fill:none;fill-opacity:1;stroke:#f9f9f9;stroke-width:2.97065;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
d="m 99.192535,10.66298 c -1.726228,0.639596 -3.295051,3.631474 -1.667258,5.938183 1.524545,2.1604 4.101933,0.634781 4.610723,-0.678857 0.1667,-0.430406 0.21004,-0.939988 0.0891,-1.383579 -0.62477,-1.7756 -2.250109,-1.101311 -2.14787,-0.145992"
id="path166"
id="dot"
sodipodi:nodetypes="csssc"
inkscape:label="." />
</g>

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

+5 -2
View File
@@ -16,8 +16,11 @@
</div>
<div class="box centered wrapping">
<img class="icon" src="/static/img/wr_icons.svg">
<h2>
We'll have delicious treats for all of you at the front gate!!!
<h2> {% if next_ride_data == None %}
We'll have delicious treats for all of you at the front gate!!!
{% else %}
We'll have delicious {{ next_ride_data.treats[0]+" and "+next_ride_data.treats[1]+" "}} for all of you at the front gate!!!
{% endif %}
</h2>
</div>
</div>
+26
View File
@@ -0,0 +1,26 @@
{% extends "base.html" %}
{% block content %}
<object data="/static/img/wr_logo.svg"></object>
<h1><span>143</span> of you participated</h1>
<p>...kids from all grades and ages, walking, biking, scooting, and skating.</p>
<ul>
<li>TK,7</li>
<li>K,27</li>
<li>1st,26</li>
<li>2nd,19</li>
<li>3rd,27</li>
<li>4th,21</li>
<li>5th,16</li>
</ul>
<h3>CHECK YOUR TAGS FOR THE RAFFLE WINNING NUMBERS...</h3>
<ul>
<li>15074 - Nicodemus</li>
<li>15000 - Mizuta</li>
<li>15105 - Rodriguez</li>
</ul>
<p>... and claim your gift certificate for special prizes.</p>
<h3>CONGRATULATIONS TO Señor Reyes' 3rd grade class</h3>
<p>All clases did put an incredible showing and SeñorX Reyes' 3rd grade class won the silver Sneaker Award for the class with more participation.</p>
<h1>Hello, {{ rides }}!</h1>
{% endblock %}
+12
View File
@@ -0,0 +1,12 @@
hot chocolate,churros
total,112
k,21
1,29
2,11
3,15
4,15
5,15
most_part,Nagumo Sensei
15949, Miyawaki Sensei
15626, Oda Sensei
15766, Señora Aguila