From c430f7eaa73ff0dacfdf7f0a1b8d14376c58058f Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 28 Sep 2020 23:15:02 +0300 Subject: Drop grouped predictions and render table in vue --- iss/server.py | 3 +-- iss/templates/passes.html | 29 +++++++++++------------------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/iss/server.py b/iss/server.py index e8486ea..79fd5a6 100644 --- a/iss/server.py +++ b/iss/server.py @@ -27,12 +27,11 @@ async def home(request: Request, cf_connecting_ip: Optional[str] = Header(None)) @app.get("/passes/{lat}/{lng}") async def passes(request: Request, lat: float, lng: float): - preds = Predictions(lat, lng, altitude=0, days=5).get_grouped_predictions() + preds = Predictions(lat, lng, altitude=0, days=5).get_predictions() return templates.TemplateResponse( "passes.html", { "request": request, - "predictions": preds, "predictions_json": json.dumps(preds), "location": {"lat": lat, "lng": lng}, }, diff --git a/iss/templates/passes.html b/iss/templates/passes.html index 10fb52b..a0ea45e 100644 --- a/iss/templates/passes.html +++ b/iss/templates/passes.html @@ -16,7 +16,6 @@ Set - Date Length Time Azimuth @@ -27,23 +26,17 @@ Time Azimuth - {% for date, preds in predictions.items() %} - {% set date_loop = loop %} - {% for pred in preds %} - - {% if loop.first %}{{ date }}{% endif %} - {{ pred.length }} - {{ pred.rise.time }} - {{ pred.rise.azimuth }} ({{ pred.rise.direction }}) - {{ pred.culminate.time }} - {{ pred.culminate.azimuth }} ({{ pred.culminate.direction }}) - {{ pred.culminate.degrees }} - {{ pred.culminate.distance }} - {{ pred.set.time }} - {{ pred.set.azimuth }} ({{ pred.set.direction }}) - - {% endfor %} - {% endfor %} + + [[ pred.length ]] + [[ pred.rise.time ]] + [[ pred.rise.azimuth ]] ([[ pred.rise.direction ]]) + [[ pred.culminate.time ]] + [[ pred.culminate.azimuth ]] ([[ pred.culminate.direction ]]) + [[ pred.culminate.degrees ]] + [[ pred.culminate.distance ]] + [[ pred.set.time ]] + [[ pred.set.azimuth ]] ([[ pred.set.direction ]]) + -- cgit v1.3.1