Skip to content

Commit

Permalink
Merge pull request #190 from lara-zeus/support-url-lib
Browse files Browse the repository at this point in the history
add better support for libraries with URL item
  • Loading branch information
atmonshi authored Feb 19, 2024
2 parents 830ae50 + b07c46b commit 0ee65ad
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 45 deletions.
83 changes: 44 additions & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 0ee65ad

Please sign in to comment.