Fixed realms list page
This commit is contained in:
parent
52c7ae057a
commit
924184f659
4 changed files with 52 additions and 32 deletions
|
@ -20,8 +20,12 @@ module.controller('GlobalCtrl', function($scope, $http, Auth, Current, $location
|
|||
});
|
||||
});
|
||||
|
||||
module.controller('HomeCtrl', function($scope, Realm, Current) {
|
||||
console.debug("home");
|
||||
});
|
||||
|
||||
module.controller('RealmListCtrl', function($scope, Realm, Current) {
|
||||
$scope.realms = Realm.get();
|
||||
$scope.realms = Realm.query();
|
||||
Current.realms = $scope.realms;
|
||||
});
|
||||
|
||||
|
@ -35,6 +39,9 @@ module.controller('RealmDropdownCtrl', function($scope, Realm, Current, Auth, $l
|
|||
var show = Current.realms.length > 0;
|
||||
return Auth.loggedIn && show;
|
||||
}
|
||||
$scope.refresh = function() {
|
||||
Current.refresh();
|
||||
}
|
||||
});
|
||||
|
||||
module.controller('RealmDetailCtrl', function($scope, Current, Realm, realm, $http, $location, Dialog, Notifications) {
|
||||
|
|
|
@ -232,19 +232,25 @@ module.factory('ApplicationOrigins', function($resource) {
|
|||
module.factory('Current', function(Realm, $route) {
|
||||
var current = {};
|
||||
|
||||
current.realms = {};
|
||||
current.realm = null;
|
||||
current.realms = Realm.query(null, function(realms) {
|
||||
if ($route.current.params.realm) {
|
||||
for (var i = 0; i < realms.length; i++) {
|
||||
if (realms[i].id == $route.current.params.realm) {
|
||||
current.realm = realms[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
current.applications = {};
|
||||
current.application = null;
|
||||
|
||||
current.refresh = function() {
|
||||
current.realm = null;
|
||||
current.realms = Realm.query(null, function(realms) {
|
||||
if ($route.current.params.realm) {
|
||||
for (var i = 0; i < realms.length; i++) {
|
||||
if (realms[i].id == $route.current.params.realm) {
|
||||
current.realm = realms[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
current.refresh();
|
||||
|
||||
return current;
|
||||
});
|
|
@ -25,7 +25,7 @@
|
|||
<span class="dropdown-label" data-ng-show="showNav()">Realm:</span>
|
||||
<div class="select-rcue" data-ng-show="showNav()">
|
||||
<select ng-change="changeRealm()" ng-model="current.realm" ng-options="r.realm for r in current.realms"></select>
|
||||
</div><a href="#/realms/{{current.realm.id}}" id="refresh" data-ng-show="showNav()" class="tooltipBottomTrigger" data-original-title="Refresh"><span class="icon-spinner6">Icon: spinner</span></a>
|
||||
</div><a data-ng-click="refresh()" id="refresh" data-ng-show="showNav()" class="tooltipBottomTrigger" data-original-title="Refresh"><span class="icon-spinner6">Icon: spinner</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="pull-right" data-ng-show="auth.loggedIn">
|
||||
|
|
|
@ -1,27 +1,34 @@
|
|||
<div id="wrapper" class="container">
|
||||
<div class="row">
|
||||
<aside class="span3" data-ng-include data-src="'partials/realm-menu.html'"></aside>
|
||||
<div id="actions-bg"></div>
|
||||
|
||||
<div id="container-right" class="span9">
|
||||
<a class="btn btn-small pull-right" href="#/create/realm">Add Realm</a>
|
||||
|
||||
<h1>
|
||||
<span class="gray">Realms</span>
|
||||
</h1>
|
||||
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Realm</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr data-ng-repeat="(id, name) in realms">
|
||||
<td><a href="#/realms/{{id}}">{{name}}</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="bs-sidebar col-md-3 clearfix">
|
||||
<ul data-ng-hide="createRealm">
|
||||
<li class="active"><a href="#/realms">Realms</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content-area" class="col-md-9" role="main">
|
||||
<div class="top-nav" data-ng-hide="createRealm">
|
||||
<ul class="rcue-tabs">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
|
||||
<h1>
|
||||
<span class="gray">Realms</span>
|
||||
</h1>
|
||||
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Realm</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr data-ng-repeat="r in realms">
|
||||
<td><a href="#/realms/{{r.id}}">{{r.realm}}</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="container-right-bg"></div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in a new issue