diff --git a/lemur/static/app/angular/domains/domain/domain.js b/lemur/static/app/angular/domains/domain/domain.js new file mode 100644 index 00000000..84ddab90 --- /dev/null +++ b/lemur/static/app/angular/domains/domain/domain.js @@ -0,0 +1,33 @@ +'use strict'; + +angular.module('lemur') + + .controller('DomainsCreateController', function ($scope, $modalInstance, PluginService, DomainService, LemurRestangular){ + $scope.domain = LemurRestangular.restangularizeElement(null, {}, 'domains'); + + $scope.save = function (domain) { + DomainService.create(domain).then(function () { + $modalInstance.close(); + }); + }; + + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; + }) + + .controller('DomainsEditController', function ($scope, $modalInstance, DomainService, DomainApi, editId) { + DomainApi.get(editId).then(function (domain) { + $scope.domain = domain; + }); + + $scope.save = function (domain) { + DomainService.update(domain).then(function () { + $modalInstance.close(); + }); + }; + + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; + }); diff --git a/lemur/static/app/angular/domains/domain/domain.tpl.html b/lemur/static/app/angular/domains/domain/domain.tpl.html new file mode 100644 index 00000000..120c8bf8 --- /dev/null +++ b/lemur/static/app/angular/domains/domain/domain.tpl.html @@ -0,0 +1,31 @@ +