Skip to content

Commit b00a8ec

Browse files
moesohacubercsl
authored andcommitted
Fix #2279: get associated ContestProblem with Clarification entity
(cherry picked from commit affacb4)
1 parent 8f28862 commit b00a8ec

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

webapp/src/Entity/Clarification.php

+8
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,14 @@ public function getProblem(): ?Problem
267267
return $this->problem;
268268
}
269269

270+
public function getContestProblem(): ?ContestProblem
271+
{
272+
if (!$this->problem) {
273+
return null;
274+
}
275+
return $this->contest->getContestProblem($this->problem);
276+
}
277+
270278
/**
271279
* @Serializer\VirtualProperty()
272280
* @Serializer\SerializedName("problem_id")

webapp/templates/jury/partials/clarification_list.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
<td><a href="{{ link }}">
7373
{%- if clarification.problem -%}
74-
problem {{ clarification.problem.contestProblems.first | problemBadge -}}
74+
problem {{ clarification.contestProblem | problemBadge -}}
7575
{%- elseif clarification.category -%}
7676
{{- categories[clarification.category]|default('general') -}}
7777
{%- else -%}

webapp/templates/team/partials/clarification.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="col-sm">
55
Subject:
66
{% if clarification.problem %}
7-
Problem {{ clarification.problem.contestProblems.first.shortname }}: {{ clarification.problem.name }}
7+
Problem {{ clarification.contestProblem.shortname }}: {{ clarification.problem.name }}
88
{% elseif clarification.category %}
99
{{ categories[clarification.category]|default('general') }}
1010
{% else %}

webapp/templates/team/partials/clarification_list.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<td>
4545
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}">
4646
{%- if clarification.problem -%}
47-
problem {{ clarification.problem.contestProblems.first | problemBadge -}}
47+
problem {{ clarification.contestProblem | problemBadge -}}
4848
{%- elseif clarification.category -%}
4949
{{- categories[clarification.category]|default('general') -}}
5050
{%- else -%}

0 commit comments

Comments
 (0)