mirror of
https://github.com/DMOJ/online-judge.git
synced 2024-11-25 16:32:37 +08:00
Fix submission table for 0 submissions
This commit is contained in:
parent
df50e80e88
commit
803a8cb77b
@ -82,7 +82,7 @@ function init_submission_table($, submission_activity, metadata, language_code)
|
||||
.append($('<td>').addClass('activity-blank').append('<div>'));
|
||||
}
|
||||
|
||||
var max_activity = Math.max.apply(null, days.map(function (obj) { return obj.activity; }));
|
||||
var max_activity = Math.max(1, Math.max.apply(null, days.map(function (obj) { return obj.activity; })));
|
||||
days.forEach(function (obj) {
|
||||
var level = Math.ceil((obj.activity / max_activity) * (activity_levels - 1));
|
||||
var text = ngettext('%(cnt)d submission on %(date)s', '%(cnt)d submissions on %(date)s', obj.activity)
|
||||
|
Loading…
Reference in New Issue
Block a user