Skip to content

Commit

Permalink
feat: add the number of contacts not tagged (#6761)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexis Saettler <alexis@saettler.org>
  • Loading branch information
ANAS29-CODER and asbiin authored Nov 1, 2023
1 parent 7f72437 commit 3ecf57b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/Http/Controllers/ContactsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ private function contacts(Request $request, bool $active)
}

$tagsCount = Tag::contactsCount();
$contactsWithoutTagsCount = $contacts->doesntHave('tags')->count();

$tags = null;
$url = null;
$count = 1;
Expand Down Expand Up @@ -134,7 +136,8 @@ private function contacts(Request $request, bool $active)
->withTagsCount($tagsCount)
->withUrl($url)
->withTagCount($count)
->withTagLess($request->input('no_tag') ?? false);
->withTagLess($request->input('no_tag') ?? false)
->with('contactsWithoutTagsCount', $contactsWithoutTagsCount);
}

/**
Expand Down
6 changes: 5 additions & 1 deletion resources/sass/people.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@
position: absolute;
}

.number-contacts-per-tag {
.number-contacts-per-tag,
.number-contacts-without-tag {
@if $htmldir == ltr {
float: right;
} @else {
float: left;
}
}
}
.number-contacts-without-tag{
font-size: 1rem;
}
}

.list {
Expand Down
1 change: 1 addition & 0 deletions resources/views/people/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
@if ($tagsCount->count() != 0)
<li class="f7 mt3">
<a href="{{ route('people.index') }}?no_tag=true">{{ trans('people.people_list_untagged') }}</a>
<span class="number-contacts-without-tag">{{ trans_choice('people.people_list_contacts_per_tags', $contactsWithoutTagsCount) }}</span>
</li>
@endif

Expand Down

0 comments on commit 3ecf57b

Please sign in to comment.