Skip to content

Commit 3ecf57b

Browse files
ANAS29-CODERasbiin
andauthored
feat: add the number of contacts not tagged (#6761)
Co-authored-by: Alexis Saettler <[email protected]>
1 parent 7f72437 commit 3ecf57b

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

app/Http/Controllers/ContactsController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ private function contacts(Request $request, bool $active)
8585
}
8686

8787
$tagsCount = Tag::contactsCount();
88+
$contactsWithoutTagsCount = $contacts->doesntHave('tags')->count();
89+
8890
$tags = null;
8991
$url = null;
9092
$count = 1;
@@ -134,7 +136,8 @@ private function contacts(Request $request, bool $active)
134136
->withTagsCount($tagsCount)
135137
->withUrl($url)
136138
->withTagCount($count)
137-
->withTagLess($request->input('no_tag') ?? false);
139+
->withTagLess($request->input('no_tag') ?? false)
140+
->with('contactsWithoutTagsCount', $contactsWithoutTagsCount);
138141
}
139142

140143
/**

resources/sass/people.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@
4141
position: absolute;
4242
}
4343

44-
.number-contacts-per-tag {
44+
.number-contacts-per-tag,
45+
.number-contacts-without-tag {
4546
@if $htmldir == ltr {
4647
float: right;
4748
} @else {
4849
float: left;
4950
}
5051
}
5152
}
53+
.number-contacts-without-tag{
54+
font-size: 1rem;
55+
}
5256
}
5357

5458
.list {

resources/views/people/index.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
@if ($tagsCount->count() != 0)
145145
<li class="f7 mt3">
146146
<a href="{{ route('people.index') }}?no_tag=true">{{ trans('people.people_list_untagged') }}</a>
147+
<span class="number-contacts-without-tag">{{ trans_choice('people.people_list_contacts_per_tags', $contactsWithoutTagsCount) }}</span>
147148
</li>
148149
@endif
149150

0 commit comments

Comments
 (0)