tag view links/views
This commit is contained in:
parent
ed9cc0ad46
commit
3d823b10d5
|
@ -8,5 +8,9 @@ class TagController extends Controller
|
|||
{
|
||||
public function view($id) {
|
||||
$tag = Tag::findOrFail($id);
|
||||
$posts = $tag->posts()->published()->orderBy('posted_at', 'DESC')->simplePaginate(15);
|
||||
return view('read', [
|
||||
'items' => $posts
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,7 +146,8 @@ class ViewComposer extends GenericView
|
|||
$tags = $this->item->tags()->get();
|
||||
$retval = '';
|
||||
foreach($tags as $tag) {
|
||||
$retval .= Html::el('a', ['href' => route('tag', $tag->id)]);
|
||||
$retval .= Html::el('a', $tag->name)
|
||||
->setAttribute('href', route('tag.view', $tag->id));
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'locale' => 'ru',
|
||||
'locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -93,7 +93,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'fallback_locale' => 'en',
|
||||
'fallback_locale' => 'ru',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
5
resources/lang/ru/messages.php
Normal file
5
resources/lang/ru/messages.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Tags:' => 'Метки:',
|
||||
];
|
|
@ -24,7 +24,10 @@
|
|||
@if (!empty($load_comments_action))
|
||||
<a name="comments"></a>
|
||||
@endif
|
||||
{!! $tags !!}
|
||||
@if (!empty($tags))
|
||||
{{ _('Tags:') }}
|
||||
{!! $tags !!}
|
||||
@endif
|
||||
@if (!empty($load_comments_action))
|
||||
<div id="comments" data-url="{!! $load_comments_action !!}"></div>
|
||||
<div id="new_comment" data-url="{!! $load_comment_form_action !!}"></div>
|
||||
|
|
Loading…
Reference in a new issue