diff --git a/_bin/mkical.py b/_bin/mkical.py index de9ec07..e035287 100755 --- a/_bin/mkical.py +++ b/_bin/mkical.py @@ -61,6 +61,7 @@ def dtstart(date, time): phases = run['plan'] if 'cancelled' in run.keys(): continue + total_dist = 0 for i in range(len(phases)): phase = phases[i] if 'cancelled' in phase.keys(): @@ -73,6 +74,8 @@ def dtstart(date, time): name = route['name'] gmap = route['map'] if 'map' in route else '' dist = route['distance_mi'] if 'distance_mi' in route else None + if dist: + total_dist += dist event_name = f'{name} ({dist}mi)' if dist else name diff --git a/_includes/schedule_table.html b/_includes/schedule_table.html index 1f4ccf6..f9899d5 100644 --- a/_includes/schedule_table.html +++ b/_includes/schedule_table.html @@ -1,11 +1,11 @@ -
| Date | Time | -Route (miles) | +RoutesDistance () |
- {% if plan.route_id %}
- {{route.name}}
-
-
+
+
+ {% if plan.route_id %}
+ {{route.name}}
+
- {% elsif route.map %}
- {{route.name}}
- {% else %}
- {{route.name}}
- {% endif %}
- {% if route.distance_mi %} ({{ route.distance_mi | round: 1}}){% endif %}
- {% if route.gpx and include.link_gpx %}
- ⌚
- {% endif %}
+
+ {% elsif route.map %}
+ {{route.name}}
+ {% else %}
+ {{route.name}}
+ {% endif %}
+ {% if route.gpx and include.link_gpx %}
+ ⌚
+ {% endif %}
+
+ {% if route.distance_mi %}{{ route.distance_mi | round: 1 }}{% endif %}
+ |
{% if plan.notes %}
@@ -90,6 +105,12 @@
{% endif %}
{% endfor %}
+ {% if total_dist > 0 and run.plan.size > 1 %}
+
|---|---|---|---|
| + | {{ total_dist | round: 1 }} |
+ ||
| @@ -102,3 +123,22 @@ | |||
| A new schedule is coming! Contribute on GitHub | |||