Changeset 04c882d in OpenWorkouts-current for ow/templates/profile.pt


Ignore:
Timestamp:
Mar 6, 2019, 11:25:01 AM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current
Children:
8d726ec
Parents:
aa6dcaf
Message:

(#7) Improvements on the workout totals/stats in the user profile page:

  • Fixed styles for the sport/year dropdowns
  • Added "per workout records" for each year (and all time totals), including maximum distance, time and elevation in a single workout.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/templates/profile.pt

    raa6dcaf r04c882d  
    253253                        <tal:t i18n:translate="">m</tal:t>
    254254                      </li>
     255                      <li><span i18n:translate="">Single workout records:</span></li>
     256                      <li>
     257                        <span>
     258                          <tal:t i18n:translate="">Farthest distance</tal:t>
     259                        </span>
     260                        <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_distance_wid']])">
     261                          <tal:w tal:replace="round(sport_totals['max_distance'])"></tal:w>
     262                          <tal:t i18n:translate="">km</tal:t>
     263                        </a>
     264                      </li>
     265                      <li>
     266                        <span>
     267                          <tal:t i18n:translate="">Longer workout</tal:t>
     268                        </span>
     269                        <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_time_wid']])">
     270                          <tal:hms tal:define="hms timedelta_to_hms(sport_totals['max_time'])">
     271                            <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h>
     272                            <tal:t i18n:translate="">hours</tal:t>,
     273                            <tal:h tal:content="str(hms[1]).zfill(2)"></tal:h>
     274                            <tal:t i18n:translate="">min.</tal:t>
     275                          </tal:hms>
     276                        </a>
     277                      </li>
     278                      <li>
     279                        <span>
     280                          <tal:t i18n:translate="">Higher elevation gain</tal:t>
     281                        </span>
     282                        <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_elevation_wid']])">
     283                          <tal:w tal:replace="round(sport_totals['max_elevation'])"></tal:w>
     284                          <tal:t i18n:translate="">m</tal:t>
     285                        </a>
     286                      </li>
    255287                    </ul>
    256288                  </div>
     
    290322                    <tal:w tal:replace="round(sport_totals['elevation'])"></tal:w>
    291323                    <tal:t i18n:translate="">m</tal:t>
     324                  </li>
     325                  <li><span i18n:translate="">Single workout records:</span></li>
     326                  <li>
     327                    <span>
     328                      <tal:t i18n:translate="">Farthest distance</tal:t>
     329                    </span>
     330                    <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_distance_wid']])">
     331                      <tal:w tal:replace="round(sport_totals['max_distance'])"></tal:w>
     332                      <tal:t i18n:translate="">km</tal:t>
     333                    </a>
     334                  </li>
     335                  <li>
     336                    <span>
     337                      <tal:t i18n:translate="">Longer workout</tal:t>
     338                    </span>
     339                    <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_time_wid']])">
     340                      <tal:hms tal:define="hms timedelta_to_hms(sport_totals['max_time'])">
     341                        <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h>
     342                        <tal:t i18n:translate="">hours</tal:t>,
     343                        <tal:h tal:content="str(hms[1]).zfill(2)"></tal:h>
     344                        <tal:t i18n:translate="">min.</tal:t>
     345                      </tal:hms>
     346                    </a>
     347                  </li>
     348                  <li>
     349                    <span>
     350                      <tal:t i18n:translate="">Higher elevation gain</tal:t>
     351                    </span>
     352                    <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_elevation_wid']])">
     353                      <tal:w tal:replace="round(sport_totals['max_elevation'])"></tal:w>
     354                      <tal:t i18n:translate="">m</tal:t>
     355                    </a>
    292356                  </li>
    293357                </ul>
Note: See TracChangeset for help on using the changeset viewer.