Add format_distance macro
This commit is contained in:
parent
093000bbc3
commit
f8c523c674
|
@ -3,6 +3,10 @@
|
|||
{% macro display_date(dt) %}{{ dt.strftime("%a %-d %b %Y") }}{% endmacro %}
|
||||
{% macro display_date_no_year(dt) %}{{ dt.strftime("%a %-d %b") }}{% endmacro %}
|
||||
|
||||
{% macro format_distance(distance) %}
|
||||
{{ "{:,.0f} km / {:,.0f} miles".format(distance, distance / 1.60934) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro trip_link(trip) %}
|
||||
<a href="{{ url_for("trip_page", start=trip.start.isoformat()) }}">{{ trip.title }}</a>
|
||||
{% endmacro %}
|
||||
|
|
Loading…
Reference in a new issue