Implement #513 for submissions

This commit is contained in:
Quantum 2017-05-27 21:14:56 -04:00
parent 121ad3450a
commit 9f73816c81
2 changed files with 20 additions and 1 deletions

View File

@ -58,7 +58,6 @@ function EventReceiver(websocket, poller, channels, last_msg, onmessage) {
receiver.last_msg = data.id;
};
this.websocket.onclose = function (event) {
console.log('Websocket closed:', event);
if (event.code != 1000 && receiver.onwsclose !== null)
receiver.onwsclose(event);
}

View File

@ -156,6 +156,9 @@ block js_media
);
receiver.onwsclose = function () {
console.log('You probably should refresh?');
$('.ws-closed').show().find('a').click(function () {
window.location.reload();
});
};
return receiver;
}
@ -169,6 +172,21 @@ block title_row
include submission/submission-list-tabs
block media
style.
.ws-closed {
position: sticky;
top: 42px;
background: #eee;
border-radius: 5px 5px 0 0;
display: none;
}
.ws-closed a {
display: block;
padding: 5px 0;
text-align: center;
}
if perms.judge.change_submission and perms.judge.rejudge_submission
style.
td.sub-prop, col.sub-prop { width: 22% }
@ -207,6 +225,8 @@ block body
div(style='margin-bottom:6px;margin-top:3px')
include list-pages
.ws-closed: a(href='javascript:void(0)')
- trans "You were disconnected. Refresh to show latest updates."
table#submissions-table.table
colgroup
col.sub-result