Skip to content

Commit a9ec896

Browse files
committed
Move check to only index page
Flash messages don't allow for <a> tags unless piped with `| raw`. So we can only display the full URL.
1 parent 708f9cf commit a9ec896

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

webapp/src/Controller/Jury/JuryMiscController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public function indexAction(ConfigurationService $config): Response
5757
}
5858
}
5959

60+
$newestVersion = $this->dj->checkNewVersion();
61+
if ($newestVersion) {
62+
$this->addFlash('info', 'New release ' . $newestVersion . ' available at: https://www.domjudge.org/download.');
63+
}
64+
6065
return $this->render('jury/index.html.twig', [
6166
'adminer_enabled' => $config->get('adminer_enabled'),
6267
'CCS_SPEC_API_URL' => GI::CCS_SPEC_API_URL,

webapp/src/Twig/TwigExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ public function getGlobals(): array
163163
'doc_links' => $this->dj->getDocLinks(),
164164
'allow_registration' => $selfRegistrationCategoriesCount !== 0,
165165
'enable_ranking' => $this->config->get('enable_ranking'),
166-
'new_version_available' => $this->dj->checkNewVersion(),
167166
'editor_themes' => [
168167
'vs' => ['name' => 'Visual Studio (light)'],
169168
'vs-dark' => ['name' => 'Visual Studio (dark)'],

webapp/templates/jury/menu.html.twig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@
9393
</li>
9494
</ul>
9595
{% endif %}
96-
{% if new_version_available %}
97-
<ul class="navbar-nav">
98-
<li class="nav-item">
99-
<a class="nav-link" href="https://www.domjudge.org/download"><i class="fa-solid fa-ship fa-2x"></i> New release {{ new_version_available }} available.</a>
100-
</li>
101-
</ul>
102-
{% endif %}
10396

10497
<ul class="navbar-nav ml-auto">
10598

0 commit comments

Comments
 (0)