diff --git a/freezing/web/templates/people/show.html b/freezing/web/templates/people/show.html index b373e91..dd2847f 100644 --- a/freezing/web/templates/people/show.html +++ b/freezing/web/templates/people/show.html @@ -127,12 +127,12 @@
Total Rides: {{ data.totalrides }}
  • - Total Mileage: {{ data.totaldist | round(1) }} + Total Mileage: {{ data.totaldist | round(2) }}
  • Average Ride: {% if data.totalrides > 0 %} - {{ (data.totaldist / data.totalrides) | round(1) }} + {{ (data.totaldist / data.totalrides) | round(2) }} {% else %} N/A {% endif %} @@ -142,16 +142,22 @@
    Rides This Week: {{ data.weekrides }}
  • - Mileage This Week: {{ data.weektotal | round(1) }} + Mileage This Week: {{ data.weektotal | round(2) }}
  • Average Ride This Week: {% if data.weekrides > 0 %} - {{ (data.weektotal / data.weekrides) | round(1) }} + {{ (data.weektotal / data.weekrides) | round(2) }} {% else %} N/A {% endif %} +
  • + Rides Today: {{ data.todayrides }} +
  • +
  • + Mileage Today: {{ data.todaydist | round(2) }} +
  • diff --git a/freezing/web/views/people.py b/freezing/web/views/people.py index dbe799d..7d662d9 100644 --- a/freezing/web/views/people.py +++ b/freezing/web/views/people.py @@ -80,6 +80,8 @@ def people_show_person(user_id): today = get_today() week_start = today.date() - timedelta(days=(today.weekday()) % 7) week_end = week_start + timedelta(days=6) + today_dist = 0 + today_rides = 0 weekly_dist = 0 weekly_rides = 0 total_rides = 0 @@ -91,6 +93,9 @@ def people_show_person(user_id): if week_start <= ride_date <= week_end: weekly_dist += r.distance weekly_rides += 1 + if ride_date == today.date(): + today_dist += r.distance + today_rides += 1 tribal_groups = load_tribes() my_tribes = query_tribes(user_id) @@ -102,6 +107,8 @@ def people_show_person(user_id): "environment": config.ENVIRONMENT, "my_tribes": my_tribes, "team": our_team, + "todaydist": today_dist, + "todayrides": today_rides, "totaldist": total_dist, "totalrides": total_rides, "tribal_groups": tribal_groups,