Add number of displayed contacts to the bottom of the contact list

This commit is contained in:
Julius Haertl 2016-07-16 14:54:26 +02:00
parent 1e61b1bba4
commit 35160f520f
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
3 changed files with 17 additions and 1 deletions

View File

@ -472,6 +472,16 @@ ul.addressBook-share-list li {
opacity: 1;
}
/* styling for contact count in contact list */
.contacts-list-count {
text-align:center;
color: #333;
padding:25px;
position: relative;
height: 68px;
border-top: 1px solid #eee;
}
/* SELECT2 styling - MOVE TO CORE FOR 9.1! */
detailsitem .select2-container {

View File

@ -14,6 +14,9 @@ angular.module('contactsApp')
emptySearch : t('contacts', 'No search result for {query}', {query: ctrl.searchTerm})
};
$scope.getCountString = function(contacts) {
return n('contacts', '%n contact', '%n contacts', contacts.length);
};
$scope.query = function(contact) {
return contact.matches(SearchService.getSearchTerm());

View File

@ -2,7 +2,7 @@
<button ng-show="!ctrl.loading && !ctrl.invalid" class="app-content-list-button" id="new-contact-button"
type="button" name="button" ng-click="ctrl.createContact()">{{ctrl.t.addContact}}</button>
<div class="app-content-list-item"
ng-repeat="contact in ctrl.contactList = (ctrl.contacts | contactGroupFilter:ctrl.routeParams.gid | localeOrderBy:'displayName' | filter:query) track by contact.uid()"
ng-repeat="contact in ctrl.contactList = (ctrl.contacts | contactGroupFilter:ctrl.routeParams.gid | localeOrderBy:'displayName' | filter:query) as filtered track by contact.uid()"
contact data="contact"
ng-click="setSelected(contact.uid())"
ng-class="{active: contact.uid() === ctrl.getSelectedId()}">
@ -13,4 +13,7 @@
<h2>{{ctrl.t.emptySearch}}</h2>
</div>
</div>
<div ng-if="filtered.length>0" class="contacts-list-count">
{{ getCountString(filtered) }}
</div>
</div>