alerts
This commit is contained in:
@@ -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"));
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user