Private
Public Access
1
0

able to load scripts but cannot get them to go to the right place

Work in progress
This commit is contained in:
Sander Roosendaal
2017-11-04 17:12:40 +01:00
parent 54f06baf48
commit 80f4ca585b
5 changed files with 64 additions and 15 deletions

View File

@@ -1,17 +1,10 @@
{% if charts %}
<h2>Flex Charts</h2>
<p>Click on the thumbnails to view the full chart.</p>
{% for chart in charts %}
<div class="grid_3 alpha">
<big>{{ forloop.counter }}</big>
<div class="grid_3 tooltip">
<a href="/rowers/workout/{{ workout.id }}/flexchart?favoritechart={{ forloop.counter |add:"-1" }}">
{{ chart.div | safe }}
</a>
{% if rower.showfavoritechartnotes %}
<span class="tooltiptext">{{ chart.notes }}</span>
{% endif %}
</div>
</div>
{% endfor %}
{% endif %}
<div id="id_thumbscripts">
</div>
<div id="id_thumbs">
</div>

View File

@@ -25,6 +25,20 @@
{% block scripts %}
{% include "monitorjobs.html" %}
<script>
$(function($) {
console.log('loading script');
$.getJSON(window.location.protocol + '//'+window.location.host + '/rowers/workout/{{ workout.id }}/get-testscript', function(json) {
console.log('script loaded');
$.each(json, function(index, element) {
console.log('adding thumbnail');
$("#id_thumbs").append(element.div);
$("#id_thumbscripts").append(element.script);
});
});
});
</script>
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% for chart in charts %}
<div class="grid_3 alpha">
<big>{{ forloop.counter }}</big>
<div class="grid_3 tooltip">
<a href="/rowers/workout/{{ workout.id }}/flexchart?favoritechart={{ forloop.counter |add:"-1" }}">
{{ chart.div | safe }}
</a>
{% if rower.showfavoritechartnotes %}
<span class="tooltiptext">{{ chart.notes }}</span>
{% endif %}
</div>
</div>
{% endfor %}
{% endif %}