Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/jobs/webstandard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,21 @@ if [ $RET -ne 0 ] && [ $RET -ne 4 ] && [ $RET -ne 8 ]; then
exit $RET
fi

EXPECTED_HTTP_CODES="200\|302\|400\|404\|403"
EXPECTED_HTTP_CODES="200\|302\|400\|403"
if [ "$ROLE" = "public" ]; then
# It's expected to encounter a 401 for the login page as we supply the wrong password
EXPECTED_HTTP_CODES="$EXPECTED_HTTP_CODES\|401"
fi

HTTP_404_IGNORED="robots.txt\|imgBase.replace"

set +e
NUM_ERRORS=$(grep -v "HTTP/1.1\" \($EXPECTED_HTTP_CODES\)" /var/log/nginx/domjudge.log | grep -v "robots.txt" -c; if [ "$?" -gt 1 ]; then exit 127; fi)
NUM_ERRORS=$(grep -v "HTTP/1.1\" \($EXPECTED_HTTP_CODES\)" /var/log/nginx/domjudge.log | grep -v "${HTTP_404_IGNORED}" -c; if [ "$?" -gt 1 ]; then exit 127; fi)
set -e
echo "$NUM_ERRORS"

if [ "$NUM_ERRORS" -ne 0 ]; then
grep -v "HTTP/1.1\" \($EXPECTED_HTTP_CODES\)" /var/log/nginx/domjudge.log | grep -v "robots.txt"
grep -v "HTTP/1.1\" \($EXPECTED_HTTP_CODES\)" /var/log/nginx/domjudge.log | grep -v "${HTTP_404_IGNORED}"
exit 1
fi
section_end
Expand Down
2 changes: 2 additions & 0 deletions doc/manual/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ install-docs: docs
$(INSTALL_DATA) -t $(DESTDIR)$(domjudge_docdir)/manual build/domjudge-team-manual.pdf

inplace-install: docs
ifeq ($(BUILD_DOCS),yes)
inplace-install-l:
ln -sf build/html
ln -sf build/team
ln -sf build/domjudge-team-manual.pdf
endif

inplace-uninstall-l:
-rm -f html team
Expand Down
9 changes: 8 additions & 1 deletion webapp/src/Controller/Jury/JuryMiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Composer\InstalledVersions;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query\Expr\Join;
use Symfony\Component\Asset\Packages;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand Down Expand Up @@ -50,7 +51,7 @@

#[IsGranted(new Expression("is_granted('ROLE_JURY') or is_granted('ROLE_BALLOON') or is_granted('ROLE_CLARIFICATION_RW')"))]
#[Route(path: '', name: 'jury_index')]
public function indexAction(ConfigurationService $config): Response
public function indexAction(ConfigurationService $config, Packages $assets): Response
{
if ($this->isGranted('ROLE_ADMIN')) {
$innodbSnapshotIsolation = $this->em->getConnection()->executeQuery('SHOW VARIABLES LIKE "innodb_snapshot_isolation"')->fetchAssociative();
Expand All @@ -64,9 +65,15 @@
$this->addFlash('info', 'New release ' . $newestVersion . ' available at: https://www.domjudge.org/download.');
}

$assetUrls = [];
foreach(['domjudge_manual' => ['doc/manual/html/index.html', 'docs/manual/index.html'], 'team_manual' => ['doc/manual/domjudge-team-manual.pdf', 'docs/manual/team.html']] as $key => $file) {

Check failure on line 69 in webapp/src/Controller/Jury/JuryMiscController.php

View workflow job for this annotation

GitHub Actions / phpcs

Expected 1 space(s) after FOREACH keyword; 0 found
$assetUrls[$key] = file_exists($this->dj->getDomjudgeWebappDir() . '/public/' . $file[0]) ? $assets->getUrl($file[0]) : 'https://domjudge.org/' . $file[1];
};

return $this->render('jury/index.html.twig', [
'adminer_enabled' => $config->get('adminer_enabled'),
'CCS_SPEC_API_URL' => GI::CCS_SPEC_API_URL,
'asset_urls' => $assetUrls,
]);
}

Expand Down
4 changes: 2 additions & 2 deletions webapp/templates/jury/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
</div>
<div class="card-body">
<ul>
<li><a href="{{ asset('doc/manual/html/index.html') }}">DOMjudge manual</a></li>
<li><a href="{{ asset('doc/manual/domjudge-team-manual.pdf') }}">Team manual <i class="fas fa-file-pdf"></i></a></li>
<li><a href="{{ asset_urls['domjudge_manual'] }}">DOMjudge manual</a></li>
<li><a href="{{ asset_urls['team_manual'] }}">Team manual <i class="fas fa-file-pdf"></i></a></li>
<li><a href="{{ path('app.swagger_ui') }}">API documentation</a><br />
See also the <a href="{{ CCS_SPEC_API_URL }}">ICPC Contest API</a>.</li>
</ul>
Expand Down
Loading