diff --git a/.github/jobs/webstandard.sh b/.github/jobs/webstandard.sh index c1fd988eca..d4e8e58a59 100755 --- a/.github/jobs/webstandard.sh +++ b/.github/jobs/webstandard.sh @@ -113,7 +113,7 @@ if [ "$TEST" = "w3cval" ]; then unzip -q vnu.linux.zip section_end - FLTR='--filterpattern .*autocomplete.*|.*style.*|.*role=tab.*|.*descendant.*|.*Stray.*|.*attribute.*|.*Forbidden.*|.*stream.*|.*obsolete.*' + FLTR='--filterpattern .*autocomplete.*|.*role=tab.*|.*descendant.*|.*Stray.*|.*attribute.*|.*Forbidden.*|.*stream.*|.*obsolete.*' for typ in html css svg do section_start "Analyse with $typ" diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 7455125a7f..52760ba653 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -13,7 +13,15 @@ jobs: steps: - uses: actions/checkout@v4 - name: Download latest codecov upload script - run: wget https://codecov.io/bash -O newcodecov + run: | + exit=1 + while [ "$exit" -ne 0 ]; do + wget https://codecov.io/bash -O newcodecov + exit="$?" + if [ "$exit" -ne 0 ]; then + sleep 30 + fi + done - name: Detect changes to manually verify run: diff newcodecov .github/jobs/uploadcodecov.sh diff --git a/webapp/src/Controller/PublicController.php b/webapp/src/Controller/PublicController.php index f5581aa8d2..9d368ad964 100644 --- a/webapp/src/Controller/PublicController.php +++ b/webapp/src/Controller/PublicController.php @@ -100,6 +100,19 @@ public function scoreboardDataZipAction( return $this->dj->getScoreboardZip($request, $requestStack, $contest, $this->scoreboardService); } + #[Route(path: '/scoreboard-category-color.css', name: 'scoreboard_category_color_css')] + public function scoreboardCategoryColorCss(Request $request): Response { + $content = $this->renderView('public/scoreboard_category_color.css.twig', $this->dj->getScoreboardCategoryColorCss()); + $response = new Response(); + $response->headers->set('Content-Type', 'text/css'); + // See: https://symfony.com/doc/current/http_cache/validation.html + $response->setEtag(md5($content)); + $response->setPublic(); + $response->isNotModified($request); + $response->setContent($content); + return $response; + } + /** * Get the contest from the request, if any */ diff --git a/webapp/src/Service/DOMJudgeService.php b/webapp/src/Service/DOMJudgeService.php index 8a442e6d25..a543fbad93 100644 --- a/webapp/src/Service/DOMJudgeService.php +++ b/webapp/src/Service/DOMJudgeService.php @@ -27,6 +27,7 @@ use App\Entity\Submission; use App\Entity\Team; use App\Entity\TeamAffiliation; +use App\Entity\TeamCategory; use App\Entity\Testcase; use App\Entity\User; use App\Utils\FreezeData; @@ -1532,6 +1533,15 @@ public function getScoreboardZip( return Utils::streamZipFile($tempFilename, 'scoreboard.zip'); } + /** + * @return array{'backgroundColors', array} + */ + public function getScoreboardCategoryColorCss(): array { + $backgroundColors = array_map(fn($x) => ( $x->getColor() ?? '#FFFFFF' ), $this->em->getRepository(TeamCategory::class)->findAll()); + $backgroundColors = array_merge($backgroundColors, ['#FFFF99']); + return ['backgroundColors' => $backgroundColors]; + } + private function allowJudge(ContestProblem $problem, Submission $submission, Language $language, bool $manualRequest): bool { if (!$problem->getAllowJudge() || !$language->getAllowJudge()) { diff --git a/webapp/templates/base.html.twig b/webapp/templates/base.html.twig index 895750ede8..9b54ed453b 100644 --- a/webapp/templates/base.html.twig +++ b/webapp/templates/base.html.twig @@ -9,6 +9,7 @@ + diff --git a/webapp/templates/partials/scoreboard_table.html.twig b/webapp/templates/partials/scoreboard_table.html.twig index 3893f25d37..1931b1cb85 100644 --- a/webapp/templates/partials/scoreboard_table.html.twig +++ b/webapp/templates/partials/scoreboard_table.html.twig @@ -581,24 +581,6 @@ {% endif %} {% endif %} -