Skip to content

Commit 1115d33

Browse files
committed
Link from card on contests overview page to single contest page
The issue suggested using the header only but that felt a bit hard for people to find the link so the whole card is used now. The buttons in the card still work with their own links. Fixes: #2462
1 parent 4fb25aa commit 1115d33

File tree

1 file changed

+42
-40
lines changed

1 file changed

+42
-40
lines changed

webapp/templates/jury/contests.html.twig

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,53 @@
1515
<h3>Current contests</h3>
1616

1717
{% for contest in current_contests %}
18-
<div class="row mb-4">
19-
<div class="col-lg-8">
20-
<div class="card">
21-
<div class="card-header">
22-
{{ contest.name }} ({{ contest.shortname }} - c{{ contest.cid }})
23-
{% if contest.locked %}
24-
<i class="fas fa-lock"></i>
25-
{% endif %}
26-
</div>
27-
<div class="card-body">
28-
{% if not contest.starttimeEnabled and contest.finalizetime is not empty %}
29-
<div class="alert alert-warning">
30-
<strong>Warning:</strong> start time is undefined, but contest is finalized!
31-
</div>
32-
{% endif %}
33-
<table class="table table-hover">
34-
<tbody>
35-
{% for type, data in contest.dataForJuryInterface %}
36-
<tr>
37-
<td class="{{ data.class|default('') }}">
38-
{% if data.icon is defined %}
39-
<i class="fas fa-{{ data.icon }}"></i>
40-
{% endif %}
41-
</td>
42-
<td class="{{ data.class|default('') }}"><b>{{ data.label }}:</b></td>
43-
<td class="{{ data.class|default('') }}">{{ data.time }}</td>
44-
{% if is_granted('ROLE_ADMIN') %}
45-
<td>
46-
{% if data.show_button %}
47-
{% set button_label = type ~ " now" %}
48-
{{ button(path('jury_contest_donow', {'contestId': contest.cid, 'time': type}), button_label, 'primary btn-sm') }}
49-
{% endif %}
50-
{% if data.extra_button is defined %}
51-
{{ button(path('jury_contest_donow', {'contestId': contest.cid, 'time': data.extra_button.type}), data.extra_button.label, 'primary btn-sm') }}
18+
<a href={{ path('jury_contest', {'contestId': contest.cid}) }}>
19+
<div class="row mb-4">
20+
<div class="col-lg-8">
21+
<div class="card">
22+
<div class="card-header">
23+
{{ contest.name }} ({{ contest.shortname }} - c{{ contest.cid }})
24+
{% if contest.locked %}
25+
<i class="fas fa-lock"></i>
26+
{% endif %}
27+
</div>
28+
<div class="card-body">
29+
{% if not contest.starttimeEnabled and contest.finalizetime is not empty %}
30+
<div class="alert alert-warning">
31+
<strong>Warning:</strong> start time is undefined, but contest is finalized!
32+
</div>
33+
{% endif %}
34+
<table class="table table-hover">
35+
<tbody>
36+
{% for type, data in contest.dataForJuryInterface %}
37+
<tr>
38+
<td class="{{ data.class|default('') }}">
39+
{% if data.icon is defined %}
40+
<i class="fas fa-{{ data.icon }}"></i>
5241
{% endif %}
5342
</td>
54-
{% endif %}
55-
</tr>
56-
{% endfor %}
57-
</tbody>
58-
</table>
43+
<td class="{{ data.class|default('') }}"><b>{{ data.label }}:</b></td>
44+
<td class="{{ data.class|default('') }}">{{ data.time }}</td>
45+
{% if is_granted('ROLE_ADMIN') %}
46+
<td>
47+
{% if data.show_button %}
48+
{% set button_label = type ~ " now" %}
49+
{{ button(path('jury_contest_donow', {'contestId': contest.cid, 'time': type}), button_label, 'primary btn-sm') }}
50+
{% endif %}
51+
{% if data.extra_button is defined %}
52+
{{ button(path('jury_contest_donow', {'contestId': contest.cid, 'time': data.extra_button.type}), data.extra_button.label, 'primary btn-sm') }}
53+
{% endif %}
54+
</td>
55+
{% endif %}
56+
</tr>
57+
{% endfor %}
58+
</tbody>
59+
</table>
60+
</div>
5961
</div>
6062
</div>
6163
</div>
62-
</div>
64+
</a>
6365
{% else %}
6466
{% if upcoming_contest is empty %}
6567
<div class="alert alert-danger">

0 commit comments

Comments
 (0)