Merge pull request #182 from shikorism/develop

Release 20190421.0218
This commit is contained in:
shibafu 2019-04-21 02:18:44 +09:00 committed by GitHub
commit ed295cb7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -188,6 +188,10 @@ SQL
$likes = $user->likes() $likes = $user->likes()
->orderBy('created_at', 'desc') ->orderBy('created_at', 'desc')
->with('ejaculation.user', 'ejaculation.tags') ->with('ejaculation.user', 'ejaculation.tags')
->whereHas('ejaculation', function ($query) {
$query->where('user_id', Auth::id())
->orWhere('is_private', false);
})
->paginate(20); ->paginate(20);
return view('user.likes')->with(compact('user', 'likes')); return view('user.likes')->with(compact('user', 'likes'));

View File

@ -6,8 +6,11 @@
</h5> </h5>
</div> </div>
<!-- tags --> <!-- tags -->
@if ($ejaculation->tags->isNotEmpty()) @if ($ejaculation->is_private || $ejaculation->tags->isNotEmpty())
<p class="mb-2"> <p class="mb-2">
@if ($ejaculation->is_private)
<span class="badge badge-warning"><span class="oi oi-lock-locked"></span> 非公開</span>
@endif
@foreach ($ejaculation->tags as $tag) @foreach ($ejaculation->tags as $tag)
<a class="badge badge-secondary" href="{{ route('search', ['q' => $tag->name]) }}"><span class="oi oi-tag"></span> {{ $tag->name }}</a> <a class="badge badge-secondary" href="{{ route('search', ['q' => $tag->name]) }}"><span class="oi oi-tag"></span> {{ $tag->name }}</a>
@endforeach @endforeach