mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 17:36:40 +00:00
Fixed time format for minutes:seconds, fixed debugging output
This commit is contained in:
1 parent
db79b54fa5
commit
e7d88ddd08
3 files changed
+12
-4
No files matched your search
@@ -189,7 +189,9 @@ class BaseView(object):
|
||||
val = name[2] % value
|
||||
|
||||
if name[0] == 'ETASEC':
|
||||
val = '%.f:%.f' % (int(value) / 60, int(value)-( (int(value)/60)*60 ))
|
||||
val = '%.f:%d' % (int(value) / 60, int(value)-( (int(value)/60)*60 ))
|
||||
if len(val.split(':')[-1]) == 1:
|
||||
val = '%s0' % val
|
||||
|
||||
if name[0] == 'GLP' and value > 0:
|
||||
val = '+%s' % value
|
||||
|
||||
@@ -594,6 +594,8 @@ def moderatorLiveData(context, request):
|
||||
'current_rank' : competitor.current_rank, 'total_points' : getattr(competitor, 'total_points', 0),
|
||||
'net_points': getattr(competitor, 'net_points', 0)})
|
||||
|
||||
print dc['legvalues']
|
||||
|
||||
try:
|
||||
dc.update({'current_legs': [lg+1 for lg in current_legs], 'current_race': current_race+1})
|
||||
except:
|
||||
|
||||
@@ -94,11 +94,15 @@ function sortBy(param, element) {
|
||||
loadLeaderboard(global_race, param, global_competitors, global_direction, global_colmode);
|
||||
}
|
||||
|
||||
function yieldValue(element, newvalue, ignore_zeros) {
|
||||
if (element.html() != newvalue && !isNaN(newvalue) && newvalue != '' && newvalue != 'None') {
|
||||
function yieldValue(element, newvalue, ignore_zeros, legvalue) {
|
||||
if (element.html() != newvalue && newvalue != '' && newvalue != 'None') {
|
||||
if (ignore_zeros == true && (newvalue == '0' || newvalue == 0))
|
||||
return;
|
||||
|
||||
// special handling for minute shown
|
||||
if (isNaN(newvalue) && newvalue.indexOf(':') == -1)
|
||||
return;
|
||||
|
||||
element.html(newvalue);
|
||||
}
|
||||
}
|
||||
@@ -171,7 +175,7 @@ function displayLeaderboard(data) {
|
||||
if (legvalue == 0) {
|
||||
yieldValue($('#race-'+racepos+'-mark-'+markpos+'-legrow-'+rowid), parseFloat(competitor.legvalues[racepos-1][markpos-1][legvalue]).toFixed(), false);
|
||||
} else {
|
||||
yieldValue($('#race-'+racepos+'-mark-'+markpos+'-valrow-'+rowid+'-pos-'+(legpos-1)+' span'), competitor.legvalues[racepos-1][markpos-1][legvalue], false);
|
||||
yieldValue($('#race-'+racepos+'-mark-'+markpos+'-valrow-'+rowid+'-pos-'+(legpos-1)+' span'), competitor.legvalues[racepos-1][markpos-1][legvalue], false, legvalue);
|
||||
}
|
||||
legpos += 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user