Skip to content

Commit

Permalink
Merge branch 'main' into workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
swilla authored Dec 18, 2024
2 parents ace40fc + 1ec6bd2 commit 1946f6d
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
3 changes: 3 additions & 0 deletions resources/views/components/exit-lms.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<x-filament::link color="gray" href="/">
Exit LMS
</x-filament::link>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="fixed left-0 right-0 z-5 overflow-hidden bg-gray-200" style="top:65px">
<div class="fixed left-0 right-0 z-5 overflow-hidden bg-gray-200" style="top:64px">
<div class="h-2 bg-primary-600" style="width: {{$course->completion_percentage}}%"></div>
</div>
<!-- This will provide space -->
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/form-step.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@endif

<div class="fixed bottom-0 right-0 p-4 md:p-6 lg:p-8">
<x-filament::button size="xl" wire:click="$dispatch('complete-step')" :disabled="!$entry">
<x-filament::button color="gray" size="xl" wire:click="$dispatch('complete-step')" :disabled="!$entry">
Next
</x-filament::button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/video-step.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@endif

<div class="fixed bottom-0 right-0 p-4 md:p-6 lg:p-8">
<x-filament::button size="xl" wire:click="$dispatch('complete-step')" :disabled="!$videoCompleted">
<x-filament::button color="gray" size="xl" wire:click="$dispatch('complete-step')" :disabled="!$videoCompleted">
Next
</x-filament::button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/pages/step.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div>
<div class="py-5">
<div class="sm:flex sm:items-center sm:justify-between">
<h3 class="text-xl font-semibold text-gray-900">
<h3 class="text-xl font-semibold text-white">
{{ $step->name }}
</h3>
<div>
Expand Down
39 changes: 30 additions & 9 deletions src/LmsPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Filament\Navigation\NavigationItem;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
Expand All @@ -26,26 +25,48 @@
use Tapp\FilamentLms\Pages\CourseCompleted;
use Tapp\FilamentLms\Pages\Dashboard;
use Tapp\FilamentLms\Pages\Step;
use Filament\Facades\Filament;
use Filament\Navigation\NavigationGroup;

Check failure on line 29 in src/LmsPanelProvider.php

View workflow job for this annotation

GitHub Actions / php 8.2 on ubuntu-latest

Cannot use Filament\Navigation\NavigationGroup as NavigationGroup because the name is already in use

Check failure on line 29 in src/LmsPanelProvider.php

View workflow job for this annotation

GitHub Actions / P8.4 - L11.* - prefer-stable - ubuntu-latest

Cannot use Filament\Navigation\NavigationGroup as NavigationGroup because the name is already in use
use Illuminate\Support\HtmlString;
use App\Providers\Filament\Support\Colors\DphColor as Color;
use Filament\View\PanelsRenderHook;
use Illuminate\View\View;
use Filament\Support\Facades\FilamentView;

class LmsPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
FilamentView::registerRenderHook(
PanelsRenderHook::USER_MENU_BEFORE,
function () {
if (Filament::getCurrentPanel()->getId() == 'lms') {
return view('filament-lms::components.exit-lms');
}
}
);

return $panel
->id('lms')
->path('lms')
->brandName('LMS')
->userMenuItems([
\Filament\Navigation\MenuItem::make()
->label('Exit LMS')
->url(fn (): string => '/')
->icon('heroicon-o-home'),
])
->homeUrl('/lms')
->font('Poppins')
->viteTheme('resources/css/filament/app/theme.css')
->darkMode(false)
->renderHook(
PanelsRenderHook::BODY_END,
fn (): View => view('usersnap'),
)
->navigation(function (NavigationBuilder $builder): NavigationBuilder {
return $this->navigationItems($builder);
})
->colors([
'primary' => Color::Emerald,
'primary' => Color::Blue,
'info' => Color::Gold,
'danger' => Color::Red,
'success' => Color::Green,
'gray' => Color::Purple,
])
->discoverResources(in: app_path('Filament/Lms/Resources'), for: 'App\\Filament\\Lms\\Resources')
->discoverPages(in: app_path('Filament/Lms/Pages'), for: 'App\\Filament\\Lms\\Pages')
Expand Down Expand Up @@ -94,7 +115,7 @@ public function navigationItems(NavigationBuilder $builder): NavigationBuilder
return NavigationItem::make($step->name)
->icon(fn (): string => $step->completed_at ? 'heroicon-o-check-circle' : '')
->isActiveWhen(fn (): bool => $step->isActive())
->url(fn (): string => $step->url);
->url(fn (): string => $step->available ? $step->url : '');
})->toArray());
})->toArray();

Expand Down

0 comments on commit 1946f6d

Please sign in to comment.