Oberfläche Mitarbeiter-App umschaltbar (0.52.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 14m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 14m13s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 11m56s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 11m44s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 56m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 1h2m6s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m30s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 47s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m13s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 14m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 14m13s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 11m56s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 11m44s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 56m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 1h2m6s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m30s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 47s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m13s
Einstellung interface (classic|app) im Erscheinungsbild; data-ui am Wurzelelement, warme Tokens, Karten mit Schatten, Menüpunkte als Pillen; Startseite dreispaltig. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d79c6284e1
commit
38f47f98e2
145 changed files with 656 additions and 379 deletions
|
|
@ -26,6 +26,8 @@ class AppearanceColors extends AppearancePage
|
|||
protected function fields(): array
|
||||
{
|
||||
return [
|
||||
Radio::make('interface')->label('Oberfläche')->options(Theme::INTERFACES)->required()->columnSpanFull()
|
||||
->helperText('Gilt für alle. Beim Umschalten werden passende Schrift und Rundung übernommen, sofern sie noch auf der Voreinstellung stehen – beides lässt sich danach unter „Schrift & Form“ anpassen. Menü, Inhalte und Plugins bleiben gleich.'),
|
||||
ColorPicker::make('primary_color')->label('Markenfarbe')->required()->regex('/^#[0-9a-fA-F]{6}$/')->live(onBlur: true)
|
||||
->helperText('Wird exakt übernommen: Schaltflächen, aktive Navigation, Begrüßungskarte. Die Abstufungen werden berechnet.'),
|
||||
ColorPicker::make('secondary_color')->label('Zweite Akzentfarbe (optional)')->regex('/^#[0-9a-fA-F]{6}$/')->live(onBlur: true)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use App\Dashboard\Homepage;
|
|||
use App\Dashboard\Widgets;
|
||||
use App\Filament\Clusters\HomepageCluster;
|
||||
use App\Filament\Resources\DashboardTiles\DashboardTileResource;
|
||||
use App\Support\Branding;
|
||||
use App\Support\ContactCards;
|
||||
use App\Support\Settings;
|
||||
use BackedEnum;
|
||||
|
|
@ -99,13 +100,15 @@ class DashboardSettings extends Page
|
|||
'widgets' => 'Kacheln – feste Bereiche, Anordnung unten festlegen',
|
||||
'builder' => 'Frei gestaltet – mit dem Baukasten („Startseite gestalten“)',
|
||||
])
|
||||
->helperText(fn () => app(Homepage::class)->published() === null
|
||||
->helperText(fn () => (app(Branding::class)->interface() === 'app'
|
||||
? 'Hinweis: In der Oberfläche „Mitarbeiter-App“ hat die Startseite einen festen Aufbau aus Kacheln (links Begrüßung, Anwendungen und Gruppen, in der Mitte Neuigkeiten, rechts der Tag). Die frei gestaltete Startseite gilt nur für „Klassisch“. '
|
||||
: '').(app(Homepage::class)->published() === null
|
||||
? 'Die freie Gestaltung ist noch nicht veröffentlicht – bis dahin bleiben die Kacheln sichtbar. Beim ersten Öffnen übernimmt der Baukasten die heutige Anordnung.'
|
||||
: 'Alle Kacheln stehen im Baukasten als Block „Kachel“ zur Verfügung.'),
|
||||
: 'Alle Kacheln stehen im Baukasten als Block „Kachel“ zur Verfügung.')),
|
||||
]),
|
||||
...collect(self::AREAS)->map(fn ($info, $area) => Section::make($info[0])
|
||||
->description($info[1] ?: null)
|
||||
->visible(fn (Get $get) => $get('mode') !== 'builder' && app(Widgets::class)->forAdmin($area) !== [])
|
||||
->visible(fn (Get $get) => ($get('mode') !== 'builder' || app(Branding::class)->interface() === 'app') && app(Widgets::class)->forAdmin($area) !== [])
|
||||
->schema([
|
||||
Repeater::make($area)
|
||||
->hiddenLabel()
|
||||
|
|
@ -156,7 +159,7 @@ class DashboardSettings extends Page
|
|||
}
|
||||
|
||||
// Bei „Frei gestaltet“ sind die Kachel-Bereiche ausgeblendet – ihre Anordnung bleibt dann unverändert
|
||||
if (($this->data['mode'] ?? 'widgets') !== 'builder') {
|
||||
if (($this->data['mode'] ?? 'widgets') !== 'builder' || app(Branding::class)->interface() === 'app') {
|
||||
$settings->set('dashboard.layout', $layout);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,18 +4,21 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Dashboard\Homepage;
|
||||
use App\Dashboard\Widgets;
|
||||
use App\Support\Branding;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request, Widgets $widgets, Homepage $homepage): Response
|
||||
public function __invoke(Request $request, Widgets $widgets, Homepage $homepage, Branding $branding): Response
|
||||
{
|
||||
// Vorschau des Entwurfs für alle, die die Startseite gestalten
|
||||
$preview = $request->boolean('entwurf') && $request->user()->can('appearance.manage');
|
||||
|
||||
if ($preview || $homepage->isBuilder()) {
|
||||
// Die Mitarbeiter-App hat einen festen Aufbau aus Kacheln; die frei gestaltete
|
||||
// Startseite gilt für die klassische Oberfläche (Vorschau im Editor bleibt möglich)
|
||||
if ($preview || ($homepage->isBuilder() && $branding->interface() !== 'app')) {
|
||||
return Inertia::render('Dashboard', [
|
||||
'content' => $homepage->render($request->user(), draft: $preview),
|
||||
'preview' => $preview,
|
||||
|
|
|
|||
|
|
@ -106,6 +106,12 @@ class Branding
|
|||
return $covers !== [] ? $covers[array_rand($covers)] : ($theme['profile_cover'] ?? null);
|
||||
}
|
||||
|
||||
/** Oberfläche: classic oder app (Mitarbeiter-App) */
|
||||
public function interface(): string
|
||||
{
|
||||
return ($this->active()['interface'] ?? 'classic') === 'app' ? 'app' : 'classic';
|
||||
}
|
||||
|
||||
public function url(?string $path): ?string
|
||||
{
|
||||
return $path ? Storage::disk('uploads')->url($path) : null;
|
||||
|
|
@ -184,6 +190,7 @@ class Branding
|
|||
'header_style' => $theme['header_style'],
|
||||
'nav_style' => $theme['nav_style'] ?? 'bar',
|
||||
'page_header' => $theme['page_header'] ?? 'band',
|
||||
'interface' => $theme['interface'] ?? 'classic',
|
||||
'color_mode' => $this->forcedColorMode(),
|
||||
'login' => [
|
||||
'layout' => $theme['login_layout'],
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ class Theme
|
|||
'header_style' => 'light',
|
||||
'nav_style' => 'bar',
|
||||
'page_header' => 'band',
|
||||
// Oberfläche: classic (Portal mit Menüleiste und Kacheln) oder app (Mitarbeiter-App: Feed, warme Flächen)
|
||||
'interface' => 'classic',
|
||||
'font_body' => 'inter',
|
||||
'font_heading' => 'same',
|
||||
'custom_font' => null,
|
||||
|
|
@ -60,6 +62,18 @@ class Theme
|
|||
'bold' => 'Kräftiger Titel mit Akzentstrich',
|
||||
];
|
||||
|
||||
/** Grundsätzliche Oberfläche – gilt für alle, die Administration legt sie fest */
|
||||
public const INTERFACES = [
|
||||
'classic' => 'Klassisch – Menüleiste, Startseite mit Kacheln',
|
||||
'app' => 'Mitarbeiter-App – Neuigkeiten und Menschen im Mittelpunkt, warme Flächen, runde Formen',
|
||||
];
|
||||
|
||||
/** Schrift und Rundung, die zur Oberfläche passen – beim Umschalten übernommen, solange unverändert */
|
||||
public const INTERFACE_PRESETS = [
|
||||
'classic' => ['font_body' => 'inter', 'radius' => 'medium'],
|
||||
'app' => ['font_body' => 'figtree', 'radius' => 'round'],
|
||||
];
|
||||
|
||||
public const RADII = ['none' => ['Eckig', '0rem'], 'small' => ['Leicht gerundet', '0.25rem'], 'medium' => ['Gerundet', '0.5rem'], 'large' => ['Stark gerundet', '0.75rem'], 'round' => ['Rund', '1rem']];
|
||||
|
||||
public const DENSITIES = ['compact' => ['Kompakt', '0.225rem'], 'normal' => ['Normal', '0.25rem'], 'comfortable' => ['Luftig', '0.275rem']];
|
||||
|
|
@ -120,7 +134,18 @@ class Theme
|
|||
*/
|
||||
public function saveDraft(array $values): void
|
||||
{
|
||||
$theme = self::normalize([...$this->working(), ...$values]);
|
||||
$before = $this->working();
|
||||
$theme = self::normalize([...$before, ...$values]);
|
||||
|
||||
// Oberfläche umgeschaltet: passende Schrift und Rundung mitnehmen – aber nur, wo noch
|
||||
// die Voreinstellung der bisherigen Oberfläche steht (eigene Wahl bleibt erhalten)
|
||||
if ($theme['interface'] !== $before['interface']) {
|
||||
foreach (self::INTERFACE_PRESETS[$theme['interface']] as $key => $value) {
|
||||
if ($theme[$key] === self::INTERFACE_PRESETS[$before['interface']][$key]) {
|
||||
$theme[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Alle Bildfelder – jedes könnte eine SVG-Datei sein
|
||||
foreach (['logo_light', 'logo_dark', 'logo_mark', 'app_icon', 'login_image', 'profile_cover', 'avatar_placeholder'] as $image) {
|
||||
|
|
@ -194,6 +219,7 @@ class Theme
|
|||
$theme['header_style'] = array_key_exists($theme['header_style'], self::HEADER_STYLES) ? $theme['header_style'] : 'light';
|
||||
$theme['nav_style'] = array_key_exists((string) ($theme['nav_style'] ?? ''), self::NAV_STYLES) ? $theme['nav_style'] : 'bar';
|
||||
$theme['page_header'] = array_key_exists((string) ($theme['page_header'] ?? ''), self::PAGE_HEADERS) ? $theme['page_header'] : 'band';
|
||||
$theme['interface'] = array_key_exists((string) ($theme['interface'] ?? ''), self::INTERFACES) ? $theme['interface'] : 'classic';
|
||||
$theme['font_body'] = array_key_exists($theme['font_body'], Fonts::FONTS) || ($theme['font_body'] === 'custom' && $theme['custom_font']) ? $theme['font_body'] : 'inter';
|
||||
$theme['font_heading'] = $theme['font_heading'] === 'same' || array_key_exists($theme['font_heading'], Fonts::FONTS) || ($theme['font_heading'] === 'custom' && $theme['custom_font']) ? $theme['font_heading'] : 'same';
|
||||
$theme['radius'] = array_key_exists($theme['radius'], self::RADII) ? $theme['radius'] : 'medium';
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@ namespace App;
|
|||
*/
|
||||
final class Version
|
||||
{
|
||||
public const VERSION = '0.51.0';
|
||||
public const VERSION = '0.52.0';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue