Render likes using templates

This commit is contained in:
Jonny Barnes 2019-07-26 11:23:02 +01:00
parent acbb958475
commit bcb9998504
4 changed files with 28 additions and 43 deletions

View file

@ -17,7 +17,7 @@
@include('templates.article', ['article' => $item])
@break
@case($item instanceof \App\Models\Like)
<p>This is a like</p>
@include('templates.like', ['like' => $item])
@break
@case($item instanceof \App\Models\Bookmark)
<p>This is a bookmark</p>

View file

@ -3,27 +3,9 @@
@section('title')Likes « @stop
@section('content')
<div class="h-feed">
@foreach($likes as $like)
<div class="h-entry">
<div class="h-cite u-like-of">
Liked <a class="u-url" href="{{ $like->url }}">a post</a>
@isset($like->author_name)
by <span class="p-author h-card">
@isset($like->author_url)
<a class="u-url p-name" href="{{ $like->author_url }}">{{ $like->author_name }}</a>
@else
<span class="p-name">{{ $like->author_name }}</span>
@endisset
</span>
@endisset
@isset($like->content)
<blockquote class="e-content">
{!! $like->content !!}
</blockquote>
@endisset
</div>
</div>
@endforeach
</div>
<div class="h-feed">
@foreach($likes as $like)
@include('templates.like', ['like' => $like])
@endforeach
</div>
@stop

View file

@ -3,24 +3,8 @@
@section('title')Like « @stop
@section('content')
<div class="h-entry top-space">
<div class="h-cite u-like-of">
Liked <a class="u-url" href="{{ $like->url }}">a post</a>
@isset($like->author_name)
by <span class="p-author h-card">
@isset($like->author_url)
<a class="u-url p-name" href="{{ $like->author_url }}">{{ $like->author_name }}</a>
@else
<span class="p-name">{{ $like->author_name }}</span>
@endisset
</span>
@endisset
<blockquote class="e-content">
{!! $like->content !!}
</blockquote>
</div>
</div>
@include('templates.like', ['like' => $like])
<!-- POSSE to Twitter -->
<a href="https://brid.gy/publish/twitter"></a>
<!-- POSSE to Twitter -->
<a href="https://brid.gy/publish/twitter"></a>
@stop

View file

@ -0,0 +1,19 @@
<div class="h-entry">
<div class="h-cite u-like-of">
Liked <a class="u-url" href="{{ $like->url }}">a post</a>
@isset($like->author_name)
by <span class="p-author h-card">
@isset($like->author_url)
<a class="u-url p-name" href="{{ $like->author_url }}">{{ $like->author_name }}</a>
@else
<span class="p-name">{{ $like->author_name }}</span>
@endisset
</span>
@endisset
@isset($like->content)
<blockquote class="e-content">
{!! $like->content !!}
</blockquote>
@endisset
</div>
</div>