Changeset 5cf5787 in OpenWorkouts-current for ow/templates/profile.pt


Ignore:
Timestamp:
Feb 4, 2019, 12:37:35 PM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
3357e47
Parents:
63df989
Message:

Show weekly/monthly versions of the "last 12 months" workout stats chart

in the user profile page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/templates/profile.pt

    r63df989 r5cf5787  
    7272          <a href="#" class="js-time" i18n:translate="">time</a>
    7373          <a href="#" class="js-elevation" i18n:translate="">elevation</a>
     74        </div>
     75        <div class="switcher js-switcher">
     76          <a href="#" class="js-weekly" i18n:translate="">weekly</a>
     77          <a href="#" class="js-monthly" i18n:translate="">monthly</a>
    7478        </div>
    7579      </div>
     
    154158         chart_selector: 'div.js-month-stats svg',
    155159         filters_selector: 'div.js-month-stats div.js-filters a',
    156          url: "${request.resource_url(context, 'yearly')}",
     160         switcher_selector: 'div.js-month-stats div.js-switcher a',
     161         urls: {"monthly": "${request.resource_url(context, 'monthly')}",
     162                "weekly": "${request.resource_url(context, 'weekly')}"},
    157163         current_month: "${current_month}",
     164         current_week: "${current_week}",
    158165         y_axis_labels: y_axis_labels,
     166         filter_by: "distance",
     167         url: "${'monthly' if current_week is None else 'weekly'}",
    159168     });
    160      year_chart.render("distance");
     169     year_chart.render("distance", "${'monthly' if current_week is None else 'weekly'}");
    161170     year_chart.filters_setup();
     171     year_chart.switcher_setup();
    162172    </script>
    163173
Note: See TracChangeset for help on using the changeset viewer.