Skip to content

Commit

Permalink
remove a link from custom preview
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Jun 30, 2024
1 parent bf5df36 commit 02fe2df
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions resources/views/pages/media.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,43 @@

<div>
<div class="flex flex-col justify-start w-full h-full">
<a href="{{ $item->getUrl() }}" target="_blank" class="flex flex-col items-center justify-center p-4 h-full border dark:border-gray-700 rounded-lg">
@if(str($item->mime_type)->contains('image'))

@if(str($item->mime_type)->contains('image'))
<a href="{{ $item->getUrl() }}" target="_blank" class="flex flex-col items-center justify-center p-4 h-full border dark:border-gray-700 rounded-lg">
<img src="{{ $item->getUrl() }}" />
@elseif(str($item->mime_type)->contains('video'))
</a>

@elseif(str($item->mime_type)->contains('video'))
<a href="{{ $item->getUrl() }}" target="_blank" class="flex flex-col items-center justify-center p-4 h-full border dark:border-gray-700 rounded-lg">
<video class="w-full h-full" controls>
<source src="{{ $item->getUrl() }}" type="{{ $item->mime_type }}">
</video>
@elseif(str($item->mime_type)->contains('audio'))
</a>

@elseif(str($item->mime_type)->contains('audio'))
<a href="{{ $item->getUrl() }}" target="_blank" class="flex flex-col items-center justify-center p-4 h-full border dark:border-gray-700 rounded-lg">
<video class="w-full h-full" controls>
<source src="{{ $item->getUrl() }}" type="{{ $item->mime_type }}">
</video>
@else
@php $loadTypes = \TomatoPHP\FilamentMediaManager\Facade\FilamentMediaManager::getTypes() @endphp
@foreach($loadTypes as $type)
@if(str($item->file_name)->contains($type->exstantion))
@if($type->preview)
@include($type->preview, ['url' => $item->getUrl()])
@else
<x-icon :name="$type->icon" class="w-32 h-32" />
@endif
</a>
@else
@php $loadTypes = \TomatoPHP\FilamentMediaManager\Facade\FilamentMediaManager::getTypes() @endphp
@foreach($loadTypes as $type)
@if(str($item->file_name)->contains($type->exstantion))
@if($type->preview)
@include($type->preview, ['url' => $item->getUrl()])
@else
<x-icon name="heroicon-o-document" class="w-32 h-32" />
<a href="{{ $item->getUrl() }}" target="_blank" class="flex flex-col items-center justify-center p-4 h-full border dark:border-gray-700 rounded-lg">
<x-icon :name="$type->icon" class="w-32 h-32" />
</a>
@endif
@endforeach
@endif
</a>
@else
<a href="{{ $item->getUrl() }}" target="_blank" class="flex flex-col items-center justify-center p-4 h-full border dark:border-gray-700 rounded-lg">
<x-icon name="heroicon-o-document" class="w-32 h-32" />
</a>
@endif
@endforeach
@endif
<div class="flex flex-col gap-4 my-4">
@if($item->model)
<div>
Expand Down

0 comments on commit 02fe2df

Please sign in to comment.