Hide bookmark permalink if it's the active route
This commit is contained in:
parent
e9e802889d
commit
aa820303ec
@ -13,7 +13,9 @@ class Bookmark extends Component
|
|||||||
* Create a new component instance.
|
* Create a new component instance.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public ModelsBookmark $bookmark
|
public ModelsBookmark $bookmark,
|
||||||
|
public bool $showPermalink = true,
|
||||||
|
public bool $showEdit = true,
|
||||||
) {
|
) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<a href="{{ action('BookmarkController@index') }}">← Back</a>
|
<a href="{{ action('BookmarkController@index') }}">← Back</a>
|
||||||
</p>
|
</p>
|
||||||
<x-bookmark :bookmark="$bookmark" />
|
<x-bookmark :$bookmark :show-permalink="false" />
|
||||||
<p>
|
<p>
|
||||||
<a href="{{ action('BookmarkController@edit', ['bookmark' => $bookmark]) }}">edit</a>
|
<a href="{{ action('BookmarkController@edit', ['bookmark' => $bookmark]) }}">edit</a>
|
||||||
</p>
|
</p>
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
<div class="bookmark">
|
<div class="bookmark">
|
||||||
<p class="bookmark-title">
|
<p class="bookmark-title">
|
||||||
{{ $bookmark->title }}
|
{{ $bookmark->title }}
|
||||||
@action('index')
|
@if ($showPermalink)
|
||||||
<a href="{{ action('BookmarkController@show', $bookmark) }}">#</a>
|
<a href="{{ action('BookmarkController@show', $bookmark) }}">#</a>
|
||||||
|
@endif
|
||||||
|
@if ($showEdit)
|
||||||
<a href="{{ action('BookmarkController@edit', $bookmark) }}">e</a>
|
<a href="{{ action('BookmarkController@edit', $bookmark) }}">e</a>
|
||||||
@endaction
|
@endif
|
||||||
</p>
|
</p>
|
||||||
<p class="bookmark-href"><a href="{{ $bookmark->href }}">{{ $bookmark->href }}</a></p>
|
<p class="bookmark-href"><a href="{{ $bookmark->href }}">{{ $bookmark->href }}</a></p>
|
||||||
@if (!empty($bookmark->description))
|
@if (!empty($bookmark->description))
|
||||||
|
Loading…
Reference in New Issue
Block a user