diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index f780769d..303e0cb0 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -254,6 +254,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'): dates.append(dd) dates_sorting.append(dd2) durations.append(du) + types.append(w.workouttype) try: rowers.append(w.user.user.first_name[0]+w.user.user.last_name[0]) @@ -272,13 +273,17 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'): # add dates with no activity while d<=enddate: + dd = d.strftime('%d') dates.append(d.strftime('%m/%d')) + + dates_sorting.append(d.strftime('%Y/%m/%d')) durations.append(0) types.append('rower') rowers.append('Sander') d += datetime.timedelta(days=1) - + + df = pd.DataFrame({ 'date':dates, 'date_sorting':dates_sorting, @@ -288,7 +293,8 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'): }) df.sort_values('date_sorting',inplace=True) - + + p = Bar(df,values='duration', label = CatAttr(columns=['date'], sort=False), xlabel='Date', diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 9bc099b3..05b513eb 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -58,7 +58,17 @@ xo
    -
  • +
  • + + + + {{ interactiveplot |safe }} + + {{ the_div |safe }} +
  • +
  • @@ -81,18 +91,17 @@ xo

    - -
  • - - - - {{ interactiveplot |safe }} - - {{ the_div |safe }} -
  • -
  • +

    + {% if rankingonly and not team %} + + Show All Workouts + + {% elif not team %} + + Show Only Ranking Pieces + + {% endif %} +

    {% if workouts.has_previous %} @@ -139,19 +148,6 @@ xo

  • -
  • -

    - {% if rankingonly and not team %} - - Show All Workouts - - {% elif not team %} - - Show Only Ranking Pieces - - {% endif %} -

    -
  • {% if workouts %}