@yield('eyebrow', $brandName)
@yield('heading', 'Tableau de bord')
-
@foreach ($errors->all() as $error)
- {{ $error }} @endforeach
@php $currentUser = auth()->user(); $isSuperAdmin = (bool) ($currentUser?->is_super_admin); $host = strtolower(request()->getHost()); $adminHost = strtolower((string) config('saas.admin_host')); $isAdminHost = $host === $adminHost; $isDemo = $host === 'demo.ribambin.fr'; $demoRole = session('demo_role', 'direction'); $demoRoleNames = [ 'administration' => 'Administration', 'presidence' => 'Présidence', 'tresorerie' => 'Trésorerie', 'direction' => 'Direction', 'secretariat' => 'Secrétariat', 'bureau' => 'Membre du bureau', 'educative' => 'Équipe éducative', 'parent' => 'Parent', ]; $organization = \App\Models\OrganizationDomain::query() ->with('organization') ->where('host', $host) ->first() ?->organization; $isOrganizationSpace = $organization !== null; $uiTheme = $organization ? app(\App\Services\Ui\OrganizationTheme::class) ->resolve($organization) : [ 'primary' => 'var(--brand-600)', 'primary_900' => 'var(--brand-900)', 'primary_800' => 'var(--brand-800)', 'primary_700' => 'var(--brand-700)', 'primary_600' => 'var(--brand-600)', 'primary_500' => 'var(--brand-500)', 'primary_400' => 'var(--brand-400)', 'primary_300' => 'var(--brand-300)', 'primary_200' => 'var(--brand-200)', 'primary_100' => 'var(--brand-100)', 'primary_50' => 'var(--brand-50)', 'on_primary' => '#FFFFFF', 'sidebar_density' => 'comfortable', ]; // The demo brand must never inherit the customer organization's title. $brandName = $isDemo ? 'Ribambin Démo' : ($organization?->name ?? 'Ribambin'); $brandInitial = $isDemo ? 'R' : mb_strtoupper(mb_substr($brandName, 0, 1)); $brandSubtitle = $isDemo ? 'Démonstration publique' : ($isOrganizationSpace ? 'Espace de gestion' : 'SaaS micro-crèche'); $brandHref = $isDemo ? '/cockpit' : ($isAdminHost && $isSuperAdmin ? route('admin.dashboard') : request()->root()); $demoRoleLabel = $demoRoleNames[$demoRole] ?? $demoRoleNames['direction']; $userRoleLabel = match (true) { $isDemo => 'Mode démonstration', $isSuperAdmin && $isAdminHost => 'Super-administration', $isSuperAdmin => 'Super-administrateur', default => 'Utilisateur', }; $demoCanSeeFamilies = in_array( $demoRole, ['direction', 'secretariat'], true ); $demoCanSeeContracts = in_array( $demoRole, ['direction', 'secretariat', 'tresorerie'], true ); $demoCanSeeValidation = in_array( $demoRole, ['direction', 'secretariat'], true ); $demoCanSeePlanning = in_array( $demoRole, ['direction', 'educative'], true ); $demoCanSeePresences = in_array( $demoRole, ['direction', 'educative'], true ); $demoCanSeeTasks = in_array( $demoRole, ['direction', 'presidence', 'bureau'], true ); $demoCanSeeHours = in_array( $demoRole, ['direction', 'tresorerie'], true ); $demoCanSeeJournal = in_array( $demoRole, ['direction', 'educative'], true ); $demoCanSeeClosures = $demoRole === 'direction'; $demoCanSeeTransactions = in_array( $demoRole, ['direction', 'tresorerie'], true ); @endphp
@if($isDemo) @endif@yield('eyebrow', $brandName)