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,56 +1,55 @@
<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}">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Label Label
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="label" ng-model="destination.label" placeholder="Label" class="form-control" required/> <input name="label" ng-model="destination.label" placeholder="Label" class="form-control" required/>
<p ng-show="createForm.label.$invalid && !createForm.label.$pristine" class="help-block">You must enter an destination label</p> <p ng-show="createForm.label.$invalid && !createForm.label.$pristine" class="help-block">You must enter an destination label</p>
</div>
</div> </div>
<div class="form-group"> </div>
<label class="control-label col-sm-2"> <div class="form-group">
Description <label class="control-label col-sm-2">
</label> Description
<div class="col-sm-10"> </label>
<textarea name="comments" ng-model="destination.description" placeholder="Something elegant" class="form-control" ></textarea> <div class="col-sm-10">
</div> <textarea name="comments" ng-model="destination.description" placeholder="Something elegant" class="form-control" ></textarea>
</div> </div>
<div class="form-group"> </div>
<label class="control-label col-sm-2"> <div class="form-group">
Plugin <label class="control-label col-sm-2">
</label> Plugin
<div class="col-sm-10"> </label>
<select class="form-control" ng-model="destination.plugin" ng-options="plugin.title for plugin in plugins" required></select> <div class="col-sm-10">
</div> <select class="form-control" ng-model="destination.plugin" ng-options="plugin.title for plugin in plugins" required></select>
</div> </div>
<div class="form-group" ng-repeat="item in destination.plugin.pluginOptions"> </div>
<ng-form name="subForm" class="form-horizontal" role="form" novalidate> <div class="form-group" ng-repeat="item in destination.plugin.pluginOptions">
<div ng-class="{'has-error': subForm.sub.$invalid, 'has-success': !subForm.sub.$invalid&&subForm.sub.$dirty}"> <ng-form name="subForm" class="form-horizontal" role="form" novalidate>
<label class="control-label col-sm-2"> <div ng-class="{'has-error': subForm.sub.$invalid, 'has-success': !subForm.sub.$invalid&&subForm.sub.$dirty}">
{{ item.name | titleCase }} <label class="control-label col-sm-2">
</label> {{ item.name | titleCase }}
<div class="col-sm-10"> </label>
<input name="sub" ng-if="item.type == 'int'" type="number" ng-pattern="/^[0-9]{12,12}$/" class="form-control" ng-model="item.value"/> <div class="col-sm-10">
<select name="sub" ng-if="item.type == 'select'" class="form-control" ng-options="i for i in item.available" ng-model="item.value"></select> <input name="sub" ng-if="item.type == 'int'" type="number" ng-pattern="/^[0-9]{12,12}$/" class="form-control" ng-model="item.value"/>
<input name="sub" ng-if="item.type == 'bool'" class="form-control" type="checkbox" ng-model="item.value"> <select name="sub" ng-if="item.type == 'select'" class="form-control" ng-options="i for i in item.available" ng-model="item.value"></select>
<input name="sub" ng-if="item.type == 'str'" type="text" class="form-control" ng-model="item.value"/> <input name="sub" ng-if="item.type == 'bool'" class="form-control" type="checkbox" ng-model="item.value">
<p ng-show="subForm.sub.$invalid && !subForm.sub.$pristine" class="help-block">{{ item.helpMessage }}</p> <input name="sub" ng-if="item.type == 'str'" type="text" class="form-control" ng-model="item.value"/>
</div> <p ng-show="subForm.sub.$invalid && !subForm.sub.$pristine" class="help-block">{{ item.helpMessage }}</p>
</div> </div>
</ng-form> </div>
</div> </ng-form>
</form> </div>
</div> </form>
<div class="modal-footer"> </div>
<button ng-click="save(destination)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <div class="modal-footer">
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="save(destination)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button>
</div> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</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,87 +1,86 @@
<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}">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Label Label
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="label" ng-model="notification.label" placeholder="Label" class="form-control" required/> <input name="label" ng-model="notification.label" placeholder="Label" class="form-control" required/>
<p ng-show="createForm.label.$invalid && !createForm.label.$pristine" class="help-block">You must enter an notification label</p> <p ng-show="createForm.label.$invalid && !createForm.label.$pristine" class="help-block">You must enter an notification label</p>
</div>
</div> </div>
<div class="form-group"> </div>
<label class="control-label col-sm-2"> <div class="form-group">
Description <label class="control-label col-sm-2">
</label> Description
<div class="col-sm-10"> </label>
<textarea name="comments" ng-model="notification.description" placeholder="Something elegant" class="form-control" ></textarea> <div class="col-sm-10">
</div> <textarea name="comments" ng-model="notification.description" placeholder="Something elegant" class="form-control" ></textarea>
</div> </div>
<div class="form-group"> </div>
<label class="control-label col-sm-2"> <div class="form-group">
Plugin <label class="control-label col-sm-2">
</label> Plugin
<div class="col-sm-10"> </label>
<select class="form-control" ng-model="notification.plugin" ng-options="plugin.title for plugin in plugins" required></select> <div class="col-sm-10">
</div> <select class="form-control" ng-model="notification.plugin" ng-options="plugin.title for plugin in plugins" required></select>
</div> </div>
<div class="form-group" ng-repeat="item in notification.plugin.pluginOptions"> </div>
<ng-form name="subForm" class="form-horizontal" role="form" novalidate> <div class="form-group" ng-repeat="item in notification.plugin.pluginOptions">
<div ng-class="{'has-error': subForm.sub.$invalid, 'has-success': !subForm.sub.$invalid&&subForm.sub.$dirty}"> <ng-form name="subForm" class="form-horizontal" role="form" novalidate>
<label class="control-label col-sm-2"> <div ng-class="{'has-error': subForm.sub.$invalid, 'has-success': !subForm.sub.$invalid&&subForm.sub.$dirty}">
{{ item.name | titleCase }} <label class="control-label col-sm-2">
</label> {{ item.name | titleCase }}
<div class="col-sm-10"> </label>
<input name="sub" ng-if="item.type == 'int'" type="number" ng-pattern="item.validation" class="form-control" ng-model="item.value"/> <div class="col-sm-10">
<select name="sub" ng-if="item.type == 'select'" class="form-control" ng-options="i as (i | titleCase) for i in item.available" ng-model="item.value"></select> <input name="sub" ng-if="item.type == 'int'" type="number" ng-pattern="item.validation" class="form-control" ng-model="item.value"/>
<input name="sub" ng-if="item.type == 'bool'" class="form-control" type="checkbox" ng-model="item.value"> <select name="sub" ng-if="item.type == 'select'" class="form-control" ng-options="i as (i | titleCase) for i in item.available" ng-model="item.value"></select>
<input name="sub" ng-if="item.type == 'str'" ng-pattern="item.validation" type="text" class="form-control" ng-model="item.value"/> <input name="sub" ng-if="item.type == 'bool'" class="form-control" type="checkbox" ng-model="item.value">
<p ng-show="subForm.sub.$invalid && !subForm.sub.$pristine" class="help-block">{{ item.helpMessage }}</p> <input name="sub" ng-if="item.type == 'str'" ng-pattern="item.validation" type="text" class="form-control" ng-model="item.value"/>
</div> <p ng-show="subForm.sub.$invalid && !subForm.sub.$pristine" class="help-block">{{ item.helpMessage }}</p>
</div> </div>
</ng-form>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Certificates
</label>
<div class="col-sm-10">
<div class="input-group">
<input type="text" ng-model="notification.selectedCertificate" placeholder="Certificate Name"
typeahead="certificate.name for certificate in certificateService.findCertificatesByName($viewValue)" typeahead-loading="loadingCertificates"
class="form-control input-md" typeahead-on-select="notification.attachCertificate($item)" typeahead-min-wait="50">
<span class="input-group-btn">
<button ng-model="certificates.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">
<span class="badge">{{ notification.certificates.total || 0 }}</span>
</button>
</span>
</div>
<table ng-show="notification.certificates" class="table">
<tr ng-repeat="certificate in notification.certificates track by $index">
<td><a class="btn btn-sm btn-info" href="#">{{ certificate.name }}</a></td>
<td><span class="text-muted">{{ certificate.description }}</span></td>
<td>
<button type="button" ng-click="notification.removeCertificate($index)" class="btn btn-danger btn-sm pull-right">Remove</button>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a class="pull-right" ng-click="loadMoreCertificates()"><strong>More</strong></a></td>
</tr>
</table>
</div> </div>
</ng-form>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Certificates
</label>
<div class="col-sm-10">
<div class="input-group">
<input type="text" ng-model="notification.selectedCertificate" placeholder="Certificate Name"
typeahead="certificate.name for certificate in certificateService.findCertificatesByName($viewValue)" typeahead-loading="loadingCertificates"
class="form-control input-md" typeahead-on-select="notification.attachCertificate($item)" typeahead-min-wait="50">
<span class="input-group-btn">
<button ng-model="certificates.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">
<span class="badge">{{ notification.certificates.total || 0 }}</span>
</button>
</span>
</div>
<table ng-show="notification.certificates" class="table">
<tr ng-repeat="certificate in notification.certificates track by $index">
<td><a class="btn btn-sm btn-info" href="#">{{ certificate.name }}</a></td>
<td><span class="text-muted">{{ certificate.description }}</span></td>
<td>
<button type="button" ng-click="notification.removeCertificate($index)" class="btn btn-danger btn-sm pull-right">Remove</button>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a class="pull-right" ng-click="loadMoreCertificates()"><strong>More</strong></a></td>
</tr>
</table>
</div> </div>
</form> </div>
</div> </form>
<div class="modal-footer"> </div>
<button ng-click="save(notification)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <div class="modal-footer">
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="save(notification)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button>
</div> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</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,86 +1,85 @@
<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}">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Name Name
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="name" ng-model="role.name" placeholder="Name" class="form-control" required/> <input name="name" ng-model="role.name" placeholder="Name" class="form-control" required/>
<p ng-show="createForm.name.$invalid && !createForm.name.$pristine" class="help-block">You must enter an role name</p> <p ng-show="createForm.name.$invalid && !createForm.name.$pristine" class="help-block">You must enter an role name</p>
</div>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-2">
Description
</label>
<div class="col-sm-10">
<textarea name="description" ng-model="role.description" placeholder="Something elegant" class="form-control" ></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Username
</label>
<div class="col-sm-10">
<input ng-show="!role.fromServer" name="username" ng-model="role.username" placeholder="Username" class="form-control"/>
<div class="well">
<span ng-show="role.password">
{{ role.username }}
</span>
<span ng-show="!role.password">
******************
</span>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Password
</label>
<div class="col-sm-10">
<input ng-show="!role.fromServer" type="password" name="password" ng-model="role.password" placeholder="hunter2" class="form-control"/>
<p ng-show="createForm.password.$invalid && !createForm.password.$pristine" class="help-block">You must enter an password</p>
<div class="well">
<span ng-show="role.password">
{{ role.password }}
</span>
<span ng-show="!role.password">
*****************
</span>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">User(s)</label>
<div class="col-sm-10">
<input tooltip="You can attach any user to this role, once attached they will have access as defined by this role"
typeahead="user.username for user in userService.findUserByName($viewValue)" typeahead-loading="loadingUsers"
typeahead-min-wait="100" typeahead-on-select="role.addUser($item)"
type="text" name="user" ng-model="role.selectedUser" placeholder="Username..." class="form-control"/>
<table ng-show="role.users" class="table">
<tr ng-repeat="user in role.users track by $index">
<td>{{ user.username }}</td>
<td>
<button type="button" ng-click="role.removeUser($index)" class="btn btn-danger btn-sm pull-right">Remove</button>
</td>
</tr>
<tr>
<td></td>
<td><a class="pull-right" ng-click="loadMoreUsers()"><strong>More</strong></a></td>
</tr>
</table>
</div>
</div>
</form>
<div class="modal-footer">
<button ng-click="roleService.loadPassword(role)" class="btn btn-warning pull-left">Show Credentials</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>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-2">
Description
</label>
<div class="col-sm-10">
<textarea name="description" ng-model="role.description" placeholder="Something elegant" class="form-control" ></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Username
</label>
<div class="col-sm-10">
<input ng-show="!role.fromServer" name="username" ng-model="role.username" placeholder="Username" class="form-control"/>
<div class="well">
<span ng-show="role.password">
{{ role.username }}
</span>
<span ng-show="!role.password">
******************
</span>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Password
</label>
<div class="col-sm-10">
<input ng-show="!role.fromServer" type="password" name="password" ng-model="role.password" placeholder="hunter2" class="form-control"/>
<p ng-show="createForm.password.$invalid && !createForm.password.$pristine" class="help-block">You must enter an password</p>
<div class="well">
<span ng-show="role.password">
{{ role.password }}
</span>
<span ng-show="!role.password">
*****************
</span>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">User(s)</label>
<div class="col-sm-10">
<input tooltip="You can attach any user to this role, once attached they will have access as defined by this role"
typeahead="user.username for user in userService.findUserByName($viewValue)" typeahead-loading="loadingUsers"
typeahead-min-wait="100" typeahead-on-select="role.addUser($item)"
type="text" name="user" ng-model="role.selectedUser" placeholder="Username..." class="form-control"/>
<table ng-show="role.users" class="table">
<tr ng-repeat="user in role.users track by $index">
<td>{{ user.username }}</td>
<td>
<button type="button" ng-click="role.removeUser($index)" class="btn btn-danger btn-sm pull-right">Remove</button>
</td>
</tr>
<tr>
<td></td>
<td><a class="pull-right" ng-click="loadMoreUsers()"><strong>More</strong></a></td>
</tr>
</table>
</div>
</div>
</form>
<div class="modal-footer">
<button ng-click="roleService.loadPassword(role)" class="btn btn-warning pull-left">Show Credentials</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>
</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,56 +1,55 @@
<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}">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Label Label
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="label" ng-model="source.label" placeholder="Label" class="form-control" required/> <input name="label" ng-model="source.label" placeholder="Label" class="form-control" required/>
<p ng-show="createForm.label.$invalid && !createForm.label.$pristine" class="help-block">You must enter an source label</p> <p ng-show="createForm.label.$invalid && !createForm.label.$pristine" class="help-block">You must enter an source label</p>
</div>
</div> </div>
<div class="form-group"> </div>
<label class="control-label col-sm-2"> <div class="form-group">
Description <label class="control-label col-sm-2">
</label> Description
<div class="col-sm-10"> </label>
<textarea name="comments" ng-model="source.description" placeholder="Something elegant" class="form-control" ></textarea> <div class="col-sm-10">
</div> <textarea name="comments" ng-model="source.description" placeholder="Something elegant" class="form-control" ></textarea>
</div> </div>
<div class="form-group"> </div>
<label class="control-label col-sm-2"> <div class="form-group">
Plugin <label class="control-label col-sm-2">
</label> Plugin
<div class="col-sm-10"> </label>
<select class="form-control" ng-model="source.plugin" ng-options="plugin.title for plugin in plugins" required></select> <div class="col-sm-10">
</div> <select class="form-control" ng-model="source.plugin" ng-options="plugin.title for plugin in plugins" required></select>
</div> </div>
<div class="form-group" ng-repeat="item in source.plugin.pluginOptions"> </div>
<ng-form name="subForm" class="form-horizontal" role="form" novalidate> <div class="form-group" ng-repeat="item in source.plugin.pluginOptions">
<div ng-class="{'has-error': subForm.sub.$invalid, 'has-success': !subForm.sub.$invalid&&subForm.sub.$dirty}"> <ng-form name="subForm" class="form-horizontal" role="form" novalidate>
<label class="control-label col-sm-2"> <div ng-class="{'has-error': subForm.sub.$invalid, 'has-success': !subForm.sub.$invalid&&subForm.sub.$dirty}">
{{ item.name | titleCase }} <label class="control-label col-sm-2">
</label> {{ item.name | titleCase }}
<div class="col-sm-10"> </label>
<input name="sub" ng-if="item.type == 'int'" type="number" ng-pattern="/^[0-9]{12,12}$/" class="form-control" ng-model="item.value"/> <div class="col-sm-10">
<select name="sub" ng-if="item.type == 'select'" class="form-control" ng-options="i for i in item.available" ng-model="item.value"></select> <input name="sub" ng-if="item.type == 'int'" type="number" ng-pattern="/^[0-9]{12,12}$/" class="form-control" ng-model="item.value"/>
<input name="sub" ng-if="item.type == 'bool'" class="form-control" type="checkbox" ng-model="item.value"> <select name="sub" ng-if="item.type == 'select'" class="form-control" ng-options="i for i in item.available" ng-model="item.value"></select>
<input name="sub" ng-if="item.type == 'str'" type="text" class="form-control" ng-model="item.value"/> <input name="sub" ng-if="item.type == 'bool'" class="form-control" type="checkbox" ng-model="item.value">
<p ng-show="subForm.sub.$invalid && !subForm.sub.$pristine" class="help-block">{{ item.helpMessage }}</p> <input name="sub" ng-if="item.type == 'str'" type="text" class="form-control" ng-model="item.value"/>
</div> <p ng-show="subForm.sub.$invalid && !subForm.sub.$pristine" class="help-block">{{ item.helpMessage }}</p>
</div> </div>
</ng-form> </div>
</div> </ng-form>
</form> </div>
</div> </form>
<div class="modal-footer"> </div>
<button ng-click="save(source)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <div class="modal-footer">
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="save(source)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button>
</div> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</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,85 +1,93 @@
<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>
<form name="createForm" class="form-horizontal" role="form" novalidate> </div>
<div class="form-group" <div class="modal-body">
ng-class="{'has-error': createForm.username.$invalid, 'has-success': !createForm.username.$invalid&&createForm.username.$dirty}"> <form name="createForm" class="form-horizontal" role="form" novalidate>
<label class="control-label col-sm-2"> <div class="form-group"
Name ng-class="{'has-error': createForm.username.$invalid, 'has-success': !createForm.username.$invalid&&createForm.username.$dirty}">
</label> <label class="control-label col-sm-2">
<div class="col-sm-10"> Name
<input name="username" ng-model="user.username" placeholder="Name" class="form-control" required/> </label>
<p ng-show="createForm.username.$invalid && !createForm.username.$pristine" class="help-block">You must enter a username</p> <div class="col-sm-10">
</div> <input name="username" ng-model="user.username" placeholder="Name" class="form-control" required/>
</div> <p ng-show="createForm.username.$invalid && !createForm.username.$pristine" class="help-block">You must enter a
<div class="form-group" username</p>
ng-class="{'has-error': createForm.email.$invalid, 'has-success': !createForm.email.$invalid&&createForm.email.$dirty}"> </div>
<label class="control-label col-sm-2"> </div>
Email <div class="form-group"
</label> ng-class="{'has-error': createForm.email.$invalid, 'has-success': !createForm.email.$invalid&&createForm.email.$dirty}">
<div class="col-sm-10"> <label class="control-label col-sm-2">
<input type="email" name="email" ng-model="user.email" placeholder="hi@example.com" class="form-control" required/> Email
<p ng-show="createForm.email.$invalid && !createForm.email.$pristine" class="help-block">You must enter an email</p> </label>
</div> <div class="col-sm-10">
</div> <input type="email" name="email" ng-model="user.email" placeholder="hi@example.com" class="form-control"
<div ng-if="!user.id" class="form-group" required/>
ng-class="{'has-error': createForm.password.$invalid, 'has-success': !createForm.password.$invalid&&createForm.password.$dirty}"> <p ng-show="createForm.email.$invalid && !createForm.email.$pristine" class="help-block">You must enter an
<label class="control-label col-sm-2"> email</p>
Password </div>
</label> </div>
<div class="col-sm-10"> <div ng-if="!user.id" class="form-group"
<input type="password" name="password" ng-model="user.password" placeholder="hunter2" class="form-control" /> ng-class="{'has-error': createForm.password.$invalid, 'has-success': !createForm.password.$invalid&&createForm.password.$dirty}">
</div> <label class="control-label col-sm-2">
</div> Password
<div class="form-group"> </label>
<label class="control-label col-sm-2"> <div class="col-sm-10">
Active <input type="password" name="password" ng-model="user.password" placeholder="hunter2" class="form-control"/>
</label> </div>
<div class="col-sm-10"> </div>
<div class="checkbox col-sm-10"> <div class="form-group">
<switch ng-model="user.active" id="active" name="active" ng-init="user.active=true" class="green small"></switch> <label class="control-label col-sm-2">
</div> Active
</div> </label>
</div> <div class="col-sm-10">
<div class="form-group"> <div class="checkbox col-sm-10">
<label class="control-label col-sm-2"> <switch ng-model="user.active" id="active" name="active" ng-init="user.active=true"
Roles class="green small"></switch>
</label> </div>
<div class="col-sm-10"> </div>
<div class="input-group"> </div>
<input type="text" ng-model="user.selectedRole" placeholder="Role Name" <div class="form-group">
typeahead="role.name for role in roleService.findRoleByName($viewValue)" typeahead-loading="loadingRoles" <label class="control-label col-sm-2">
class="form-control input-md" typeahead-on-select="user.attachRole($item)" typeahead-min-wait="50" Roles
tooltip="Roles control which authorities a user can issue certificates from" </label>
tooltip-trigger="focus" tooltip-placement="top"> <div class="col-sm-10">
<span class="input-group-btn"> <div class="input-group">
<button ng-model="roles.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0"> <input type="text" ng-model="user.selectedRole" placeholder="Role Name"
<span class="badge">{{ user.roles.total || 0 }}</span> typeahead="role.name for role in roleService.findRoleByName($viewValue)"
</button> typeahead-loading="loadingRoles"
</span> class="form-control input-md" typeahead-on-select="user.attachRole($item)" typeahead-min-wait="50"
</div> tooltip="Roles control which authorities a user can issue certificates from"
<table ng-show="user.roles" class="table"> tooltip-trigger="focus" tooltip-placement="top">
<tr ng-repeat="role in user.roles track by $index"> <span class="input-group-btn">
<td><a class="btn btn-sm btn-info" href="#/roles/{{ role.id }}/edit">{{ role.name }}</a></td> <button ng-model="roles.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1"
<td><span class="text-muted">{{ role.description }}</span></td> btn-checkbox-false="0">
<td> <span class="badge">{{ user.roles.total || 0 }}</span>
<button type="button" ng-click="user.removeRole($index)" class="btn btn-danger btn-sm pull-right">Remove</button> </button>
</td> </span>
</tr> </div>
<tr> <table ng-show="user.roles" class="table">
<td></td> <tr ng-repeat="role in user.roles track by $index">
<td></td> <td><a class="btn btn-sm btn-info" href="#/roles/{{ role.id }}/edit">{{ role.name }}</a></td>
<td><a class="pull-right" ng-click="loadMoreRoles()"><strong>More</strong></a></td> <td><span class="text-muted">{{ role.description }}</span></td>
</tr> <td>
</table> <button type="button" ng-click="user.removeRole($index)" class="btn btn-danger btn-sm pull-right">Remove
</div> </button>
</div> </td>
</form> </tr>
<div class="modal-footer"> <tr>
<button ng-click="save(user)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save</button> <td></td>
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <td></td>
</div> <td><a class="pull-right" ng-click="loadMoreRoles()"><strong>More</strong></a></td>
</div> </tr>
</table>
</div>
</div>
</form>
<div class="modal-footer">
<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>
</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 () {