Changeset 4678c5e in OpenWorkouts-current for ow/templates/profile.pt


Ignore:
Timestamp:
Apr 23, 2019, 6:41:11 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current
Children:
e57b2df
Parents:
9f3c353
Message:

(#71) Keep the "distance/time/elevation" filter when clicking on bars
in the profile yearly stats chart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/templates/profile.pt

    r9f3c353 r4678c5e  
    111111            <div class="center">
    112112              <ul class="workout-options filters js-filters">
    113                 <li><a href="#" class="js-distance is-active" i18n:translate="">distance</a></li>
    114                 <li><a href="#" class="js-time" i18n:translate="">time</a></li>
    115                 <li><a href="#" class="js-elevation" i18n:translate="">elevation</a></li>
     113                <li>
     114                  <a href="#" class="js-distance is-active"
     115                     tal:attributes="class 'js-distance is-active' if filter_by == 'distance' else 'js-distance'"
     116                     i18n:translate="">distance</a>
     117                </li>
     118                <li>
     119                  <a href="#" class="js-time"
     120                     tal:attributes="class 'js-time is-active' if filter_by == 'time' else 'js-time'"
     121                     i18n:translate="">time</a>
     122                </li>
     123                <li>
     124                  <a href="#" class="js-elevation"
     125                     tal:attributes="class 'js-elevation is-active' if filter_by == 'elevation' else 'js-elevation'"
     126                     i18n:translate="">elevation</a>
     127                </li>
    116128              </ul>
    117129
     
    520532         current_week: "${current_week}",
    521533         y_axis_labels: y_axis_labels,
    522          filter_by: "distance",
     534         filter_by: "${filter_by}",
    523535         url: "${'monthly' if current_week is None else 'weekly'}",
    524536     });
    525      year_chart.render("distance", "${'monthly' if current_week is None else 'weekly'}");
     537     year_chart.render("${filter_by}", "${'monthly' if current_week is None else 'weekly'}");
    526538     year_chart.filters_setup();
    527539     year_chart.switcher_setup();
Note: See TracChangeset for help on using the changeset viewer.