diff --git a/static/css/flat-ui.css b/static/css/flat-ui.css index e6cc6aea..067052bd 100644 --- a/static/css/flat-ui.css +++ b/static/css/flat-ui.css @@ -1175,7 +1175,7 @@ label { fieldset[disabled] .form-control { background-color: #f4f6f6; border-color: #d5dbdb; - color: #d5dbdb; + color: #555555; cursor: default; opacity: 0.7; filter: alpha(opacity=70); diff --git a/static/css/main.css b/static/css/main.css index 66028211..da6ade15 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -8,7 +8,8 @@ padding-bottom:0px; } #navbar-dropdown { - margin-top:8px; + margin-top:6px; + margin-right:15px; } .sans { font-family:'Open Sans', sans-serif !important; diff --git a/static/js/app/controllers.js b/static/js/app/controllers.js index a9f996de..310cd893 100644 --- a/static/js/app/controllers.js +++ b/static/js/app/controllers.js @@ -1,4 +1,4 @@ -app.controller('CampaignCtrl', function($scope, CampaignService, GroupService, TemplateService, ngTableParams, $http) { +app.controller('CampaignCtrl', function($scope, $modal, CampaignService, GroupService, TemplateService, ngTableParams, $http) { $scope.flashes = [] $scope.mainTableParams = new ngTableParams({ page: 1, // show first page @@ -25,12 +25,12 @@ app.controller('CampaignCtrl', function($scope, CampaignService, GroupService, T $scope.templates = templates; }) - $scope.addGroup = function() { - if ($scope.group.name != "") { + $scope.addGroup = function(group) { + if (group.name != "") { $scope.campaign.groups.push({ - name: $scope.group.name + name: group.name }); - $scope.group.name = "" + group.name = "" $scope.editGroupTableParams.reload() } }; @@ -45,6 +45,21 @@ app.controller('CampaignCtrl', function($scope, CampaignService, GroupService, T name: '', groups: [] }; + $scope.editCampaign($scope.campaign) + }; + + $scope.editCampaign = function(campaign){ + var modalInstance = $modal.open({ + templateUrl: '/js/app/partials/modals/campaignModal.html', + controller: CampaignModalCtrl, + scope: $scope + }); + + modalInstance.result.then(function(selectedItem) { + $scope.selected = selectedItem; + }, function() { + console.log('closed') + }); }; $scope.editGroupTableParams = new ngTableParams({ @@ -64,9 +79,6 @@ app.controller('CampaignCtrl', function($scope, CampaignService, GroupService, T $scope.saveCampaign = function(campaign) { $scope.flashes = [] $scope.validated = true - /*if (campaign.template.name == "") { - $scope.errorFlash("Must specify a template") - }*/ var newCampaign = new CampaignService(campaign); newCampaign.$save({}, function() { $scope.successFlash("Campaign added successfully") @@ -99,6 +111,8 @@ app.controller('CampaignCtrl', function($scope, CampaignService, GroupService, T } }); +var CampaignModalCtrl = function($scope, $modalInstance){}; + app.controller('CampaignResultsCtrl', function($scope, CampaignService, GroupService, ngTableParams, $http, $window) { id = $window.location.hash.split( '/' )[2]; $scope.flashes = [] @@ -212,7 +226,7 @@ app.controller('GroupCtrl', function($scope, GroupService, ngTableParams) { } }) -app.controller('TemplateCtrl', function($scope, TemplateService, ngTableParams) { +app.controller('TemplateCtrl', function($scope, $modal, TemplateService, ngTableParams) { $scope.mainTableParams = new ngTableParams({ page: 1, // show first page count: 10, // count per page @@ -243,6 +257,17 @@ app.controller('TemplateCtrl', function($scope, TemplateService, ngTableParams) $scope.newTemplate = false; $scope.template = template; } + var modalInstance = $modal.open({ + templateUrl: '/js/app/partials/modals/templateModal.html', + controller: TemplateModalCtrl, + scope: $scope + }); + + modalInstance.result.then(function(selectedItem) { + $scope.selected = selectedItem; + }, function() { + console.log('closed') + }); }; $scope.saveTemplate = function(template) { @@ -273,8 +298,20 @@ app.controller('TemplateCtrl', function($scope, TemplateService, ngTableParams) } }) +var TemplateModalCtrl = function($scope, $modalInstance){}; + app.controller('SettingsCtrl', function($scope, $http) { + $scope.flashes = []; $scope.user = user; + $scope.errorFlash = function(message) { + $scope.flashes = []; + $scope.flashes.push({"type" : "danger", "message" : message, "icon" : "fa-exclamation-circle"}) + } + + $scope.successFlash = function(message) { + $scope.flashes = []; + $scope.flashes.push({"type" : "success", "message" : message, "icon" : "fa-check-circle"}) + } $scope.form_data = { csrf_token : csrf_token } @@ -290,11 +327,4 @@ app.controller('SettingsCtrl', function($scope, $http) { $scope.successFlash("API Key Successfully Reset") }) } - $scope.errorFlash = function(message) { - $scope.flashes.push({"type" : "danger", "message" : message, "icon" : "fa-exclamation-circle"}) - } - - $scope.successFlash = function(message) { - $scope.flashes.push({"type" : "success", "message" : message, "icon" : "fa-check-circle"}) - } }) \ No newline at end of file diff --git a/static/js/app/partials/campaigns.html b/static/js/app/partials/campaigns.html index 4455253f..b5757cea 100644 --- a/static/js/app/partials/campaigns.html +++ b/static/js/app/partials/campaigns.html @@ -26,7 +26,7 @@
{{group.name}} + + + | +