test
This commit is contained in:
@@ -24,14 +24,14 @@
|
|||||||
title="Delete">
|
title="Delete">
|
||||||
<i class="fas fa-trash-alt fa-fw"></i>
|
<i class="fas fa-trash-alt fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
<a class="small iteratorleft"
|
<a class="small iteratorleft"
|
||||||
data-nperiod="{{ stats|alertnperiod:forloop.counter }}"
|
data-nperiod="{{ stats|alertnperiod:forloop.counter }}"
|
||||||
data-user="{{ rower.user.id }}"
|
data-user="{{ rower.user.id }}"
|
||||||
data-alertid="{{ alert.id }}"
|
data-alertid="{{ alert.id }}"
|
||||||
href="/rowers/alerts/{{ alert.id }}/report/">
|
href="/rowers/alerts/{{ alert.id }}/report/">
|
||||||
<i class="fas fa-arrow-alt-left fa-fw"></i>
|
<i class="fas fa-arrow-alt-left fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
<a class="small iteratorright"
|
<a class="small iteratorright"
|
||||||
data-nperiod="{{ stats|alertnperiod:forloop.counter }}"
|
data-nperiod="{{ stats|alertnperiod:forloop.counter }}"
|
||||||
data-user="{{ rower.user.id }}"
|
data-user="{{ rower.user.id }}"
|
||||||
data-alertid="{{ alert.id }}"
|
data-alertid="{{ alert.id }}"
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<i class="fas fa-arrow-alt-right fa-fw"></i>
|
<i class="fas fa-arrow-alt-right fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
<hr>
|
<hr>
|
||||||
<a id="percentages" href="/rowers/alerts/{{ alert.id }}/report/">
|
<a id="percentages" href="/rowers/alerts/{{ alert.id }}/report/">
|
||||||
<div>
|
<div>
|
||||||
<h1><span id="percentage">{{ stats|alertstatspercentage:forloop.counter }}</span>%</h1>
|
<h1><span id="percentage">{{ stats|alertstatspercentage:forloop.counter }}</span>%</h1>
|
||||||
</div>
|
</div>
|
||||||
@@ -89,6 +89,7 @@
|
|||||||
var alertid = $(this).data().alertid;
|
var alertid = $(this).data().alertid;
|
||||||
var thediv = $(this);
|
var thediv = $(this);
|
||||||
url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/";
|
url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/";
|
||||||
|
console.log(url);
|
||||||
$.getJSON(window.location.protocol + '//' + window.location.host + url,
|
$.getJSON(window.location.protocol + '//' + window.location.host + url,
|
||||||
function(json) {
|
function(json) {
|
||||||
var percentage = json['stats']['percentage'];
|
var percentage = json['stats']['percentage'];
|
||||||
@@ -109,11 +110,11 @@
|
|||||||
if ( nperiod<0 ) {
|
if ( nperiod<0 ) {
|
||||||
nperiod=0
|
nperiod=0
|
||||||
};
|
};
|
||||||
|
|
||||||
var user = $(this).data().user;
|
var user = $(this).data().user;
|
||||||
var alertid = $(this).data().alertid;
|
var alertid = $(this).data().alertid;
|
||||||
var thediv = $(this)
|
var thediv = $(this)
|
||||||
url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/";
|
url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/";
|
||||||
$.getJSON(window.location.protocol + '//' + window.location.host + url,
|
$.getJSON(window.location.protocol + '//' + window.location.host + url,
|
||||||
function(json) {
|
function(json) {
|
||||||
var percentage = json['stats']['percentage'];
|
var percentage = json['stats']['percentage'];
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -646,12 +646,12 @@ def workout_nkimport_view(request, userid=0, after=0, before=0):
|
|||||||
startdate = startdate.date()
|
startdate = startdate.date()
|
||||||
enddate = enddate.date()
|
enddate = enddate.date()
|
||||||
r = getrequestrower(request, userid=userid)
|
r = getrequestrower(request, userid=userid)
|
||||||
if r.user != request.user: # pragma: no cover
|
#if r.user != request.user: # pragma: no cover
|
||||||
messages.error(
|
# messages.error(
|
||||||
request, 'You can only access your own workouts on the NK Logbook, not those of your athletes')
|
# request, 'You can only access your own workouts on the NK Logbook, not those of your athletes')
|
||||||
url = reverse('workout_nkimport_view', kwargs={
|
# url = reverse('workout_nkimport_view', kwargs={
|
||||||
'userid': request.user.id})
|
# 'userid': request.user.id})
|
||||||
return HttpResponseRedirect(url)
|
# return HttpResponseRedirect(url)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_ = nk_open(request.user)
|
_ = nk_open(request.user)
|
||||||
|
|||||||
Reference in New Issue
Block a user