Show tag header and count

This commit is contained in:
Annika Backstrom 2024-05-30 20:41:29 +01:00
parent 8874e011f9
commit e84a55bd9a
Signed by: annika
GPG Key ID: 3561F004DE1D9AFE
4 changed files with 10 additions and 1 deletions

View File

@ -36,7 +36,12 @@ class TagController extends Controller
*/ */
public function show(Tag $tag) public function show(Tag $tag)
{ {
return view('tag.show', [ 'tag' => $tag, ]); return view(
'tag.show', [
'tag' => $tag->load('bookmarks'),
'tag_count' => $tag->bookmarks()->count(),
]
);
} }
/** /**

View File

@ -12,6 +12,7 @@ body {
padding: 0; padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;
background-color: #335C67; background-color: #335C67;
color: #fff;
} }
@import 'components/bookmark'; @import 'components/bookmark';

View File

@ -9,6 +9,8 @@
"date tags" "date tags"
"actions actions"; "actions actions";
color: #000;
form & { form & {
grid-template-areas: grid-template-areas:
"title" "title"

View File

@ -1,6 +1,7 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<h2>Tag: {{ $tag->name }} ({{ $tag_count }})</h2>
<div> <div>
@foreach ($tag->bookmarks as $bookmark) @foreach ($tag->bookmarks as $bookmark)
<x-bookmark :bookmark="$bookmark" /> <x-bookmark :bookmark="$bookmark" />