Einfache Ansicht für Klienten (0.57.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Failing after 8m49s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 8m47s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 8m40s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 9m24s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 11m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 12m4s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m37s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 45s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m12s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 10m41s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Failing after 8m49s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 8m47s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 8m40s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 9m24s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 11m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 12m4s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m37s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 45s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m12s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 10m41s
Rollen-Schalter simple_ui: größere Schrift, Leichte Sprache automatisch, Startseite mit großen Kacheln; Hinweis in „Was sieht wer?“. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cd5b23d166
commit
b967c16b6d
147 changed files with 550 additions and 380 deletions
|
|
@ -60,6 +60,9 @@ class RoleResource extends Resource
|
|||
->schema([
|
||||
TextInput::make('name')->label('Name')->required()->maxLength(100)->disabled(fn (?Role $record) => $record?->is_system),
|
||||
Textarea::make('description')->label('Beschreibung')->rows(2)->maxLength(500),
|
||||
Toggle::make('simple_ui')->label('Einfache Ansicht')->columnSpanFull()
|
||||
->visible(fn (?Role $record) => ! $record?->isAdministration())
|
||||
->helperText('Für Personen, die das Portal einfach nutzen sollen (z. B. Klienten): größere Schrift und Knöpfe, Leichte Sprache wo vorhanden, Startseite mit großen Kacheln. Welche Bereiche die Rolle sieht, legen Sie unter „Was sieht wer?“ fest.'),
|
||||
]),
|
||||
|
||||
Section::make('Globale Rechte')
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ class DashboardController extends Controller
|
|||
|
||||
// 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')) {
|
||||
// Einfache Ansicht (z. B. Klienten): immer die Kacheln – groß und klar statt frei gestaltet
|
||||
if ($preview || ($homepage->isBuilder() && $branding->interface() !== 'app' && ! $request->user()->usesSimpleUi())) {
|
||||
return Inertia::render('Dashboard', [
|
||||
'content' => $homepage->render($request->user(), draft: $preview),
|
||||
'preview' => $preview,
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ class HandleInertiaRequests extends Middleware
|
|||
'cover_url' => $user->coverUrl(),
|
||||
'theme' => $user->theme,
|
||||
'can_admin' => $user->canAccessAdmin(),
|
||||
// Einfache Ansicht (Rolle mit „Einfache Ansicht“, z. B. Klienten)
|
||||
'simple' => $user->usesSimpleUi(),
|
||||
] : null,
|
||||
],
|
||||
'navigation' => fn () => $user ? $this->navigation->items($request, $user) : [],
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
#[Fillable(['name', 'slug', 'description', 'is_system'])]
|
||||
#[Fillable(['name', 'slug', 'description', 'is_system', 'simple_ui'])]
|
||||
class Role extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
|
@ -29,7 +29,7 @@ class Role extends Model
|
|||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['is_system' => 'boolean'];
|
||||
return ['is_system' => 'boolean', 'simple_ui' => 'boolean'];
|
||||
}
|
||||
|
||||
public static function administration(): self
|
||||
|
|
|
|||
|
|
@ -101,6 +101,18 @@ class User extends Authenticatable implements FilamentUser, HasAvatar
|
|||
* Backend (/admin) nur für Rechte, die dort gepflegt werden. Wer nur Redaktionsrechte
|
||||
* hat (Beiträge schreiben, Seiten bearbeiten …), arbeitet vollständig im Portal.
|
||||
*/
|
||||
private ?bool $simpleUi = null;
|
||||
|
||||
/**
|
||||
* Einfache Ansicht (große Schrift, Leichte Sprache, einfache Startseite): wer eine Rolle
|
||||
* mit „Einfache Ansicht“ hat – außer, wer den Admin-Bereich nutzt.
|
||||
*/
|
||||
public function usesSimpleUi(): bool
|
||||
{
|
||||
// rescue: während eines Updates kann die Spalte kurz noch fehlen
|
||||
return $this->simpleUi ??= rescue(fn () => $this->roles()->where('simple_ui', true)->exists(), false, false) && ! $this->canAccessAdmin();
|
||||
}
|
||||
|
||||
public function canAccessAdmin(): bool
|
||||
{
|
||||
if (! $this->is_active) {
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@ namespace App;
|
|||
*/
|
||||
final class Version
|
||||
{
|
||||
public const VERSION = '0.56.0';
|
||||
public const VERSION = '0.57.0';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue