Skip to content

Commit

Permalink
add better support for libraries with URL item
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Feb 19, 2024
1 parent 4f1377c commit 8abe383
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
14 changes: 9 additions & 5 deletions resources/views/themes/zeus/sky/addons/library-item.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@
<span>{{ $item->created_at->format('Y.m/d') }}-{{ $item->created_at->format('h:i a') }}</span>
</p>

<div class="grid grid-cols-1 @if($item->getFiles()->count() > 1) sm:grid-cols-2 lg:grid-cols-3 @endif gap-2 justify-items-stretch content-stretch">
@foreach($item->getFiles() as $file)
@include($skyTheme.'.addons.library-types.'.strtolower($item->type))
@endforeach
</div>
@if($item->file_path !== null)
@include($skyTheme.'.addons.library-types.'.strtolower($item->type).'-url')
@else
<div class="grid grid-cols-1 @if($item->getFiles()->count() > 1) sm:grid-cols-2 lg:grid-cols-3 @endif gap-2 justify-items-stretch content-stretch">
@foreach($item->getFiles() as $file)
@include($skyTheme.'.addons.library-types.'.strtolower($item->type))
@endforeach
</div>
@endif
</x-filament::section>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<x-filament::button tag="a" target="_blank" href="{{ $item->file_path }}" class="my-2 mx-auto">
{{ __('Show File') }}
</x-filament::button>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<x-filament::button tag="a" target="_blank" href="{{ $file->getFullUrl() }}" class="mx-auto">
{{ __('Show File') }}
{{ $file->getFullUrl() }} {{ __('Show File') }}
</x-filament::button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<a href="{{ $item->file_path }}" target="_blank">
<img alt="{{ $item->title }}" class="my-2 aspect-video mx-auto" src="{{ $item->file_path }}">
</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<video width="100%" class="w-full" controls>
<source src="{{ $item->file_path }}">
Your browser does not support HTML video.
</video>

0 comments on commit 8abe383

Please sign in to comment.