Skip to content

Commit 75f5988

Browse files
committed
Only show contest samples zip when there are attachments
1 parent c6097fe commit 75f5988

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

webapp/src/Service/DOMJudgeService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ public function getTwigDataForProblemsAction(
11301130
'problems' => $problems,
11311131
'samples' => $samples,
11321132
'showLimits' => $showLimits,
1133+
'showSamples' => $this->checkIfSamplesZipForContest($contest),
11331134
'defaultMemoryLimit' => $defaultMemoryLimit,
11341135
'timeFactorDiffers' => $timeFactorDiffers,
11351136
'clarifications' => $clars,

webapp/templates/partials/problem_list.html.twig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
problemset
1818
</a>
1919
{% endif %}
20-
<a class="btn btn-secondary" href="{{ path('current_samples_data_zip', {cid: contest.cid}) }}" title="Contains samples, attachments and statement for all problems.">
21-
<i class="fas fa-download"></i> samples
22-
</a>
20+
{% if showSamples %}
21+
<a class="btn btn-secondary" href="{{ path('current_samples_data_zip', {cid: contest.cid}) }}" title="Contains samples, attachments and statement for all problems.">
22+
<i class="fas fa-download"></i> samples
23+
</a>
24+
{% endif %}
2325
{% endif %}
2426
</h1>
2527

0 commit comments

Comments
 (0)