From 8e1b7c0036a3bd9b7d778e1f495ceed60a17cded Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 25 Apr 2016 16:13:33 -0700 Subject: [PATCH] Removing validation because regex is hard --- .../app/angular/domains/domain/domain.js | 33 +++++++++++++++++++ .../angular/domains/domain/domain.tpl.html | 31 +++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 lemur/static/app/angular/domains/domain/domain.js create mode 100644 lemur/static/app/angular/domains/domain/domain.tpl.html 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 @@ + + + +