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


Ignore:
Timestamp:
Jan 31, 2019, 12:33:38 PM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
1183d5a, 9ab0fe3
Parents:
8fedd17
Message:

(#7) Show workouts in the profile page related to the highlighted/current month

selected in the yearly chart.

Also, allow users to click on the monthly bars on the chart, to choose that month.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/templates/profile.pt

    r8fedd17 rdbfab70  
    5959      </div>
    6060
    61       <div class="profile-bio" tal:content="getattr(context, 'bio', '')">
    62       </div>
     61      <div class="profile-bio" tal:content="getattr(context, 'bio', '')"></div>
    6362
    64       <div class="workouts">
     63      <div class="profile-workouts">
    6564        <tal:t i18n:translate="">Total number of workouts</tal:t>:
    6665        <tal:w tal:replace="context.num_workouts"></tal:w>
    67       </div>
    68 
    69       <div class="latest-workouts">
    70         <p i18n:translate="">Latest workouts</p>
    71         <tal:r tal:repeat="workout context.workouts()[:5]">
    72           <div class="workout">
    73             <tal:c tal:content="workout.sport"></tal:c> -
    74             <a href="" tal:content="workout.title"
    75                tal:attributes="href request.resource_url(workout)"></a>
    76             (<tal:c tal:content="workout.start"></tal:c>,
    77             <tal:c tal:content="workout.duration"></tal:c>,
    78             <tal:c tal:content="workout.rounded_distance"></tal:c> km)
    79           </div>
    80         </tal:r>
    8166      </div>
    8267
     
    8974        </div>
    9075      </div>
     76
     77
     78      <tal:r tal:repeat="workout workouts">
     79
     80        <a name="workouts"></a>
     81
     82
     83        <article class="workout-resume">
     84
     85          <h2 class="workout-title">
     86            <a href="" tal:content="workout.title"
     87               tal:attributes="href request.resource_url(workout)"></a>
     88          </h2>
     89
     90          <ul class="workout-info">
     91            <li>
     92              <tal:c tal:content="workout.start_in_timezone(context.timezone)"></tal:c>
     93            </li>
     94            <li>
     95              <!--! use the properly formatted duration instead of the timedelta object -->
     96              <tal:c tal:content="workout._duration"></tal:c>
     97            </li>
     98            <li tal:condition="workout.distance">
     99              <tal:c tal:content="workout.rounded_distance"></tal:c> km
     100            </li>
     101          </ul>
     102
     103          <ul class="workout-info" tal:define="hr workout.hr; cad workout.cad">
     104            <li tal:condition="hr">
     105              <span i18n:translate="">HR (bpm)</span>:
     106              <tal:c tal:content="hr['min']"></tal:c>
     107              <tal:t i18n:translate="">Min.</tal:t>,
     108              <tal:c tal:content="hr['avg']"></tal:c>
     109              <tal:t i18n:translate="">Avg.</tal:t>,
     110              <tal:c tal:content="hr['max']"></tal:c>
     111              <tal:t i18n:translate="">Max.</tal:t>
     112            </li>
     113            <li tal:condition="cad">
     114              <span i18n:translate="">Cad</span>:
     115              <tal:c tal:content="cad['min']"></tal:c>
     116              <tal:t i18n:translate="">Min.</tal:t>,
     117              <tal:c tal:content="cad['avg']"></tal:c>
     118              <tal:t i18n:translate="">Avg.</tal:t>,
     119              <tal:c tal:content="cad['max']"></tal:c>
     120              <tal:t i18n:translate="">Max.</tal:t>
     121            </li>
     122          </ul>
     123
     124          <div class="workout-intro" tal:content="workout.notes"></div>
     125
     126          <div class="workout-map" tal:condition="workout.has_gpx">
     127            <a href="" tal:attributes="href request.resource_url(workout)">
     128              <img src="" tal:attributes="src request.static_url(workout.map_screenshot);
     129                        alt workout.title; title workout.title">
     130            </a>
     131          </div>
     132
     133        </article>
     134
     135      </tal:r>
    91136
    92137    </div>
Note: See TracChangeset for help on using the changeset viewer.