Skip to content

Commit

Permalink
Add sorting by friendly_name and phone_number
Browse files Browse the repository at this point in the history
Change pagination footer like 1 to 10 of 1000
RestComm#2189
  • Loading branch information
muhammadbilal19 committed Jun 12, 2017
1 parent b8ff71f commit fec68a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Expand Up @@ -22,10 +22,12 @@ <h2><i class="fa fa-exclamation-circle"></i> No incoming numbers <span ng-show="

<table ng-show="(numbersList | filter:query).length > 0" class="table table-hover" ng-cloak>
<thead style="font-size: 18px;">
<th class="width-20pc">Number</th>
<th class="width-20pc" ng-click="sortBy('phone_number');toggleD=!toggleD;reverse=toggleD;pageChanged()">
Number<span class="pull-right" ng-show="predicate === 'phone_number'"><i ng-class="{'fa fa-chevron-up':toggleD,'fa fa-chevron-down':!toggleD}"></i></span></th>
<th>&nbsp;</th>
<th class="width-30pc">Name</th>
<th>Features</th>
<th class="width-30pc" ng-click="sortBy('friendly_name');toggleC=!toggleC;reverse=toggleC">Name<span class="pull-right" ng-show="predicate === 'friendly_name'"><i ng-class="{'fa fa-chevron-up':toggleC,'fa fa-chevron-down':!toggleC}"></i></span></th>
<th>
Features</th>
<th class="width-10pc">&nbsp;</th>
</thead>
<tbody>
Expand Down Expand Up @@ -59,7 +61,7 @@ <h5 class="col-md-10" ng-show="editingFriendlyName == pn.phone_number"><input ty
<td colspan="99">
<div class="row">
<div class="col-md-4">
<small class="pull-left">{{ totalNumbers }} Number{{ totalNumbers == 1 ? "" : "s" }}</small>
<small class="pull-left">{{start}} to {{end}} of {{ totalNumbers }} Number{{ totalNumbers == 1 ? "" : "s" }}</small>
</div>
<div class="col-md-4">
<form class="form-inline text-center">
Expand Down
Expand Up @@ -59,7 +59,7 @@ rcMod.controller('NumbersCtrl', function ($scope, $resource, $uibModal, $dialog,
$scope.entryLimit = 10; //max rows for data table
$scope.noOfPages = 1; //max rows for data table
$scope.reverse = false;
$scope.predicate = "date_created";
$scope.predicate = "phone_number";

$scope.setEntryLimit = function(limit) {
$scope.entryLimit = limit;
Expand All @@ -77,6 +77,11 @@ rcMod.controller('NumbersCtrl', function ($scope, $resource, $uibModal, $dialog,
$scope.numbersList = data.incomingPhoneNumbers;
$scope.totalNumbers = data.total;
$scope.noOfPages = data.num_pages;
$scope.start = parseInt(data.start) + 1;
$scope.end = parseInt(data.end)
if($scope.end!=$scope.totalNumbers){
$scope.end++;
}
});
}
var createSearchParams = function() {
Expand Down

0 comments on commit fec68a7

Please sign in to comment.