-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1316 Add UI to switch organisation for users belongs to more than on…
…e org
- Loading branch information
Showing
6 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
frontend/app/scripts/components/organisation/OrgSwitchCtrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('theHiveControllers').controller('OrgSwitchCtrl', | ||
function($uibModalInstance, currentUser) { | ||
//var self = this; | ||
|
||
this.currentUser = currentUser; | ||
|
||
this.selectOrg = function(selected) { | ||
$uibModalInstance.close(selected); | ||
}; | ||
|
||
this.cancel = function() { | ||
$uibModalInstance.dismiss(); | ||
}; | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<form ng-submit="$modal.confirm()"> | ||
<div class="modal-header bg-primary"> | ||
<h3 class="modal-title">Switch organisation</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<p class="mb-xs"> | ||
Please select the organisation you want to switch to: | ||
</p> | ||
|
||
<div class="form-group has-feedback has-feedback-left" ng-if="$dialog.currentUser.organisations.length > 5"> | ||
<input type="text" class="input input-lg form-control" placeholder="Filter organisations" ng-model="$modal.filter" autocomplete="off"> | ||
<i class="form-control-feedback glyphicon glyphicon-search"></i> | ||
</div> | ||
|
||
|
||
<ul class="nav nav-pills nav-stacked"> | ||
<div class="list-group"> | ||
<a href ng-click="$dialog.selectOrg(item.organisation)" class="list-group-item" | ||
ng-class="{'active': $dialog.currentUser.organisation === item.organisation}" | ||
ng-repeat="item in $dialog.currentUser.organisations | filter:$modal.filter track by $index"> | ||
<h4 class="list-group-item-heading">{{item.organisation}}</h4> | ||
<p class="list-group-item-text">Profile: <strong>{{item.role}}</strong></p> | ||
</a> | ||
</div> | ||
</ul> | ||
</div> | ||
<div class="modal-footer text-left"> | ||
<button class="btn btn-default" ng-click="$dialog.cancel()" type="button">Cancel</button> | ||
</div> | ||
</form> |