Merge pull request #2011 from mabashian/survey-button-3.0

Move Add/Edit Survey button location
This commit is contained in:
Michael Abashian
2016-05-23 11:14:27 -04:00
4 changed files with 17 additions and 8 deletions

View File

@@ -494,7 +494,6 @@ input[type='radio']:checked:before {
.Form-surveyButton { .Form-surveyButton {
background-color: @default-link; background-color: @default-link;
margin-right: 20px;
color: @default-bg; color: @default-bg;
text-transform: uppercase; text-transform: uppercase;
padding-left:15px; padding-left:15px;

View File

@@ -309,17 +309,18 @@ export default
dataPlacement: 'right', dataPlacement: 'right',
dataTitle: "Host Config Key", dataTitle: "Host Config Key",
dataContainer: "body" dataContainer: "body"
},
survey: {
type: 'custom',
column: 2,
ngHide: "job_type.value === 'scan'" ,
control: '<button type="button" class="btn btn-sm Form-surveyButton" id="job_templates_create_survey_btn" ng-show="!survey_exists" ng-click="addSurvey()">ADD SURVEY</button>'+
'<button type="button" class="btn btn-sm Form-surveyButton" id="job_templates_edit_survey_btn" ng-show="survey_exists" ng-click="editSurvey()">EDIT SURVEY</button>'
} }
}, },
buttons: { //for now always generates <button> tags buttons: { //for now always generates <button> tags
add_survey: {
ngClick: 'addSurvey()',
ngShow: 'job_type.value !== "scan" && !survey_exists'
},
edit_survey: {
ngClick: 'editSurvey()',
ngShow: 'job_type.value !== "scan" && survey_exists'
},
cancel: { cancel: {
ngClick: 'formCancel()' ngClick: 'formCancel()'
}, },

View File

@@ -102,6 +102,7 @@
text-transform: uppercase; text-transform: uppercase;
padding-left:15px; padding-left:15px;
padding-right: 15px; padding-right: 15px;
margin-right: 20px;
} }
.SurveyMaker-deleteButton:hover { .SurveyMaker-deleteButton:hover {
background-color: @default-err-hov; background-color: @default-err-hov;

View File

@@ -1675,6 +1675,14 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
button.label = 'Launch'; button.label = 'Launch';
button['class'] = 'btn-primary'; button['class'] = 'btn-primary';
} }
if (btn === 'add_survey') {
button.label = 'Add Survey';
button['class'] = 'Form-surveyButton';
}
if (btn === 'edit_survey') {
button.label = 'Edit Survey';
button['class'] = 'Form-surveyButton';
}
// Build button HTML // Build button HTML
html += "<button type=\"button\" "; html += "<button type=\"button\" ";