diff --git a/dist/main.bundle.js b/dist/main.bundle.js index 008e3485..9ec16244 100644 --- a/dist/main.bundle.js +++ b/dist/main.bundle.js @@ -75,7 +75,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); $(function () { - + setInterval(function() { var timeleft = parseInt($("#timeleft").html()); if (timeleft > 0) { @@ -83,7 +83,13 @@ $(function () { } else { timeleft = 0; } - $("#timeleft").html(timeleft) + + $("#timeleft").html(timeleft); + + var minutes = Math.floor(timeleft/60); + var seconds = timeleft % 60; + + $("#timeleft_view").html(minutes+":"+seconds.toString().padStart(2, "0")); }, 1000); $("#reloadCaptcha").on("click",function(eventObject) { @@ -154,4 +160,4 @@ $(function () { /***/ }) /******/ ]); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAgYTI3MmU1Y2NjODVjOTlkNjdlZTMiLCJ3ZWJwYWNrOi8vLy4vc3JjL2luZGV4LmpzIiwid2VicGFjazovLy8uL3NyYy9zdHlsZS5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtRQUFBO1FBQ0E7O1FBRUE7UUFDQTs7UUFFQTtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7UUFDQTs7UUFFQTtRQUNBOztRQUVBO1FBQ0E7O1FBRUE7UUFDQTtRQUNBOzs7UUFHQTtRQUNBOztRQUVBO1FBQ0E7O1FBRUE7UUFDQTtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7UUFDQSxLQUFLO1FBQ0w7UUFDQTs7UUFFQTtRQUNBO1FBQ0E7UUFDQSwyQkFBMkIsMEJBQTBCLEVBQUU7UUFDdkQsaUNBQWlDLGVBQWU7UUFDaEQ7UUFDQTtRQUNBOztRQUVBO1FBQ0Esc0RBQXNELCtEQUErRDs7UUFFckg7UUFDQTs7UUFFQTtRQUNBOzs7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NrZWQnKTtcbiAgICB9KTtcbiAgICBcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIiwiLy8gcmVtb3ZlZCBieSBleHRyYWN0LXRleHQtd2VicGFjay1wbHVnaW5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL3NyYy9zdHlsZS5jc3Ncbi8vIG1vZHVsZSBpZCA9IDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/orm/response.go b/orm/response.go index 925a0ec0..3325d824 100644 --- a/orm/response.go +++ b/orm/response.go @@ -240,7 +240,7 @@ func (model *Response) Update(db *Database, args map[string]string, w http.Respo } // Check if the contest is still active - if !response.(*Response).IsActive() { + if isParticipant(r) && !response.(*Response).IsActive() { return nil, errors.OutOfTime } @@ -251,6 +251,14 @@ func (model *Response) Update(db *Database, args map[string]string, w http.Respo return nil, err } + // If there aren't single responses then participant + // response Starttime is resetted. + if isAdministrator(r) { + if len(response.(*Response).SingleResponses) == 0 { + response.(*Response).StartTime = time.Time{} + } + } + WriteUpdater(r, response.(*Response)) _, err = SaveResponse(db, response) diff --git a/src/index.js b/src/index.js index 9d35fc28..d42ec050 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,7 @@ import './style.css' $(function () { - + setInterval(function() { var timeleft = parseInt($("#timeleft").html()); if (timeleft > 0) { @@ -10,7 +10,13 @@ $(function () { } else { timeleft = 0; } - $("#timeleft").html(timeleft) + + $("#timeleft").html(timeleft); + + var minutes = Math.floor(timeleft/60); + var seconds = timeleft % 60; + + $("#timeleft_view").html(minutes+":"+seconds.toString().padStart(2, "0")); }, 1000); $("#reloadCaptcha").on("click",function(eventObject) { diff --git a/templates/responses_add_update.html.tpl b/templates/responses_add_update.html.tpl index ce1bdb5e..39c3fd84 100644 --- a/templates/responses_add_update.html.tpl +++ b/templates/responses_add_update.html.tpl @@ -71,7 +71,8 @@
Gara
{{.Data.Contest}}
Partecipante
{{.Data.Participant}}
{{- if $isParticipant -}} -
Tempo rimanente
{{if .Data.TimeLeft}}
{{.Data.TimeLeft.Seconds|toInt}} secondi rimanenti
{{else}}
La gara è sempre attiva
{{end}} + +
Tempo rimanente
{{if .Data.TimeLeft}}
minuti rimanenti
{{else}}
La gara è sempre attiva
{{end}} {{- end -}}