From ab3611cbce65a9ffba46e598a8120fa48cfda49b Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Wed, 29 May 2024 22:26:05 +0100 Subject: [PATCH] Add tag permalink page --- README.md | 2 +- app/Http/Controllers/TagController.php | 65 +++++++++++++++++++ resources/sass/components/_bookmark.scss | 12 ++++ resources/views/components/bookmark.blade.php | 2 +- resources/views/tag/show.blade.php | 9 +++ routes/web.php | 7 ++ 6 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 app/Http/Controllers/TagController.php create mode 100644 resources/views/tag/show.blade.php diff --git a/README.md b/README.md index 2451415..d1c83af 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A little project because I haven't made anything new in a while, I would like to * [x] Bookmark editing (title, description, url) * [x] Bookmark tag editing * [ ] Tag cloud -* [ ] Tag permalink +* [x] Tag permalink * [ ] Multi-user support ## Developing diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php new file mode 100644 index 0000000..9566b87 --- /dev/null +++ b/app/Http/Controllers/TagController.php @@ -0,0 +1,65 @@ + $tag, ]); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(Tag $tag) + { + // + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Tag $tag) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Tag $tag) + { + // + } +} diff --git a/resources/sass/components/_bookmark.scss b/resources/sass/components/_bookmark.scss index 6f4d659..e027eb0 100644 --- a/resources/sass/components/_bookmark.scss +++ b/resources/sass/components/_bookmark.scss @@ -102,5 +102,17 @@ border-radius: 7px; background-color: #9E2A2B; color: #FFF3B0; + + a { + &, + &:active, + &:visited { + color: #FFF3B0; + } + + &:hover { + color: #000; + } + } } } diff --git a/resources/views/components/bookmark.blade.php b/resources/views/components/bookmark.blade.php index 2f12894..5687f03 100644 --- a/resources/views/components/bookmark.blade.php +++ b/resources/views/components/bookmark.blade.php @@ -18,7 +18,7 @@ diff --git a/resources/views/tag/show.blade.php b/resources/views/tag/show.blade.php new file mode 100644 index 0000000..776902a --- /dev/null +++ b/resources/views/tag/show.blade.php @@ -0,0 +1,9 @@ +@extends('layouts.app') + +@section('content') +
+ @foreach ($tag->bookmarks as $bookmark) + + @endforeach +
+@endsection diff --git a/routes/web.php b/routes/web.php index 49788cd..14095bd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@ parameters( + [ + 'tags' => 'tag:name', // tag names in url, rather than ids + ] +);