Skip to content

Commit

Permalink
Ordering users in hub view - part 1 for #3
Browse files Browse the repository at this point in the history
  • Loading branch information
lars committed Jun 15, 2014
1 parent c15ba80 commit be6d0a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions app/js/services/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ angular.module('EiskaltRPC', []).factory('EiskaltRPC', function($http) {
};
return promise;
}

return {
StopDaemon: function() {
return jsonrpc('daemon.stop');
Expand Down Expand Up @@ -164,7 +164,17 @@ angular.module('EiskaltRPC', []).factory('EiskaltRPC', function($http) {
return jsonrpc('hub.getusers', {huburl: huburl, separator: '#'}, true);
},
GetUserInfo: function(nick, huburl) {
return jsonrpc('hub.getuserinfo', {nick: nick, huburl: huburl});
var promise = jsonrpc('hub.getuserinfo', {nick: nick, huburl: huburl});
promise.success = function(fn) {
promise.then(function(response) {
var info = response.data.result;
// remove space in key "Nick Order"
info['NickOrder'] = info['Nick Order'];
delete info['Nick Order'];
fn(info);
});
};
return promise;
},
ShowLocalLists: function() {
return jsonrpc('list.local', {separator: '#'}, true);
Expand Down Expand Up @@ -223,4 +233,4 @@ angular.module('EiskaltRPC', []).factory('EiskaltRPC', function($http) {
return jsonrpc('queue.getiteminfo');
}
};
});
});
2 changes: 1 addition & 1 deletion app/partials/hubs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="row" ng-show="hub.connected">
<!-- User List -->
<ul class="user-list list-group col-sm-3 col-sm-push-9">
<li ng-repeat="user in users" class="list-group-item" ng-controller="UserCtrl"
<li ng-repeat="user in users | orderBy:'NickOrder' " class="list-group-item" ng-controller="UserCtrl"
popover="{{ user.IP }} - {{ user.Connection }} - {{ user.Tag }}"
popover-trigger="mouseenter" popover-placement="left">
<button class="btn btn-primary btn-xs pull-right" type="button"
Expand Down

0 comments on commit be6d0a1

Please sign in to comment.