Changeset 02b96c5 in OpenWorkouts-current for ow/templates/profile.pt


Ignore:
Timestamp:
Mar 12, 2019, 12:47:38 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current
Children:
8ba32d9
Parents:
d9453fc
Message:

(#7) Added calendar heatmap chart to the profile page.

The calendar shows the current month, each day without a workout represented
by a light grey square, each day with workout data in a red/pink color, picked
up from a gradient generated based on the app main colors, and calculated based
on the amount of workout time for the day.

A tooltip is shown on hover with more info (only the total workouts time for
now)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/templates/profile.pt

    rd9453fc r02b96c5  
    5151            </ul>
    5252          </div>
     53          <div class="calendar-heatmap js-calendar-heatmap">
     54          </div>
    5355        </div>
    5456
     
    462464     sport_stats.setup();
    463465
     466     var heatmap_chart = owjs.calendar_heatmap_chart({
     467         chart_selector: 'div.js-calendar-heatmap',
     468         url: "${request.resource_url(user, 'month')}",
     469         // Trick to have all those shortened day names translated
     470         day_names_list: "${_('Mo Tu We Th Fr Sa Su')}".split(' ')
     471     });
     472     heatmap_chart.render();
     473
    464474     var year_stats = owjs.year_stats({
    465475         link_selector: 'a.js-choose-year-stats',
Note: See TracChangeset for help on using the changeset viewer.