Fassung 1.0.1: die laufende Fassung steht in der Verwaltung
Eine kleine, von außen sichtbare Änderung - sie ist der Prüfstein für das Update: nach dem Einspielen muss in der Seitenleiste 1.0.1 stehen, und der Weg dorthin muss die Schritte gegangen sein, die der Updater verspricht. Die Fassung kommt über eine Twig-Funktion in die Vorlage, nicht über einen globalen Dienst: die Vorlagen bekommen genau diese eine lesende Antwort und nicht einen Updater mit update() darauf. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
52f0ab3807
commit
5a8d67a638
4 files changed
+28
-1
No files matched your search
@@ -600,3 +600,4 @@ details.card > summary:hover { background: #fafbf8 }
|
||||
.check-bad { color: var(--danger) }
|
||||
.log-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px }
|
||||
.log-list code { font-size: 11px; overflow-wrap: anywhere }
|
||||
.shell-version { margin: 0 0 4px; padding: 0 10px; font-size: 10px; color: var(--shell-muted) }
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Twig;
|
||||
|
||||
use App\Ops\Updater;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* The running version, for the administration shell.
|
||||
*
|
||||
* A function rather than a global, so the templates get exactly this one read-only answer and not
|
||||
* a whole updater with an update() method on it.
|
||||
*/
|
||||
final class VersionExtension extends AbstractExtension
|
||||
{
|
||||
public function __construct(private Updater $updater)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [new TwigFunction('kant_version', $this->updater->version(...))];
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="shell-foot">
|
||||
<p class="shell-version">Fassung {{ kant_version() }}</p>
|
||||
<a class="shell-user" href="{{ path('admin_account') }}"{{ nav|default('') == 'account' ? ' aria-current="page"' : '' }}><span class="shell-avatar" aria-hidden="true">{{ app.user.userIdentifier|first|upper }}</span><strong>{{ app.user.userIdentifier }}</strong></a>
|
||||
<form action="{{ path('admin_logout') }}" method="post">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('logout') }}">
|
||||
|
||||
Reference in new issue
Block a user