Skip to content

Commit

Permalink
Hide view untagged filter when there are not tags (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaiss authored May 22, 2018
1 parent 2543664 commit 300cdfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/Http/Controllers/ContactsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function index(Request $request)
return view('people.index')
->withContacts($contacts->unique('id'))
->withTags($tags)
->withUserTags(auth()->user()->account->tags)
->withUrl($url)
->withTagCount($count)
->withTagLess($request->get('no_tag') ?? false);
Expand Down
5 changes: 4 additions & 1 deletion resources/views/people/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,20 @@
@include('partials.components.people-upgrade-sidebar')

<ul>
@foreach (auth()->user()->account->tags as $dbtag)
@foreach ($userTags as $dbtag)
@if ($dbtag->contacts()->count() > 0)
<li>
<span class="pretty-tag"><a href="/people?{{$url}}tag{{$tagCount}}={{ $dbtag->name_slug }}">{{ $dbtag->name }}</a></span>
<span class="number-contacts-per-tag {{ \App\Helpers\LocaleHelper::getDirection() }}">{{ trans_choice('people.people_list_contacts_per_tags', $dbtag->contacts()->count(), ['count' => $dbtag->contacts()->count()]) }}</span>
</li>
@endif
@endforeach

@if ($userTags->count() != 0)
<li class="f7 mt3">
<a href="/people?no_tag=true">{{ trans('people.people_list_untagged') }}</a>
</li>
@endif
</ul>
</div>

Expand Down

0 comments on commit 300cdfe

Please sign in to comment.