Feature: Versionsnummer in Einstellungs-Kopfzeile
This commit is contained in:
parent
6fbe281175
commit
80e351dd58
3 changed files with 11 additions and 1 deletions
|
|
@ -12,10 +12,12 @@ class SettingsController
|
|||
public function show(array $params): void
|
||||
{
|
||||
$settings = Setting::get();
|
||||
$version = trim(@file_get_contents(dirname(__DIR__, 2) . '/version.txt') ?: '');
|
||||
|
||||
$view = new View();
|
||||
$view->render('layout/base.php', [
|
||||
'pageTitle' => 'Einstellungen',
|
||||
'version' => $version,
|
||||
'topbarActions' => '<button type="submit" form="settings-form" class="btn btn-primary">Einstellungen speichern</button>',
|
||||
'content' => $this->renderView('settings/form', [
|
||||
'settings' => $settings,
|
||||
|
|
@ -35,9 +37,11 @@ class SettingsController
|
|||
if (empty($data['ort'])) $errors['ort'] = 'Pflichtfeld';
|
||||
|
||||
if ($errors) {
|
||||
$version = trim(@file_get_contents(dirname(__DIR__, 2) . '/version.txt') ?: '');
|
||||
$view = new View();
|
||||
$view->render('layout/base.php', [
|
||||
'pageTitle' => 'Einstellungen',
|
||||
'version' => $version,
|
||||
'content' => $this->renderView('settings/form', [
|
||||
'settings' => $data,
|
||||
'errors' => $errors,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,12 @@
|
|||
|
||||
<div class="main-content">
|
||||
<div class="topbar">
|
||||
<div class="topbar-title"><?= \Steuerkram\View::h($pageTitle ?? '') ?></div>
|
||||
<div class="topbar-title">
|
||||
<?= \Steuerkram\View::h($pageTitle ?? '') ?>
|
||||
<?php if (!empty($version)): ?>
|
||||
<span style="font-size:0.9rem;font-weight:normal;opacity:0.65;margin-left:.4rem"><?= \Steuerkram\View::h($version) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div style="display:flex;gap:.5rem;align-items:center;">
|
||||
<?php if (!empty($topbarActions)) echo $topbarActions; ?>
|
||||
</div>
|
||||
|
|
|
|||
1
version.txt
Normal file
1
version.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
1-260421
|
||||
Loading…
Add table
Reference in a new issue