Currency dropdown + logo on login/topbar via brandLogo closure
- Onboarding + Settings: Forms\Components\Select for currency (MDL/EUR/USD/RON/UAH/RUB) instead of TextInput - TenantPanel: brandName/brandLogo/favicon as closures resolving from tenant. Logo now visible on login page, topbar, sidebar (Filament v5 brandLogo handles all 3 spots automatically) - Favicon falls back to logo if favicon not separately uploaded - Removed manual SIDEBAR_LOGO_BEFORE injection (replaced by brandLogo) - Removed manual <link rel=icon> in HEAD_END (replaced by ->favicon)
This commit is contained in:
@@ -64,8 +64,19 @@ class Onboarding extends Page
|
||||
->label('Oraș')->maxLength(60),
|
||||
Forms\Components\TextInput::make('phone')
|
||||
->label('Telefon principal')->tel()->maxLength(40),
|
||||
Forms\Components\TextInput::make('currency')
|
||||
->label('Monedă')->required()->maxLength(8),
|
||||
Forms\Components\Select::make('currency')
|
||||
->label('Monedă')
|
||||
->options([
|
||||
'MDL' => 'MDL — Leu moldovenesc',
|
||||
'EUR' => 'EUR — Euro',
|
||||
'USD' => 'USD — US Dollar',
|
||||
'RON' => 'RON — Leu românesc',
|
||||
'UAH' => 'UAH — Hryvnia',
|
||||
'RUB' => 'RUB — Rublă',
|
||||
])
|
||||
->default('MDL')
|
||||
->required()
|
||||
->searchable(),
|
||||
]),
|
||||
Schemas\Components\Section::make('Pas 2 — Brand & limbă')
|
||||
->visible(fn () => $this->step === 2)
|
||||
|
||||
@@ -76,7 +76,18 @@ class Settings extends Page
|
||||
->label('Limbă default')
|
||||
->options(['ro' => 'Română', 'ru' => 'Русский', 'en' => 'English'])
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('currency')->label('Monedă')->maxLength(8)->required(),
|
||||
Forms\Components\Select::make('currency')
|
||||
->label('Monedă')
|
||||
->options([
|
||||
'MDL' => 'MDL — Leu moldovenesc',
|
||||
'EUR' => 'EUR — Euro',
|
||||
'USD' => 'USD — US Dollar',
|
||||
'RON' => 'RON — Leu românesc',
|
||||
'UAH' => 'UAH — Hryvnia',
|
||||
'RUB' => 'RUB — Rublă',
|
||||
])
|
||||
->required()
|
||||
->searchable(),
|
||||
Forms\Components\ColorPicker::make('theme_color')->label('Culoare brand'),
|
||||
]),
|
||||
Schemas\Components\Section::make('Servicii & tarif')
|
||||
|
||||
@@ -33,7 +33,14 @@ class TenantPanelProvider extends PanelProvider
|
||||
->id('tenant')
|
||||
->path('app')
|
||||
->login()
|
||||
->brandName('AutoCRM')
|
||||
->brandName(fn () => app(\App\Tenancy\TenantManager::class)->current()?->display_name
|
||||
?? app(\App\Tenancy\TenantManager::class)->current()?->name
|
||||
?? 'AutoCRM')
|
||||
->brandLogo(fn () => app(\App\Tenancy\TenantManager::class)->current()?->getLogoUrl() ?: null)
|
||||
->brandLogoHeight('2.5rem')
|
||||
->favicon(fn () => app(\App\Tenancy\TenantManager::class)->current()?->getFaviconUrl()
|
||||
?: app(\App\Tenancy\TenantManager::class)->current()?->getLogoUrl()
|
||||
?: null)
|
||||
->colors([
|
||||
'primary' => Color::Blue,
|
||||
])
|
||||
@@ -89,7 +96,6 @@ class TenantPanelProvider extends PanelProvider
|
||||
$t = app(\App\Tenancy\TenantManager::class)->current();
|
||||
$themeColor = $t?->settings['theme_color'] ?? '#3B82F6';
|
||||
$name = $t?->display_name ?? $t?->name ?? 'AutoCRM';
|
||||
$favicon = $t?->getFaviconUrl();
|
||||
// Generate primary color shades from theme_color hex.
|
||||
$hex = ltrim($themeColor, '#');
|
||||
if (strlen($hex) === 6) {
|
||||
@@ -103,10 +109,6 @@ class TenantPanelProvider extends PanelProvider
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||
<meta name="apple-mobile-web-app-title" content="{{ $name }}">
|
||||
@if ($favicon)
|
||||
<link rel="icon" type="image/png" href="{{ $favicon }}">
|
||||
<link rel="apple-touch-icon" href="{{ $favicon }}">
|
||||
@endif
|
||||
<style>
|
||||
:root {
|
||||
--primary-50: {{ "rgb({$r} {$g} {$b} / 0.05)" }};
|
||||
@@ -193,20 +195,6 @@ class TenantPanelProvider extends PanelProvider
|
||||
</style>
|
||||
BLADE)
|
||||
)
|
||||
->renderHook(
|
||||
PanelsRenderHook::SIDEBAR_LOGO_BEFORE,
|
||||
fn (): string => Blade::render(<<<'BLADE'
|
||||
@php
|
||||
$t = app(\App\Tenancy\TenantManager::class)->current();
|
||||
$logo = $t?->getLogoUrl();
|
||||
@endphp
|
||||
@if ($logo)
|
||||
<div style="padding: 12px 16px; display: flex; justify-content: center; border-bottom: 1px solid rgba(0,0,0,.06);">
|
||||
<img src="{{ $logo }}" alt="logo" style="max-height: 56px; max-width: 100%;">
|
||||
</div>
|
||||
@endif
|
||||
BLADE)
|
||||
)
|
||||
->renderHook(
|
||||
PanelsRenderHook::BODY_END,
|
||||
fn (): string => Blade::render(<<<'BLADE'
|
||||
|
||||
Reference in New Issue
Block a user