From 8a40fb8ff8f1bf494e0a48f0ab003adb42c48b05 Mon Sep 17 00:00:00 2001 From: Benjamin Takats Date: Fri, 20 Jan 2023 16:24:53 +0100 Subject: [PATCH] library with grid --- app/Nova/Episode.php | 2 ++ package.json | 1 + resources/views/livewire/library/library-table.blade.php | 6 +++--- resources/views/livewire/news/article-overview.blade.php | 2 +- resources/views/livewire/news/intern-article-view.blade.php | 5 +++-- routes/web.php | 4 ++++ tailwind.config.js | 3 ++- yarn.lock | 5 +++++ 8 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/Nova/Episode.php b/app/Nova/Episode.php index 1e59f9c7..eca1c8ad 100644 --- a/app/Nova/Episode.php +++ b/app/Nova/Episode.php @@ -54,6 +54,8 @@ class Episode extends Resource 'type' => 'podcast_episode', 'language_code' => $model->podcast->language_code, 'value' => null, + 'excerpt' => $model->data['description'], + 'subtitle' => $model->data['description'], ]); $libraryItem->syncTagsWithType(is_array($request->tags) ? $request->tags : str($request->tags)->explode('-----'), 'library_item'); diff --git a/package.json b/package.json index f12323c5..009953d7 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@alpinejs/focus": "^3.11.1", "@alpinejs/intersect": "^3.11.1", "@tailwindcss/forms": "^0.5.2", + "@tailwindcss/line-clamp": "^0.4.2", "@tailwindcss/typography": "^0.5.0", "alpinejs": "^3.0.6", "autoprefixer": "^10.4.7", diff --git a/resources/views/livewire/library/library-table.blade.php b/resources/views/livewire/library/library-table.blade.php index ef8ad071..b29bc450 100644 --- a/resources/views/livewire/library/library-table.blade.php +++ b/resources/views/livewire/library/library-table.blade.php @@ -49,7 +49,7 @@
diff --git a/resources/views/livewire/news/article-overview.blade.php b/resources/views/livewire/news/article-overview.blade.php index 780760f3..71114e34 100644 --- a/resources/views/livewire/news/article-overview.blade.php +++ b/resources/views/livewire/news/article-overview.blade.php @@ -29,7 +29,7 @@

{{ $libraryItem->name }}

-

{{ $libraryItem->excerpt }}

+

{{ $libraryItem->excerpt }}

diff --git a/resources/views/livewire/news/intern-article-view.blade.php b/resources/views/livewire/news/intern-article-view.blade.php index ec44ae90..4d69e6ca 100644 --- a/resources/views/livewire/news/intern-article-view.blade.php +++ b/resources/views/livewire/news/intern-article-view.blade.php @@ -63,14 +63,15 @@
- @if(str($libraryItem->value)->contains('http')) + @if($libraryItem->type !== 'markdown_article' && str($libraryItem->value)->contains('http')) {{ __('Open') }} @endif @if($libraryItem->type === 'downloadable_file') - + {{ __('Download') }} diff --git a/routes/web.php b/routes/web.php index f09b9922..81f0c66a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -17,6 +17,10 @@ Route::middleware([]) ->get('/news/{libraryItem:slug}', \App\Http\Livewire\News\InternArticleView::class) ->name('article.view'); +Route::middleware([]) + ->get('/library-item/{libraryItem:slug}', \App\Http\Livewire\News\InternArticleView::class) + ->name('libraryItem.view'); + Route::middleware([]) ->get('/my-meetups', \App\Http\Livewire\Profile\Meetups::class) ->name('profile.meetups'); diff --git a/tailwind.config.js b/tailwind.config.js index 81949dda..f8c5a22a 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -104,6 +104,7 @@ module.exports = { }, plugins: [ require('@tailwindcss/forms'), - require('@tailwindcss/typography') + require('@tailwindcss/typography'), + require('@tailwindcss/line-clamp'), ], } diff --git a/yarn.lock b/yarn.lock index 5c3c7db6..fab7a8a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -57,6 +57,11 @@ dependencies: mini-svg-data-uri "^1.2.3" +"@tailwindcss/line-clamp@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@tailwindcss/line-clamp/-/line-clamp-0.4.2.tgz#f353c5a8ab2c939c6267ac5b907f012e5ee130f9" + integrity sha512-HFzAQuqYCjyy/SX9sLGB1lroPzmcnWv1FHkIpmypte10hptf4oPUfucryMKovZh2u0uiS9U5Ty3GghWfEJGwVw== + "@tailwindcss/typography@^0.5.0": version "0.5.9" resolved "https://registry.yarnpkg.com/@tailwindcss/typography/-/typography-0.5.9.tgz#027e4b0674929daaf7c921c900beee80dbad93e8"