diff --git a/static/js/app/app.js b/static/js/app/app.js index 9b4f1f01..95d4e302 100644 --- a/static/js/app/app.js +++ b/static/js/app/app.js @@ -52,7 +52,6 @@ app.directive('contenteditable', function() { element.on('blur keyup change', function() { scope.$apply(read); }); - read(); // initialize // Write data to the model function read() { diff --git a/static/js/app/controllers.js b/static/js/app/controllers.js index 4c47f630..ed3535ce 100644 --- a/static/js/app/controllers.js +++ b/static/js/app/controllers.js @@ -156,7 +156,7 @@ app.controller('CampaignResultsCtrl', function($scope, CampaignService, GroupSer } }); -app.controller('GroupCtrl', function($scope, GroupService, ngTableParams) { +app.controller('GroupCtrl', function($scope, $modal, GroupService, ngTableParams) { $scope.mainTableParams = new ngTableParams({ page: 1, // show first page count: 10, // count per page @@ -201,6 +201,12 @@ app.controller('GroupCtrl', function($scope, GroupService, ngTableParams) { $scope.group = group; $scope.editGroupTableParams.reload() } + $scope.newTarget = {}; + var modalInstance = $modal.open({ + templateUrl: '/js/app/partials/modals/userModal.html', + controller: GroupModalCtrl, + scope: $scope + }); }; $scope.addTarget = function() { @@ -244,6 +250,12 @@ app.controller('GroupCtrl', function($scope, GroupService, ngTableParams) { } }) +var GroupModalCtrl = function($scope, $modalInstance) { + $scope.cancel = function() { + $modalInstance.dismiss('cancel'); + }; +} + app.controller('TemplateCtrl', function($scope, $modal, TemplateService, ngTableParams) { $scope.mainTableParams = new ngTableParams({ page: 1, // show first page @@ -317,12 +329,13 @@ app.controller('TemplateCtrl', function($scope, $modal, TemplateService, ngTable }) var TemplateModalCtrl = function($scope, $modalInstance) { + console.log($scope.template) $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; }; -app.controller('SettingsCtrl', function($scope, $http) { +app.controller('SettingsCtrl', function($scope, $http, $window) { $scope.flashes = []; $scope.user = user; $scope.errorFlash = function(message) { @@ -356,7 +369,7 @@ app.controller('SettingsCtrl', function($scope, $http) { }) .success(function(data) { $scope.user.api_key = data; - user.api_key = data; + $window.user.api_key = data; $scope.successFlash("API Key Successfully Reset") }) } diff --git a/static/js/app/partials/modals/userModal.html b/static/js/app/partials/modals/userModal.html new file mode 100644 index 00000000..ccc41a64 --- /dev/null +++ b/static/js/app/partials/modals/userModal.html @@ -0,0 +1,43 @@ + + diff --git a/static/js/app/partials/templates.html b/static/js/app/partials/templates.html index 7628eaf3..2becd0d6 100644 --- a/static/js/app/partials/templates.html +++ b/static/js/app/partials/templates.html @@ -36,7 +36,7 @@ Toggle Dropdown