{% extends "base.html" %} {% block title %}{{ friend.first_name }} {{ friend.last_name}}{% endblock %} {% block nav %}
  • home
  • people
  • categories
  • results
  • battle
  • {% endblock %} {% block back %}Back {% endblock %} {% block css %} {% endblock %} {% block scripts %} {% endblock %} {% block onready %} //Tablesorter $("#workout_table").tablesorter(); //Graphs var category_chart; var all_workouts_chart; var points_per_type_chart; var day_of_week_chart; var month_frequency_chart; var felt_chart; $(document).ready(function() { category_chart = new Highcharts.Chart({ chart: { renderTo: 'category_breakdown', plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false }, title: { text: 'Percentage of workouts done' }, tooltip: { formatter: function() { return ''+ this.point.name +': '+ parseFloat(this.percentage).toFixed(2) +' %'; } }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, color: '#000000', connectorColor: '#000000', formatter: function() { return ''+ this.point.name +': '+ parseFloat(this.percentage).toFixed(2) +' %'; } } } }, series: [{ type: 'pie', name: 'Workout Types', data: [ {% for w in workout_types %} ['{{ w.0 }}', {{ w.1 }}], {% endfor %} ] }] }); all_workouts_chart = new Highcharts.Chart({ chart: { renderTo: 'all_workouts', type: 'column' }, title: { text: 'Points per workout for {{ friend.first_name }}' }, yAxis: { min: 0, title: { text: 'Points' } }, tooltip: { formatter: function() { return ''+ this.y +' points'; } }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ name: 'Points', data: [ {% for w in all_workouts %} {{ w.get_points }}, {% endfor %} ] }] }); points_per_type_chart = new Highcharts.Chart({ chart: { renderTo: 'points_per_type', type: 'column' }, title: { text: 'Number of Workouts Per Type' }, xAxis: { min: 0, title: { text: 'Workout Type' }, categories : [ {% for w in workout_types %} '{{ w.0 }}', {% endfor %} ] }, yAxis: { min: 0, title: { text: 'Workouts' } }, tooltip: { formatter: function() { return ''+ this.y +' workouts'; } }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ name: 'Workouts', data: [ {% for w in workout_types %} {{ w.2 }}, {% endfor %} ] }] }); day_of_week_chart = new Highcharts.Chart({ chart: { renderTo: 'day_of_week_chart', type: 'column' }, title: { text: 'Frequency of Workouts by Day of Week' }, xAxis: { min: 0, title: { text: 'Day of Week' }, categories : [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ] }, yAxis: { min: 0, title: { text: 'Workouts' } }, tooltip: { formatter: function() { return ''+ this.y +' workouts'; } }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ name: 'Workouts', data: [ {% for key,value in day_of_week_data.items %} {{ value }}, {% endfor %} ] }] }); month_frequency_chart = new Highcharts.Chart({ chart: { renderTo: 'month_frequency', type: 'column' }, title: { text: 'Frequency of Workouts by Month' }, xAxis: { min: 0, title: { text: 'Month' }, categories : [ {% for w in workouts_by_month %} '{{ w.0 }}', {% endfor %} ] }, yAxis: { min: 0, title: { text: 'Workouts' } }, tooltip: { formatter: function() { return ''+ this.y +' workouts'; } }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ name: 'Workouts', data: [ {% for w in workouts_by_month %} {{ w.1 }}, {% endfor %} ] }] }); felt_chart = new Highcharts.Chart({ chart: { renderTo: 'felt_chart', plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false }, title: { text: 'How did you feel?' }, tooltip: { formatter: function() { return ''+ this.point.name +': '+ parseFloat(this.percentage).toFixed(2) +' %'; } }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, color: '#000000', connectorColor: '#000000', formatter: function() { return ''+ this.point.name +': '+ parseFloat(this.percentage).toFixed(2) +' %'; } } } }, series: [{ type: 'pie', name: 'Workout Types', data: [ {% for s in sentiment_data %} ['{{ s.0 }}', {{ s.1 }}], {% endfor %} ] }] }); }); {% endblock %} {% block leaderBoard %}

    {{ friend.first_name }} {{ friend.last_name }} ({{ total_points }} points)

    Go To {{ friend.first_name }}'s DailyMile page.
    {% endblock %} {% block secondary %}
      {% for w in all_workouts %}
    • {{ w.date }} - {{ w.message }}
    • {% endfor %}

    Workouts

    {% for w in all_workouts %} {% endfor %}
    Date Type Distance Duration(seconds) Points Felt Message
    {{ w.date }} {{ w.workout_type }} {{ w.distance }} {{ w.duration }} {{ w.get_points|floatformat }} {{ w.felt }} {{ w.message }}
    {% endblock %}