From 9d3fb270f6b684275d57b5ffa26922076cc74e09 Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Sat, 25 May 2024 14:59:27 +0100 Subject: [PATCH] Create app layout, move bookmark view into component --- app/View/Components/Bookmark.php | 28 +++++++++++++++++++ resources/views/bookmarks/index.blade.php | 10 +++++-- resources/views/bookmarks/show.blade.php | 16 +---------- resources/views/components/bookmark.blade.php | 19 +++++++++++++ resources/views/layouts/app.blade.php | 3 +- 5 files changed, 57 insertions(+), 19 deletions(-) create mode 100644 app/View/Components/Bookmark.php create mode 100644 resources/views/components/bookmark.blade.php diff --git a/app/View/Components/Bookmark.php b/app/View/Components/Bookmark.php new file mode 100644 index 0000000..271cea1 --- /dev/null +++ b/app/View/Components/Bookmark.php @@ -0,0 +1,28 @@ + @endforeach + +@endsection diff --git a/resources/views/bookmarks/show.blade.php b/resources/views/bookmarks/show.blade.php index ee728d9..605ec9d 100644 --- a/resources/views/bookmarks/show.blade.php +++ b/resources/views/bookmarks/show.blade.php @@ -1,19 +1,5 @@ @extends('layouts.app') @section('content') -
-

{{ $bookmark->title }}

-

{{ $bookmark->href }}

- @if ($bookmark->description) -

{{ $bookmark->description }}

- @endif -

{{ $bookmark->created_at }}

- -
+ @endsection diff --git a/resources/views/components/bookmark.blade.php b/resources/views/components/bookmark.blade.php new file mode 100644 index 0000000..eaa31e4 --- /dev/null +++ b/resources/views/components/bookmark.blade.php @@ -0,0 +1,19 @@ +
+

{{ $bookmark->title }}

+

{{ $bookmark->href }}

+ @if (!empty($bookmark->description)) +
+

{{ strip_tags($bookmark->description) }}

+
+ @endif +

+ +

+
    + @foreach ($bookmark->tags as $tag) +
  • + {{ $tag->tag->name }} +
  • + @endforeach +
+
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 6d623a0..9a45b0f 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -1,11 +1,12 @@ - urlslug + urlsnail @vite(['resources/sass/app.scss'])
+

url snail

@yield('content')