From 761d50706a96fb1ce4cd9035db8d0a0a36a03ee2 Mon Sep 17 00:00:00 2001 From: myrmidex Date: Thu, 10 Jul 2025 11:32:07 +0200 Subject: [PATCH] Enable app after onboarding --- app/Http/Controllers/OnboardingController.php | 4 +- app/Http/Controllers/SettingsController.php | 6 ++ resources/views/onboarding/complete.blade.php | 59 ++++++++++++++++++- resources/views/pages/dashboard.blade.php | 6 ++ 4 files changed, 73 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/OnboardingController.php b/app/Http/Controllers/OnboardingController.php index a0ff6a5..b32d817 100644 --- a/app/Http/Controllers/OnboardingController.php +++ b/app/Http/Controllers/OnboardingController.php @@ -74,7 +74,9 @@ public function complete(): View|RedirectResponse return redirect()->route('onboarding.index'); } - return view('onboarding.complete'); + $systemStatus = resolve(SystemStatusService::class)->getSystemStatus(); + + return view('onboarding.complete', compact('systemStatus')); } private function needsOnboarding(): bool diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 3fdba8c..2952565 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -24,6 +24,12 @@ public function update(Request $request): RedirectResponse Setting::setArticleProcessingEnabled($request->boolean('article_processing_enabled')); + // If redirected from onboarding, go to dashboard + if ($request->get('from') === 'onboarding') { + return redirect()->route('onboarding.index') + ->with('success', 'System activated successfully! Welcome to Lemmy Poster.'); + } + return redirect()->route('settings.index') ->with('success', 'Settings updated successfully.'); } diff --git a/resources/views/onboarding/complete.blade.php b/resources/views/onboarding/complete.blade.php index ed6c368..e90b867 100644 --- a/resources/views/onboarding/complete.blade.php +++ b/resources/views/onboarding/complete.blade.php @@ -12,7 +12,7 @@

Setup Complete!

- Great! You've successfully configured Lemmy Poster. Your feeds will now be monitored and articles will be automatically posted to your configured channels. + Great! You've successfully configured Lemmy Poster. Now activate the system to start monitoring feeds and posting articles.

@@ -24,6 +24,63 @@
+ +
+
+
+
+ @if($systemStatus['is_enabled']) +
+ +
+
+

System Status

+

{{ $systemStatus['status'] }}

+
+ @else +
+ +
+
+

Ready to Activate

+

System is configured but not active

+
+ @endif +
+ + @if(!$systemStatus['is_enabled']) +
+ @csrf + @method('PUT') + + + +
+ @else + ✓ Active + @endif +
+ + @if(!$systemStatus['is_enabled'] && count($systemStatus['reasons']) > 0) +
+

System will be enabled once activated. Current setup status:

+
    + @foreach($systemStatus['reasons'] as $reason) + @if($reason !== 'Manually disabled by user') +
  • + + {{ str_replace('No active', 'Active', $reason) . ' ✓' }} +
  • + @endif + @endforeach +
+
+ @endif +
+
+

What happens next?

diff --git a/resources/views/pages/dashboard.blade.php b/resources/views/pages/dashboard.blade.php index a598fae..8944763 100644 --- a/resources/views/pages/dashboard.blade.php +++ b/resources/views/pages/dashboard.blade.php @@ -7,6 +7,12 @@

Dashboard

+ @if(session('success')) +
+ {{ session('success') }} +
+ @endif +