diff --git a/resources/lang/de/settings.php b/resources/lang/de/settings.php index c30eb3d9..f4d29227 100644 --- a/resources/lang/de/settings.php +++ b/resources/lang/de/settings.php @@ -5,6 +5,7 @@ 'site_name_label' => 'Seitenname', 'about_this_site_label' => 'Über diese Seite', 'timezone_label' => 'Zeitzone', + 'timezone_other' => 'Andere', 'incident_days_label' => 'Vorfalltage', 'major_outage_threshold_label' => 'Schwellenwert für schwere Ausfälle', 'refresh_rate_label' => 'Automatisch Seite neuladen', diff --git a/resources/lang/de_AT/settings.php b/resources/lang/de_AT/settings.php index c30eb3d9..f4d29227 100644 --- a/resources/lang/de_AT/settings.php +++ b/resources/lang/de_AT/settings.php @@ -5,6 +5,7 @@ 'site_name_label' => 'Seitenname', 'about_this_site_label' => 'Über diese Seite', 'timezone_label' => 'Zeitzone', + 'timezone_other' => 'Andere', 'incident_days_label' => 'Vorfalltage', 'major_outage_threshold_label' => 'Schwellenwert für schwere Ausfälle', 'refresh_rate_label' => 'Automatisch Seite neuladen', diff --git a/resources/lang/de_CH/settings.php b/resources/lang/de_CH/settings.php index c30eb3d9..f4d29227 100644 --- a/resources/lang/de_CH/settings.php +++ b/resources/lang/de_CH/settings.php @@ -5,6 +5,7 @@ 'site_name_label' => 'Seitenname', 'about_this_site_label' => 'Über diese Seite', 'timezone_label' => 'Zeitzone', + 'timezone_other' => 'Andere', 'incident_days_label' => 'Vorfalltage', 'major_outage_threshold_label' => 'Schwellenwert für schwere Ausfälle', 'refresh_rate_label' => 'Automatisch Seite neuladen', diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.php index 63b32d87..6674eb64 100644 --- a/resources/lang/en/settings.php +++ b/resources/lang/en/settings.php @@ -5,6 +5,8 @@ 'site_name_label' => 'Site Name', 'about_this_site_label' => 'About This Site', 'timezone_label' => 'Timezone', + 'timezone_other' => 'Other', + 'browser_default' => 'Browser Default', 'incident_days_label' => 'Incident Days', 'major_outage_threshold_label' => 'Major Outage Threshold', 'refresh_rate_label' => 'Automatically Refresh Page', diff --git a/resources/lang/nl/settings.php b/resources/lang/nl/settings.php index 03140c75..c9a3301d 100644 --- a/resources/lang/nl/settings.php +++ b/resources/lang/nl/settings.php @@ -5,6 +5,8 @@ 'site_name_label' => 'Pagina naam', 'about_this_site_label' => 'Over deze site', 'timezone_label' => 'Tijdzone', + 'timezone_other' => 'Overig', + 'browser_default' => 'Gebruik browserstandaard', 'incident_days_label' => 'Incidentendagen', 'major_outage_threshold_label' => 'Drempel voor ernstige storingen', 'refresh_rate_label' => 'Pagina automatisch opnieuw laden', diff --git a/resources/lang/ph/settings.php b/resources/lang/ph/settings.php index 7b77da60..386b3d67 100644 --- a/resources/lang/ph/settings.php +++ b/resources/lang/ph/settings.php @@ -5,6 +5,7 @@ 'site_name_label' => 'Pangalan ng Site', 'about_this_site_label' => 'Tungkol sa Site na Ito', 'timezone_label' => 'Oras na Rehiyon', + 'timezone_other' => 'Iba pang mga oras', 'incident_days_label' => 'Mga Araw ng Insidente', 'major_outage_threshold_label' => 'Limitasyon ng Malaking Pagka-aberya', 'refresh_rate_label' => 'Awtomatikong I-refresh ang Pahina', diff --git a/resources/lang/pt_BR/settings.php b/resources/lang/pt_BR/settings.php index 52a2212f..791cad39 100644 --- a/resources/lang/pt_BR/settings.php +++ b/resources/lang/pt_BR/settings.php @@ -5,6 +5,7 @@ 'site_name_label' => 'Nome do Site', 'about_this_site_label' => 'Sobre Este Site', 'timezone_label' => 'Fuso Horário', + 'timezone_other' => 'Outro', 'incident_days_label' => 'Dias de Incidentes', 'major_outage_threshold_label' => 'Limite de Indisponibilidade Total', 'refresh_rate_label' => 'Atualizar Página Automaticamente', diff --git a/resources/views/components/footer.blade.php b/resources/views/components/footer.blade.php index 960d14c2..6212ea8f 100644 --- a/resources/views/components/footer.blade.php +++ b/resources/views/components/footer.blade.php @@ -11,13 +11,21 @@ @endif @if($showTimezone) -
- {!! preg_replace( + + @endif @endif diff --git a/resources/views/components/incident.blade.php b/resources/views/components/incident.blade.php index 75eaa3c5..602e52a4 100644 --- a/resources/views/components/incident.blade.php +++ b/resources/views/components/incident.blade.php @@ -6,7 +6,7 @@ {{ \Cachet\Facades\CachetView::renderHook(\Cachet\View\RenderHook::STATUS_PAGE_INCIDENTS_BEFORE) }}
-

+

@forelse($incidents as $incident)
- {{ $incident->timestamp->diffForHumans() }} — + {{ $incident->timestamp->diffForHumans() }} —
@@ -53,7 +53,7 @@

{{ $update->status->getLabel() }}

- {{ $update->created_at->diffForHumans() }} — + {{ $update->created_at->diffForHumans() }} —
{!! $update->formattedMessage() !!}
@@ -62,7 +62,7 @@ - {{ $incident->timestamp->diffForHumans() }} — + {{ $incident->timestamp->diffForHumans() }} —
{!! $incident->formattedMessage() !!}
diff --git a/resources/views/components/schedule.blade.php b/resources/views/components/schedule.blade.php index 6664b886..b6b92f45 100644 --- a/resources/views/components/schedule.blade.php +++ b/resources/views/components/schedule.blade.php @@ -11,7 +11,7 @@
- {{ $schedule->scheduled_at->diffForHumans() }} — + {{ $schedule->scheduled_at->diffForHumans() }} —
@@ -30,7 +30,7 @@ @foreach ($schedule->updates as $update)
- {{ $update->created_at->diffForHumans() }} — + {{ $update->created_at->diffForHumans() }} —
{!! $update->formattedMessage() !!}
diff --git a/src/CachetCoreServiceProvider.php b/src/CachetCoreServiceProvider.php index 770cfe50..ca7ac5e5 100644 --- a/src/CachetCoreServiceProvider.php +++ b/src/CachetCoreServiceProvider.php @@ -152,6 +152,7 @@ private function registerPublishing(): void */ private function registerBladeComponents(): void { + view()->share('appSettings', app(AppSettings::class)); Blade::componentNamespace('Cachet\\View\\Components', 'cachet'); $this->callAfterResolving(Factory::class, function (Factory $factory) { diff --git a/src/Filament/Pages/Settings/ManageCachet.php b/src/Filament/Pages/Settings/ManageCachet.php index 675b42f2..dec93813 100644 --- a/src/Filament/Pages/Settings/ManageCachet.php +++ b/src/Filament/Pages/Settings/ManageCachet.php @@ -36,15 +36,15 @@ public function form(Form $form): Form Forms\Components\Select::make('timezone') ->label(__('cachet::settings.manage_cachet.timezone_label')) - ->options(fn () => collect(timezone_identifiers_list()) - ->mapToGroups( - fn ($timezone) => [ - Str::of($timezone) - ->before('/') - ->toString() => [$timezone => $timezone], - ] - ) - ->map(fn ($group) => $group->collapse())) + ->options(fn () => [__('cachet::settings.manage_cachet.timezone_other') => ['-' => __('cachet::settings.manage_cachet.browser_default')], ...collect(timezone_identifiers_list()) + ->mapToGroups( + fn($timezone) => [ + Str::of($timezone) + ->before('/') + ->toString() => [$timezone => $timezone], + ] + ) + ->map(fn($group) => $group->collapse())->toArray()]) ->searchable() ->suffixIcon('heroicon-o-globe-alt'), diff --git a/src/Settings/AppSettings.php b/src/Settings/AppSettings.php index 7413aa7e..59cf9c7b 100644 --- a/src/Settings/AppSettings.php +++ b/src/Settings/AppSettings.php @@ -2,6 +2,8 @@ namespace Cachet\Settings; +use Cachet\Enums\IncidentStatusEnum; +use Cachet\Enums\MetricTypeEnum; use Spatie\LaravelSettings\Settings; class AppSettings extends Settings