diff options
| author | Yuval Adam <_@yuv.al> | 2020-09-28 14:39:59 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-09-28 14:39:59 +0300 |
| commit | d3caed4241328258dee6190463bae8b4b5f3800d (patch) | |
| tree | 0077dd6f31bc5c81124c34b35f215ef1648c275c /iss/templates | |
| parent | 6ca40df643842932c9b36557ce69fd7a2ed0e6c4 (diff) | |
Use grouped predictions for dates in table
Diffstat (limited to 'iss/templates')
| -rw-r--r-- | iss/templates/index.html | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/iss/templates/index.html b/iss/templates/index.html index 5c498c7..e29da64 100644 --- a/iss/templates/index.html +++ b/iss/templates/index.html @@ -2,13 +2,14 @@ {% block content %} <table class="tl pa1"> - <tr class="ba tc pa1 f3"> + <tr class=" tc pa1 f3"> <th colspan="1">Total</th> <th colspan="2">Rise</th> <th colspan="4">Culminate</th> <th colspan="2">Set</th> </tr> <tr class="pa1 f4"> + <th>Date</th> <th>Length</th> <th>Time</th> <th>Azimuth</th> @@ -19,18 +20,22 @@ <th>Time</th> <th>Azimuth</th> </tr> - {% for pred in predictions %} - <tr class="pa1"> - <td>{{ pred.length }}</td> - <td>{{ pred.rise.time }}</td> - <td>{{ pred.rise.azimuth }}</td> - <td>{{ pred.culminate.time }}</td> - <td>{{ pred.culminate.azimuth }}</td> - <td>{{ pred.culminate.degrees }}</td> - <td>{{ pred.culminate.distance }}</td> - <td>{{ pred.set.time }}</td> - <td>{{ pred.set.azimuth }}</td> - </tr> + {% for date, preds in predictions.items() %} + {% set date_loop = loop %} + {% for pred in preds %} + <tr class="pa2 {{ date_loop.cycle('light-gray', 'light-silver') }}"> + {% if loop.first %}<td rowspan="{{ preds|length }}">{{ date }}</td>{% endif %} + <td>{{ pred.length }}</td> + <td>{{ pred.rise.time }}</td> + <td>{{ pred.rise.azimuth }}</td> + <td>{{ pred.culminate.time }}</td> + <td>{{ pred.culminate.azimuth }}</td> + <td>{{ pred.culminate.degrees }}</td> + <td>{{ pred.culminate.distance }}</td> + <td>{{ pred.set.time }}</td> + <td>{{ pred.set.azimuth }}</td> + </tr> + {% endfor %} {% endfor %} </table> |
