Commit bb5d2b44 authored by Robert Czechowski's avatar Robert Czechowski
Browse files

'contest' template 'jwinf': Make task links not clickable when contest time is up. Fixes #50

parent 5129e3a9
......@@ -296,6 +296,9 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: i32, session_token
if left_secs < 0 {
// Contest over
data.insert("is_time_left".to_string(), to_json(&false));
if c.duration > 0 {
data.insert("is_time_up".to_string(), to_json(&true));
}
} else {
data.insert("is_time_left".to_string(), to_json(&true));
let left_min = left_secs / 60;
......
......@@ -124,7 +124,13 @@
<ul>
{{#each subtasks}}
<li><a href="/task/{{id}}" class="button is-link is-outlined">{{linktext}}</a></li>
<li>
{{#if is_time_up}}
<button class="button is-link is-outlined">{{linktext}}</button>
{{else}}
<a href="/task/{{id}}" class="button is-link is-outlined">{{linktext}}</a>
{{/if}}
</li>
{{/each}}
</ul>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment