loads thumbnails asynchronously
loads thumbnails on workflow view asynchronously using jQuery and Ajax
This commit is contained in:
@@ -28,12 +28,35 @@
|
|||||||
<script>
|
<script>
|
||||||
$(function($) {
|
$(function($) {
|
||||||
console.log('loading script');
|
console.log('loading script');
|
||||||
$.getJSON(window.location.protocol + '//'+window.location.host + '/rowers/workout/{{ workout.id }}/get-testscript', function(json) {
|
var workoutid = {{ workout.id }};
|
||||||
console.log('script loaded');
|
var shownotes = true;
|
||||||
|
if("{{ rower.showfavoritechartnotes }}" == "False") {
|
||||||
|
shownotes = false;
|
||||||
|
}
|
||||||
|
$.getJSON(window.location.protocol + '//'+window.location.host + '/rowers/workout/{{ workout.id }}/get-thumbnails', function(json) {
|
||||||
|
var counter=0;
|
||||||
$.each(json, function(index, element) {
|
$.each(json, function(index, element) {
|
||||||
console.log('adding thumbnail');
|
console.log('adding thumbnail');
|
||||||
$("#id_thumbs").append(element.div);
|
var counter2 = counter+1;
|
||||||
|
if (shownotes) {
|
||||||
|
$("#id_thumbs").append(
|
||||||
|
"<div class=\"grid_3 alpha\">"+
|
||||||
|
"<big>"+counter2+"</big>"+
|
||||||
|
"<div class=\"grid_3 tooltip\">"+
|
||||||
|
"<a href=\"/rowers/workout/"+workoutid+"/flexchart?favoritechart="+counter+"\">"+element.div+"</a>"+
|
||||||
|
"<span class=\"tooltiptext\">"+element.notes+"</span>"+
|
||||||
|
"</div></div>");
|
||||||
|
} else {
|
||||||
|
$("#id_thumbs").append(
|
||||||
|
"<div class=\"grid_3 alpha\">"+
|
||||||
|
"<big>"+counter2+"</big>"+
|
||||||
|
"<div class=\"grid_3 tooltip\">"+
|
||||||
|
"<a href=\"/rowers/workout/"+workoutid+"/flexchart?favoritechart="+counter+"\">"+element.div+"</a>"+
|
||||||
|
"</div></div>");
|
||||||
|
|
||||||
|
}
|
||||||
$("#id_thumbscripts").append(element.script);
|
$("#id_thumbscripts").append(element.script);
|
||||||
|
counter += 1;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6675,10 +6675,10 @@ def workout_workflow_view(request,id):
|
|||||||
|
|
||||||
charts = []
|
charts = []
|
||||||
|
|
||||||
if favorites and 'flexthumbnails.html' in r.workflowmiddlepanel:
|
# if favorites and 'flexthumbnails.html' in r.workflowmiddlepanel:
|
||||||
charts = thumbnails_set(r,id,favorites)
|
# charts = thumbnails_set(r,id,favorites)
|
||||||
if charts[0]['script'] == '':
|
# if charts[0]['script'] == '':
|
||||||
charts = []
|
# charts = []
|
||||||
|
|
||||||
if 'panel_map.html' in r.workflowmiddlepanel and rowhascoordinates(row):
|
if 'panel_map.html' in r.workflowmiddlepanel and rowhascoordinates(row):
|
||||||
rowdata = rdata(row.csvfilename)
|
rowdata = rdata(row.csvfilename)
|
||||||
|
|||||||
Reference in New Issue
Block a user