Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2019-08-27 14:52:49 +02:00
parent f4bc72501a
commit b3046b8517
2 changed files with 0 additions and 12 deletions

View File

@@ -80,25 +80,18 @@
</script>
<script>
$(document).ready(function(){
console.log('scripts loaded');
$(".iteratorleft").click(function( event ){
event.preventDefault();
console.log('-----');
var nperiod=$(this).data().nperiod+1;
var user = $(this).data().user;
var alertid = $(this).data().alertid;
var thediv = $(this);
url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/";
console.log(url);
url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/";
console.log(url);
$.getJSON(window.location.protocol + '//' + window.location.host + url,
function(json) {
console.log(json);
var percentage = json['stats']['percentage'];
var startdate = json['stats']['startdate'];
var enddate = json['stats']['enddate'];
console.log(percentage,startdate,enddate);
thediv.siblings("#percentages").find("#percentage").text(percentage);
thediv.siblings("#dates").find("#startdate").text(startdate);
thediv.siblings("#dates").find("#enddate").text(enddate);
@@ -110,7 +103,6 @@
});
$(".iteratorright").click(function( event ){
event.preventDefault();
console.log('-----');
var nperiod=$(this).data().nperiod-1;
if ( nperiod<0 ) {
nperiod=0
@@ -120,21 +112,17 @@
var alertid = $(this).data().alertid;
var thediv = $(this)
url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/";
console.log(url);
$.getJSON(window.location.protocol + '//' + window.location.host + url,
function(json) {
console.log(json);
var percentage = json['stats']['percentage'];
var startdate = json['stats']['startdate'];
var enddate = json['stats']['enddate'];
console.log(percentage,startdate,enddate);
thediv.siblings("#percentages").find("#percentage").text(percentage);
thediv.siblings("#dates").find("#startdate").text(startdate);
thediv.siblings("#dates").find("#enddate").text(enddate);
thediv.data().nperiod=nperiod;
var nextperiod = nperiod;
thediv.siblings(".iteratorleft").data().nperiod=nextperiod;
console.log(thediv.siblings(".iteratorleft"));
});
});

Binary file not shown.