order by in suggestion pages
This commit is contained in:
parent
0f43e31025
commit
3450f2764e
|
@ -27,13 +27,22 @@
|
||||||
<table class="table table-sm table-hover" ng-if="duplicates.length > 0">
|
<table class="table table-sm table-hover" ng-if="duplicates.length > 0">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr class="d-flex">
|
<tr class="d-flex">
|
||||||
<th class="col-8">Organization</th>
|
<th class="col-8">
|
||||||
<th class="col-3">Place</th>
|
<a href="javascript:void(0)" ng-click="sortBy('name')">Organization</a>
|
||||||
<th class="col-1 text-right"># pending duplicates</th>
|
<i ng-show="sortProperty=='name'" ng-class="{'fas fa-chevron-up': sortReverse, 'fas fa-chevron-down': !sortReverse }"></i>
|
||||||
|
</th>
|
||||||
|
<th class="col-3">
|
||||||
|
<a href="javascript:void(0)" ng-click="sortBy('city')">Place</a>
|
||||||
|
<i ng-show="sortProperty=='city'" ng-class="{'fas fa-chevron-up': sortReverse, 'fas fa-chevron-down': !sortReverse }"></i>
|
||||||
|
</th>
|
||||||
|
<th class="col-1 text-right">
|
||||||
|
<a href="javascript:void(0)" ng-click="sortBy('numberOfDuplicates')"># pending duplicates</a>
|
||||||
|
<i ng-show="sortProperty=='numberOfDuplicates'" ng-class="{'fas fa-chevron-up': sortReverse, 'fas fa-chevron-down': !sortReverse }"></i>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="d in duplicates | filter:duplicateFilter" class="d-flex">
|
<tr ng-repeat="d in duplicates | filter:duplicateFilter | orderBy:sortProperty:sortReverse" class="d-flex">
|
||||||
<td class="col-8">
|
<td class="col-8">
|
||||||
<a href="javascript:void(0)" title="{{d.id}}" ng-click="prepareDuplicatesModal(d)" data-toggle="modal" data-target="#duplicatesModal">{{d.name}}</a>
|
<a href="javascript:void(0)" title="{{d.id}}" ng-click="prepareDuplicatesModal(d)" data-toggle="modal" data-target="#duplicatesModal">{{d.name}}</a>
|
||||||
<a href="#!/edit/0/{{d.id}}" title="edit"><i class="fa fa-edit"></i></a>
|
<a href="#!/edit/0/{{d.id}}" title="edit"><i class="fa fa-edit"></i></a>
|
||||||
|
|
|
@ -25,14 +25,26 @@
|
||||||
<table class="table table-sm table-hover" ng-if="orgs.length > 0">
|
<table class="table table-sm table-hover" ng-if="orgs.length > 0">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr class="d-flex">
|
<tr class="d-flex">
|
||||||
<th class="col-6">Organization name</th>
|
<th class="col-6">
|
||||||
<th class="col-4">Place</th>
|
<a href="javascript:void(0)" ng-click="sortBy('name')">Organization name</a>
|
||||||
<th class="col-1 text-center">Acronyms</th>
|
<i ng-show="sortProperty=='name'" ng-class="{'fas fa-chevron-up': sortReverse, 'fas fa-chevron-down': !sortReverse }"></i>
|
||||||
<th class="col-1 text-right">Type</th>
|
</th>
|
||||||
|
<th class="col-4">
|
||||||
|
<a href="javascript:void(0)" ng-click="sortBy('city')">Place</a>
|
||||||
|
<i ng-show="sortProperty=='city'" ng-class="{'fas fa-chevron-up': sortReverse, 'fas fa-chevron-down': !sortReverse }"></i>
|
||||||
|
</th>
|
||||||
|
<th class="col-1 text-center">
|
||||||
|
<a href="javascript:void(0)" ng-click="sortBy('acronyms')">Acronyms</a>
|
||||||
|
<i ng-show="sortProperty=='acronyms'" ng-class="{'fas fa-chevron-up': sortReverse, 'fas fa-chevron-down': !sortReverse }"></i>
|
||||||
|
</th>
|
||||||
|
<th class="col-1 text-right">
|
||||||
|
<a href="javascript:void(0)" ng-click="sortBy('type')">Type</a>
|
||||||
|
<i ng-show="sortProperty=='type'" ng-class="{'fas fa-chevron-up': sortReverse, 'fas fa-chevron-down': !sortReverse }"></i>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="o in orgs | filter:orgFilter" class="d-flex">
|
<tr ng-repeat="o in orgs | filter:orgFilter | orderBy:sortProperty:sortReverse" class="d-flex">
|
||||||
<td class="col-6">
|
<td class="col-6">
|
||||||
<a href="#!/edit/0/{{o.id}}" title="{{o.id}}">{{o.name}}</a>
|
<a href="#!/edit/0/{{o.id}}" title="{{o.id}}">{{o.name}}</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -581,6 +581,8 @@ orgsModule.controller('pendingOrgsCtrl', function ($scope, $http, $routeParams,
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
$scope.orgs = [];
|
$scope.orgs = [];
|
||||||
$scope.country = $routeParams.country;
|
$scope.country = $routeParams.country;
|
||||||
|
$scope.sortProperty = 'name';
|
||||||
|
$scope.sortReverse = false;
|
||||||
|
|
||||||
$scope.getInfo = function() {
|
$scope.getInfo = function() {
|
||||||
suggestionInfo.updateInfo(function(info) {
|
suggestionInfo.updateInfo(function(info) {
|
||||||
|
@ -595,6 +597,11 @@ orgsModule.controller('pendingOrgsCtrl', function ($scope, $http, $routeParams,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.sortBy = function(sortProperty) {
|
||||||
|
$scope.sortReverse = ($scope.sortProperty == sortProperty) ? !$scope.sortReverse : false;
|
||||||
|
$scope.sortProperty = sortProperty;
|
||||||
|
};
|
||||||
|
|
||||||
$scope.refresh = function() {
|
$scope.refresh = function() {
|
||||||
$scope.orgs = [];
|
$scope.orgs = [];
|
||||||
|
@ -616,6 +623,8 @@ orgsModule.controller('duplicatesCtrl', function ($scope, $http, $routeParams, $
|
||||||
$scope.country = $routeParams.country;
|
$scope.country = $routeParams.country;
|
||||||
$scope.currentOrg = {};
|
$scope.currentOrg = {};
|
||||||
$scope.currentOrgDetails = {};
|
$scope.currentOrgDetails = {};
|
||||||
|
$scope.sortProperty = 'name';
|
||||||
|
$scope.sortReverse = false;
|
||||||
|
|
||||||
$scope.prepareDuplicatesModal = function(org) {
|
$scope.prepareDuplicatesModal = function(org) {
|
||||||
$scope.currentOrg = org;
|
$scope.currentOrg = org;
|
||||||
|
@ -664,6 +673,11 @@ orgsModule.controller('duplicatesCtrl', function ($scope, $http, $routeParams, $
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.sortBy = function(sortProperty) {
|
||||||
|
$scope.sortReverse = ($scope.sortProperty == sortProperty) ? !$scope.sortReverse : false;
|
||||||
|
$scope.sortProperty = sortProperty;
|
||||||
|
};
|
||||||
|
|
||||||
$scope.refresh = function() {
|
$scope.refresh = function() {
|
||||||
$scope.duplicates = [];
|
$scope.duplicates = [];
|
||||||
|
|
Loading…
Reference in New Issue