This commit is contained in:
kevgliss 2016-04-01 13:01:56 -07:00
parent 169490dbec
commit 2cde7336dc
21 changed files with 386 additions and 350 deletions

View File

@ -41,6 +41,10 @@ angular.module('lemur')
// set the defaults // set the defaults
AuthorityService.getDefaults($scope.authority); AuthorityService.getDefaults($scope.authority);
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
$scope.create = function (authority) { $scope.create = function (authority) {
WizardHandler.wizard().context.loading = true; WizardHandler.wizard().context.loading = true;
AuthorityService.create(authority).then( AuthorityService.create(authority).then(

View File

@ -1,4 +1,5 @@
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title"><span ng-show="!authority.id">Create</span><span ng-show="authority.id">Edit</span> Authority <span class="text-muted"><small>The nail that sticks out farthest gets hammered the hardest</small></span></h3> <h3 class="modal-title"><span ng-show="!authority.id">Create</span><span ng-show="authority.id">Edit</span> Authority <span class="text-muted"><small>The nail that sticks out farthest gets hammered the hardest</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">

View File

@ -1,5 +1,6 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <div class="modal-title">
<button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header">Edit <span class="text-muted"><small>{{ authority.name }}</small></span></h3> <h3 class="modal-header">Edit <span class="text-muted"><small>{{ authority.name }}</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">

View File

@ -73,6 +73,7 @@ angular.module('lemur')
templateUrl: '/angular/authorities/authority/edit.tpl.html', templateUrl: '/angular/authorities/authority/edit.tpl.html',
controller: 'AuthorityEditController', controller: 'AuthorityEditController',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return authorityId; return authorityId;
@ -92,6 +93,7 @@ angular.module('lemur')
templateUrl: '/angular/roles/role/role.tpl.html', templateUrl: '/angular/roles/role/role.tpl.html',
controller: 'RolesEditController', controller: 'RolesEditController',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return roleId; return roleId;
@ -110,7 +112,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'AuthorityCreateController', controller: 'AuthorityCreateController',
templateUrl: '/angular/authorities/authority/authorityWizard.tpl.html', templateUrl: '/angular/authorities/authority/authorityWizard.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static',
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {

View File

@ -90,6 +90,10 @@ angular.module('lemur')
// set the defaults // set the defaults
CertificateService.getDefaults($scope.certificate); CertificateService.getDefaults($scope.certificate);
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
$scope.create = function (certificate) { $scope.create = function (certificate) {
WizardHandler.wizard().context.loading = true; WizardHandler.wizard().context.loading = true;
CertificateService.create(certificate).then( CertificateService.create(certificate).then(

View File

@ -1,5 +1,6 @@
<div class="modal-header"> <div class="modal-header">
<h3 class="modal-title"><span ng-show="!certificate.id">Create</span><span ng-show="certificate.id">Edit</span> Certificate <span class="text-muted"><small>encrypt all the things</small></h3> <button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title"><span ng-show="!certificate.id">Create</span><span ng-show="certificate.id">Edit</span> Certificate <span class="text-muted"><small>encrypt all the things</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div> <div>

View File

@ -1,5 +1,6 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <div class="modal-title">
<button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header">Edit <span class="text-muted"><small>{{ certificate.name }}</small></span></h3> <h3 class="modal-header">Edit <span class="text-muted"><small>{{ certificate.name }}</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">

View File

@ -1,5 +1,6 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <div class="modal-title">
<button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header">Export <span class="text-muted"><small>{{ certificate.name }}</small></span></h3> <h3 class="modal-header">Export <span class="text-muted"><small>{{ certificate.name }}</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">

View File

@ -1,5 +1,6 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <div class="modal-title">
<button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header">Upload a certificate <span class="text-muted"><small>encrypt all the things</small></span></h3> <h3 class="modal-header">Upload a certificate <span class="text-muted"><small>encrypt all the things</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">

View File

@ -125,7 +125,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'CertificateCreateController', controller: 'CertificateCreateController',
templateUrl: '/angular/certificates/certificate/certificateWizard.tpl.html', templateUrl: '/angular/certificates/certificate/certificateWizard.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static'
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {
@ -139,6 +140,7 @@ angular.module('lemur')
controller: 'CertificateEditController', controller: 'CertificateEditController',
templateUrl: '/angular/certificates/certificate/edit.tpl.html', templateUrl: '/angular/certificates/certificate/edit.tpl.html',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return certificateId; return certificateId;
@ -156,7 +158,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'CertificateUploadController', controller: 'CertificateUploadController',
templateUrl: '/angular/certificates/certificate/upload.tpl.html', templateUrl: '/angular/certificates/certificate/upload.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static'
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {
@ -170,6 +173,7 @@ angular.module('lemur')
controller: 'CertificateExportController', controller: 'CertificateExportController',
templateUrl: '/angular/certificates/certificate/export.tpl.html', templateUrl: '/angular/certificates/certificate/export.tpl.html',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return certificateId; return certificateId;

View File

@ -1,8 +1,8 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header"><span ng-show="!destination.fromServer">Create</span><span ng-show="destination.fromServer">Edit</span> Destination <span class="text-muted"><small>oh the places you will go!</small></span></h3> <h3><span ng-show="!destination.fromServer">Create</span><span ng-show="destination.fromServer">Edit</span> Destination <span class="text-muted"><small>oh the places you will go!</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form name="createForm" class="form-horizontal" role="form" novalidate> <form name="createForm" class="form-horizontal" role="form" novalidate>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': createForm.label.$invalid, 'has-success': !createForm.label.$invalid&&createForm.label.$dirty}"> ng-class="{'has-error': createForm.label.$invalid, 'has-success': !createForm.label.$invalid&&createForm.label.$dirty}">
@ -47,10 +47,9 @@
</ng-form> </ng-form>
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button ng-click="save(destination)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <button ng-click="save(destination)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button>
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</div>
</div> </div>

View File

@ -55,6 +55,7 @@ angular.module('lemur')
templateUrl: '/angular/destinations/destination/destination.tpl.html', templateUrl: '/angular/destinations/destination/destination.tpl.html',
controller: 'DestinationsEditController', controller: 'DestinationsEditController',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return destinationId; return destinationId;
@ -73,7 +74,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'DestinationsCreateController', controller: 'DestinationsCreateController',
templateUrl: '/angular/destinations/destination/destination.tpl.html', templateUrl: '/angular/destinations/destination/destination.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static'
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {

View File

@ -54,7 +54,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'DomainsCreateController', controller: 'DomainsCreateController',
templateUrl: '/angular/domains/domain/domain.tpl.html', templateUrl: '/angular/domains/domain/domain.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static'
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {

View File

@ -1,8 +1,8 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header"><span ng-show="!notification.fromServer">Create</span><span ng-show="notification.fromServer">Edit</span> Notification <span class="text-muted"><small>you gotta speak louder son!</small></span></h3> <h3><span ng-show="!notification.fromServer">Create</span><span ng-show="notification.fromServer">Edit</span> Notification <span class="text-muted"><small>you gotta speak louder son!</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form name="createForm" class="form-horizontal" role="form" novalidate> <form name="createForm" class="form-horizontal" role="form" novalidate>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': createForm.label.$invalid, 'has-success': !createForm.label.$invalid&&createForm.label.$dirty}"> ng-class="{'has-error': createForm.label.$invalid, 'has-success': !createForm.label.$invalid&&createForm.label.$dirty}">
@ -78,10 +78,9 @@
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button ng-click="save(notification)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <button ng-click="save(notification)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button>
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</div>
</div> </div>

View File

@ -61,6 +61,7 @@ angular.module('lemur')
templateUrl: '/angular/notifications/notification/notification.tpl.html', templateUrl: '/angular/notifications/notification/notification.tpl.html',
controller: 'NotificationsEditController', controller: 'NotificationsEditController',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return notificationId; return notificationId;
@ -79,7 +80,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'NotificationsCreateController', controller: 'NotificationsCreateController',
templateUrl: '/angular/notifications/notification/notification.tpl.html', templateUrl: '/angular/notifications/notification/notification.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static'
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {

View File

@ -1,8 +1,8 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header"><span ng-show="!role.fromServer">Create</span><span ng-show="role.fromServer">Edit</span> Role <span class="text-muted"><small>The nail that sticks out farthest gets hammered the hardest</small></span></h3> <h3><span ng-show="!role.fromServer">Create</span><span ng-show="role.fromServer">Edit</span> Role <span class="text-muted"><small>The nail that sticks out farthest gets hammered the hardest</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form name="createForm" class="form-horizontal" ng-submit="save(role)" role="form" novalidate> <form name="createForm" class="form-horizontal" ng-submit="save(role)" role="form" novalidate>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': createForm.name.$invalid, 'has-success': !createForm.name.$invalid&&createForm.name.$dirty}"> ng-class="{'has-error': createForm.name.$invalid, 'has-success': !createForm.name.$invalid&&createForm.name.$dirty}">
@ -82,5 +82,4 @@
<button ng-click="save(role)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <button ng-click="save(role)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button>
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</div> </div>
</div>
</div> </div>

View File

@ -47,6 +47,7 @@ angular.module('lemur')
templateUrl: '/angular/roles/role/role.tpl.html', templateUrl: '/angular/roles/role/role.tpl.html',
controller: 'RolesEditController', controller: 'RolesEditController',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return roleId; return roleId;
@ -65,7 +66,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'RolesCreateController', controller: 'RolesCreateController',
templateUrl: '/angular/roles/role/role.tpl.html', templateUrl: '/angular/roles/role/role.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static'
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {

View File

@ -1,8 +1,8 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header"><span ng-show="!source.fromServer">Create</span><span ng-show="source.fromServer">Edit</span> Source <span class="text-muted"><small>oh the places you will go!</small></span></h3> <h3><span ng-show="!source.fromServer">Create</span><span ng-show="source.fromServer">Edit</span> Source <span class="text-muted"><small>oh the places you will go!</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form name="createForm" class="form-horizontal" role="form" novalidate> <form name="createForm" class="form-horizontal" role="form" novalidate>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': createForm.label.$invalid, 'has-success': !createForm.label.$invalid&&createForm.label.$dirty}"> ng-class="{'has-error': createForm.label.$invalid, 'has-success': !createForm.label.$invalid&&createForm.label.$dirty}">
@ -47,10 +47,9 @@
</ng-form> </ng-form>
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button ng-click="save(source)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <button ng-click="save(source)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button>
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</div>
</div> </div>

View File

@ -55,6 +55,7 @@ angular.module('lemur')
templateUrl: '/angular/sources/source/source.tpl.html', templateUrl: '/angular/sources/source/source.tpl.html',
controller: 'SourcesEditController', controller: 'SourcesEditController',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return sourceId; return sourceId;
@ -73,7 +74,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'SourcesCreateController', controller: 'SourcesCreateController',
templateUrl: '/angular/sources/source/source.tpl.html', templateUrl: '/angular/sources/source/source.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static'
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {

View File

@ -1,8 +1,10 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"> <button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span>
<h3 class="modal-header"><span ng-show="!user.fromServer">Create</span><span ng-show="user.fromServer">Edit</span> User <span class="text-muted"><small>what was your name again?</small></span></h3> </button>
</div> <h3><span ng-show="!user.fromServer">Create</span><span ng-show="user.fromServer">Edit</span> User <span
<div class="modal-body"> class="text-muted"><small>what was your name again?</small></span></h3>
</div>
<div class="modal-body">
<form name="createForm" class="form-horizontal" role="form" novalidate> <form name="createForm" class="form-horizontal" role="form" novalidate>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': createForm.username.$invalid, 'has-success': !createForm.username.$invalid&&createForm.username.$dirty}"> ng-class="{'has-error': createForm.username.$invalid, 'has-success': !createForm.username.$invalid&&createForm.username.$dirty}">
@ -11,7 +13,8 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="username" ng-model="user.username" placeholder="Name" class="form-control" required/> <input name="username" ng-model="user.username" placeholder="Name" class="form-control" required/>
<p ng-show="createForm.username.$invalid && !createForm.username.$pristine" class="help-block">You must enter a username</p> <p ng-show="createForm.username.$invalid && !createForm.username.$pristine" class="help-block">You must enter a
username</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -20,8 +23,10 @@
Email Email
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="email" name="email" ng-model="user.email" placeholder="hi@example.com" class="form-control" required/> <input type="email" name="email" ng-model="user.email" placeholder="hi@example.com" class="form-control"
<p ng-show="createForm.email.$invalid && !createForm.email.$pristine" class="help-block">You must enter an email</p> required/>
<p ng-show="createForm.email.$invalid && !createForm.email.$pristine" class="help-block">You must enter an
email</p>
</div> </div>
</div> </div>
<div ng-if="!user.id" class="form-group" <div ng-if="!user.id" class="form-group"
@ -30,7 +35,7 @@
Password Password
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="password" name="password" ng-model="user.password" placeholder="hunter2" class="form-control" /> <input type="password" name="password" ng-model="user.password" placeholder="hunter2" class="form-control"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -39,7 +44,8 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<div class="checkbox col-sm-10"> <div class="checkbox col-sm-10">
<switch ng-model="user.active" id="active" name="active" ng-init="user.active=true" class="green small"></switch> <switch ng-model="user.active" id="active" name="active" ng-init="user.active=true"
class="green small"></switch>
</div> </div>
</div> </div>
</div> </div>
@ -50,12 +56,14 @@
<div class="col-sm-10"> <div class="col-sm-10">
<div class="input-group"> <div class="input-group">
<input type="text" ng-model="user.selectedRole" placeholder="Role Name" <input type="text" ng-model="user.selectedRole" placeholder="Role Name"
typeahead="role.name for role in roleService.findRoleByName($viewValue)" typeahead-loading="loadingRoles" typeahead="role.name for role in roleService.findRoleByName($viewValue)"
typeahead-loading="loadingRoles"
class="form-control input-md" typeahead-on-select="user.attachRole($item)" typeahead-min-wait="50" class="form-control input-md" typeahead-on-select="user.attachRole($item)" typeahead-min-wait="50"
tooltip="Roles control which authorities a user can issue certificates from" tooltip="Roles control which authorities a user can issue certificates from"
tooltip-trigger="focus" tooltip-placement="top"> tooltip-trigger="focus" tooltip-placement="top">
<span class="input-group-btn"> <span class="input-group-btn">
<button ng-model="roles.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0"> <button ng-model="roles.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1"
btn-checkbox-false="0">
<span class="badge">{{ user.roles.total || 0 }}</span> <span class="badge">{{ user.roles.total || 0 }}</span>
</button> </button>
</span> </span>
@ -65,7 +73,8 @@
<td><a class="btn btn-sm btn-info" href="#/roles/{{ role.id }}/edit">{{ role.name }}</a></td> <td><a class="btn btn-sm btn-info" href="#/roles/{{ role.id }}/edit">{{ role.name }}</a></td>
<td><span class="text-muted">{{ role.description }}</span></td> <td><span class="text-muted">{{ role.description }}</span></td>
<td> <td>
<button type="button" ng-click="user.removeRole($index)" class="btn btn-danger btn-sm pull-right">Remove</button> <button type="button" ng-click="user.removeRole($index)" class="btn btn-danger btn-sm pull-right">Remove
</button>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -81,5 +90,4 @@
<button ng-click="save(user)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <button ng-click="save(user)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button>
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</div> </div>
</div>
</div> </div>

View File

@ -43,6 +43,7 @@ angular.module('lemur')
templateUrl: '/angular/users/user/user.tpl.html', templateUrl: '/angular/users/user/user.tpl.html',
controller: 'UsersEditController', controller: 'UsersEditController',
size: 'lg', size: 'lg',
backdrop: 'static',
resolve: { resolve: {
editId: function () { editId: function () {
return userId; return userId;
@ -61,7 +62,8 @@ angular.module('lemur')
animation: true, animation: true,
controller: 'UsersCreateController', controller: 'UsersCreateController',
templateUrl: '/angular/users/user/user.tpl.html', templateUrl: '/angular/users/user/user.tpl.html',
size: 'lg' size: 'lg',
backdrop: 'static'
}); });
modalInstance.result.then(function () { modalInstance.result.then(function () {