library with grid

This commit is contained in:
Benjamin Takats
2023-01-20 16:24:53 +01:00
parent 3f6e1cc7df
commit 8a40fb8ff8
8 changed files with 21 additions and 7 deletions

View File

@@ -49,7 +49,7 @@
<div wire:key="library_item_{{ $libraryItem->id }}"
class="flex flex-col overflow-hidden rounded-lg shadow-[#F7931A] shadow-sm">
<div class="flex-shrink-0">
<a href="{{ route('article.view', ['libraryItem' => $libraryItem]) }}">
<a href="{{ route('libraryItem.view', ['libraryItem' => $libraryItem]) }}">
<img class="h-48 w-full object-contain"
src="{{ $libraryItem->getFirstMediaUrl('main') }}"
alt="{{ $libraryItem->name }}">
@@ -61,10 +61,10 @@
<div
class="text-amber-500">{{ $libraryItem->tags->pluck('name')->join(', ') }}</div>
</p>
<a href="{{ route('article.view', ['libraryItem' => $libraryItem]) }}"
<a href="{{ route('libraryItem.view', ['libraryItem' => $libraryItem]) }}"
class="mt-2 block">
<p class="text-xl font-semibold text-gray-200">{{ $libraryItem->name }}</p>
<p class="mt-3 text-base text-gray-300">{{ $libraryItem->excerpt }}</p>
<p class="mt-3 text-base text-gray-300 line-clamp-3">{{ $libraryItem->excerpt }}</p>
</a>
</div>
<div class="mt-6 flex items-center">

View File

@@ -29,7 +29,7 @@
<a href="{{ route('article.view', ['libraryItem' => $libraryItem]) }}"
class="mt-2 block">
<p class="text-xl font-semibold text-gray-200">{{ $libraryItem->name }}</p>
<p class="mt-3 text-base text-gray-300">{{ $libraryItem->excerpt }}</p>
<p class="mt-3 text-base text-gray-300 line-clamp-3">{{ $libraryItem->excerpt }}</p>
</a>
</div>
<div class="mt-6 flex items-center">

View File

@@ -63,14 +63,15 @@
<div
class="prose prose-invert mx-auto mt-5 text-gray-100 lg:col-start-1 lg:row-start-1 lg:max-w-none">
<div class="flex flex-col space-y-1">
@if(str($libraryItem->value)->contains('http'))
@if($libraryItem->type !== 'markdown_article' && str($libraryItem->value)->contains('http'))
<x-button lg amber :href="$libraryItem->value" target="_blank">
<i class="fa fa-thin fa-book-open mr-2"></i>
{{ __('Open') }}
</x-button>
@endif
@if($libraryItem->type === 'downloadable_file')
<x-button lg amber :href="$libraryItem->getFirstMediaUrl('single_file')" target="_blank">
<x-button lg amber :href="$libraryItem->getFirstMediaUrl('single_file')"
target="_blank">
<i class="fa fa-thin fa-download mr-2"></i>
{{ __('Download') }}
</x-button>