Changeset d1c4782 in OpenWorkouts-current for ow/templates


Ignore:
Timestamp:
Jan 21, 2019, 10:43:20 AM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
be40b02
Parents:
ceae158
Message:

Show a capture of the workout map, as an image, in the dashboard:

  • Added a view to render the tracking map of a workout full screen
  • Added a small shell script that uses chrome to grabs a screenshot of the full screen map view of a workout, then uses imagemagick convert to crop/resize it and finally saves it in a given location
  • Added a static/maps directory to store maps captures
  • Added static/maps to the boring/ignore file
  • Added a tool in utilities.py to call the shell script that captures the screenshot of the map
  • Added a method to the Workout model, that returns the static path to the workout map capture (valid to use with request.static_url()). If there is no capture yet, call the tool to make one
  • Added code to dashboard.pt to show the capture of the map
  • Added a new parameter to te ow maps js code, allowing us to hide/show the zoom controls of the map when building a new one
Location:
ow/templates
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • ow/templates/dashboard.pt

    rceae158 rd1c4782  
    9090            <div class="workout-intro" tal:content="workout.notes"></div>
    9191
     92            <div class="workout-map" tal:condition="workout.has_gpx">
     93                <a href="" tal:attributes="href request.resource_url(workout)">
     94                    <img src="" tal:attributes="src request.static_url(workout.map_screenshot);
     95                              alt workout.title; title workout.title">
     96                </a>
     97            </div>
     98
    9299            <ul class="workout-options">
    93100              <li class="owo-edit"><a href="" i18n:translate="" tal:attributes="href request.resource_url(workout, 'edit')"><span>edit</span></a></li>
  • ow/templates/workout.pt

    rceae158 rd1c4782  
    160160         end_icon: '${request.static_url('ow:static/components/leaflet-gpx/pin-icon-end.png')}',
    161161         shadow: '${request.static_url('ow:static/components/leaflet-gpx/pin-shadow.png')}',
    162          elevation: true
     162         elevation: true,
     163         zoom_control: true
    163164     });
    164165     workout_map.render();
Note: See TracChangeset for help on using the changeset viewer.