Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix 2279 backport #2644

Open
wants to merge 9 commits into
base: 8.2
Choose a base branch
from
Prev Previous commit
Next Next commit
Rename problemBadgeForProblemAndContest to problemBadgeForContest
(cherry picked from commit eaf95fe)
moesoha authored and cubercsl committed Aug 3, 2024
commit 827c1831f6a471d823665adefc08dbb2cad3c0f1
4 changes: 2 additions & 2 deletions webapp/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@ public function getFilters(): array
new TwigFilter('tsvField', [$this, 'toTsvField']),
new TwigFilter('fileTypeIcon', [$this, 'fileTypeIcon']),
new TwigFilter('problemBadge', [$this, 'problemBadge'], ['is_safe' => ['html']]),
new TwigFilter('problemBadgeForProblemAndContest', [$this, 'problemBadgeForProblemAndContest'], ['is_safe' => ['html']]),
new TwigFilter('problemBadgeForContest', [$this, 'problemBadgeForContest'], ['is_safe' => ['html']]),
new TwigFilter('printMetadata', [$this, 'printMetadata'], ['is_safe' => ['html']]),
new TwigFilter('printWarningContent', [$this, 'printWarningContent'], ['is_safe' => ['html']]),
new TwigFilter('entityIdBadge', [$this, 'entityIdBadge'], ['is_safe' => ['html']]),
@@ -1108,7 +1108,7 @@ public function problemBadge(ContestProblem $problem): string
);
}

public function problemBadgeForProblemAndContest(Problem $problem, ?Contest $contest = null): string
public function problemBadgeForContest(Problem $problem, ?Contest $contest = null): string
{
$contest ??= $this->dj->getCurrentContest();
$contestProblem = $contest?->getContestProblem($problem);
4 changes: 2 additions & 2 deletions webapp/templates/jury/executable.html.twig
Original file line number Diff line number Diff line change
@@ -48,14 +48,14 @@
{% if executable.type == 'compare' %}
{% for problem in executable.problemsCompare %}
<a href="{{ path('jury_problem', {'probId': problem.probid}) }}">
p{{ problem.probid }} {{ problem | problemBadgeForProblemAndContest(current_contest) }}
p{{ problem.probid }} {{ problem | problemBadgeForContest }}
</a>
{% set used = true %}
{% endfor %}
{% elseif executable.type == 'run' %}
{% for problem in executable.problemsRun %}
<a href="{{ path('jury_problem', {'probId': problem.probid}) }}">
p{{ problem.probid }} {{ problem | problemBadgeForProblemAndContest(current_contest) }}
p{{ problem.probid }} {{ problem | problemBadgeForContest }}
</a>
{% set used = true %}
{% endfor %}