Merge pull request #95 from jaredevantabor/more-translations

marking job results and survey maker for translation
This commit is contained in:
Jared Tabor 2017-07-28 10:13:28 -07:00 committed by GitHub
commit d44608de30
7 changed files with 134 additions and 139 deletions

View File

@ -40,11 +40,11 @@
<span class="JobResultsStdOut-lineExpander"> </span>
</div>
<div class="JobResultsStdOut-stdoutColumn JobResultsStdOut-stdoutColumn--tooMany"
ng-show="tooManyEvents">The standard output is too large to display. Please specify additional filters to narrow the standard out.</div>
ng-show="tooManyEvents" translate>The standard output is too large to display. Please specify additional filters to narrow the standard out.</div>
<div class="JobResultsStdOut-stdoutColumn JobResultsStdOut-stdoutColumn--tooMany"
ng-show="tooManyPastEvents">Too much previous output to display. Showing running standard output.</div>
ng-show="tooManyPastEvents" translate>Too much previous output to display. Showing running standard output.</div>
<div class="JobResultsStdOut-stdoutColumn JobResultsStdOut-stdoutColumn--tooMany"
ng-show="showLegacyJobErrorMessage">Job details are not available for this job. Please download to view standard out.</div>
ng-show="showLegacyJobErrorMessage" translate>Job details are not available for this job. Please download to view standard out.</div>
</div>
<!-- next is 1 is a hack to get the first line to be put in the pane in the
right place -->
@ -58,8 +58,8 @@
ng-show="stdoutOverflowed">
<div class="JobResultsStdOut-toTop--numberColumn">
</div>
<span ng-click="toTop()">^ TOP</span>
<span ng-click="toTop()">^ <span translate>TOP</span></span>
</div>
<div class="JobResultsStdOut-footerNumberColumn"></div>
</div>
</div>
</div>

View File

@ -264,9 +264,9 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
// button will jump to the bottom of the standard out pane,
// not follow lines as they come in
if ($scope.jobFinished) {
$scope.followTooltip = "Jump to last line of standard out.";
$scope.followTooltip = i18n._("Jump to last line of standard out.");
} else {
$scope.followTooltip = "Currently following standard out as it comes in. Click to unfollow.";
$scope.followTooltip = i18n._("Currently following standard out as it comes in. Click to unfollow.");
}
$scope.events = {};
@ -316,7 +316,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
if (change === 'finishedTime' && !$scope.job.finished) {
$scope.job.finished = mungedEvent.finishedTime;
$scope.jobFinished = true;
$scope.followTooltip = "Jump to last line of standard out.";
$scope.followTooltip = i18n._("Jump to last line of standard out.");
if ($scope.followEngaged) {
if (!$scope.followScroll) {
$scope.followScroll = function() {

View File

@ -14,7 +14,7 @@
<!-- LEFT PANE HEADER -->
<div class="JobResults-panelHeader">
<div
class="JobResults-panelHeaderText">
class="JobResults-panelHeaderText" translate>
DETAILS
</div>
@ -26,7 +26,7 @@
data-placement="top"
mode="all"
ng-click="relaunchJob()"
aw-tool-tip="Relaunch using the same parameters"
aw-tool-tip="{{'Relaunch using the same parameters' | translate}}"
data-original-title=""
title="">
<i class="icon-launch"></i>
@ -39,7 +39,7 @@
ng-click="cancelJob()"
ng-show="job_status == 'running' ||
job_status=='pending' "
aw-tool-tip="Cancel"
aw-tool-tip="{{'Cancel' | translate}}"
data-original-title="" title="">
<i class="fa fa-minus-circle"></i>
</button>
@ -51,7 +51,7 @@
ng-click="deleteJob()"
ng-hide="job_status == 'running' ||
job_status == 'pending' || !job.summary_fields.user_capabilities.delete"
aw-tool-tip="Delete"
aw-tool-tip="{{'Delete' | translate}}"
data-original-title=""
title="">
<i class="fa fa-trash-o"></i>
@ -64,21 +64,21 @@
<!-- STATUS DETAIL -->
<div class="JobResults-resultRow">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Status
</label>
<div class="JobResults-resultRowText">
<i class="JobResults-statusResultIcon
fa
icon-job-{{ job_status }}">
</i> {{ status_label }}
</i> {{ status_label | translate }}
</div>
</div>
<!-- START TIME DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.started">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Started
</label>
<div class="JobResults-resultRowText">
@ -89,7 +89,7 @@
<!-- FINISHED TIME DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.started">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Finished
</label>
<div class="JobResults-resultRowText">
@ -101,7 +101,7 @@
<!-- EXPLANATION DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.job_explanation">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Explanation
</label>
<div class="JobResults-resultRowText"
@ -109,7 +109,7 @@
{{job.job_explanation}}
</div>
<div class="jobResult-resultRowText "
ng-show="previousTaskFailed">Previous Task Failed
ng-show="previousTaskFailed" translate>Previous Task Failed
<a
href=""
id="explanation_help"
@ -128,7 +128,7 @@
<!-- RESULTS TRACEBACK DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.result_traceback && !previousTaskFailed">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Results Traceback
</label>
<div class="JobResults-resultRowText"
@ -140,17 +140,17 @@
<!-- TEMPLATE DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.summary_fields.job_template.name">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Template
</label>
<div class="JobResults-resultRowText">
<a href="{{ job_template_link }}"
aw-tool-tip="Edit the job template"
aw-tool-tip="{{'Edit the job template' | translate}}"
data-placement="top">
{{ job.summary_fields.job_template.name }}
</a>
<a href="{{ workflow_result_link }}"
aw-tool-tip="View workflow results"
aw-tool-tip="{{'View workflow results' | translate}}"
data-placement="top"
data-original-title="" title="">
<i class="WorkflowBadge"
@ -164,7 +164,7 @@
<!-- JOB TYPE DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.job_type">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Job Type
</label>
<div class="JobResults-resultRowText">
@ -175,12 +175,12 @@
<!-- CREATED BY DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.summary_fields.created_by.username">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Launched By
</label>
<div class="JobResults-resultRowText">
<a href="{{ created_by_link }}"
aw-tool-tip="Edit the User"
aw-tool-tip="{{'Edit the User' | translate}}"
data-placement="top">
{{ job.summary_fields.created_by.username }}
</a>
@ -191,12 +191,12 @@
<div class="JobResults-resultRow toggle-show"
ng-show="job.summary_fields.schedule.name">
<label
class="JobResults-resultRowLabel">
class="JobResults-resultRowLabel" translate>
Launched By
</label>
<div class="JobResults-resultRowText">
<a href="{{ scheduled_by_link }}"
aw-tool-tip="Edit the Schedule"
aw-tool-tip="{{'Edit the Schedule' | translate}}"
data-placement="top">
{{ job.summary_fields.schedule.name }}
</a>
@ -206,12 +206,12 @@
<!-- INVENTORY DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.summary_fields.inventory.name">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Inventory
</label>
<div class="JobResults-resultRowText">
<a href="{{ inventory_link }}"
aw-tool-tip="Edit the inventory"
aw-tool-tip="{{'Edit the inventory' | translate}}"
data-placement="top">
{{ job.summary_fields.inventory.name }}
</a>
@ -221,20 +221,20 @@
<!-- PROJECT DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.summary_fields.project.name">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Project
</label>
<div class="JobResults-resultRowText">
<a href="{{ project_update_link }}"
ng-hide="job.summary_fields.project.scm_type==='' || !project_status"
aw-tool-tip="View project sync results"
aw-tool-tip="{{'View project sync results' | translate}}"
data-placement="top">
<i class="JobResults-statusResultIcon
fa icon-job-{{ project_status }}">
</i>
</a>
<a href="{{ project_link }}"
aw-tool-tip="Edit the project"
aw-tool-tip="{{'Edit the project' | translate}}"
data-placement="top">
{{ job.summary_fields.project.name }}
</a>
@ -244,7 +244,7 @@
<!-- REVISION DETAIL -->
<div class="JobResults-resultRow"
ng-if="job.scm_revision">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Revision
</label>
<at-truncate string="{{job.scm_revision}}" maxLength="7" class="JobResults-resultRowText">
@ -254,7 +254,7 @@
<!-- PLAYBOOK DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.playbook">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Playbook
</label>
<div class="JobResults-resultRowText">
@ -265,12 +265,12 @@
<!-- MACHINE CREDENTIAL DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.summary_fields.credential.name">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Machine Credential
</label>
<div class="JobResults-resultRowText">
<a href="{{ machine_credential_link }}"
aw-tool-tip="Edit the credential"
aw-tool-tip="{{'Edit the credential' | translate}}"
data-placement="top">
{{ job.summary_fields.credential.name }}
</a>
@ -280,12 +280,12 @@
<!-- EXTRA CREDENTIALS DETAIL -->
<div class="JobResults-resultRow"
ng-show="jobExtraCredentials.length > 0">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Extra Credentials
</label>
<div class="JobResults-resultRowText">
<span ng-repeat="extraCredential in jobExtraCredentials">
<a ui-sref="credentials.edit({credential_id: extraCredential.id})" aw-tool-tip="Edit the credential" data-placement="top">
<a ui-sref="credentials.edit({credential_id: extraCredential.id})" aw-tool-tip="{{'Edit the credential' | translate}}" data-placement="top">
{{ extraCredential.name }}
</a>
{{$last ? '' : ', '}}
@ -296,12 +296,12 @@
<!-- CLOUD CREDENTIAL DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.summary_fields.cloud_credential.name">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Cloud Credential
</label>
<div class="JobResults-resultRowText">
<a href="{{ cloud_credential_link }}"
aw-tool-tip="Edit the credential"
aw-tool-tip="{{'Edit the credential' | translate}}"
data-placement="top">
{{ job.summary_fields.cloud_credential.name }}
</a>
@ -311,12 +311,12 @@
<!-- NETWORK CREDENTAIL DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.summary_fields.network_credential.name">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Network Credential
</label>
<div class="JobResults-resultRowText">
<a href="{{ network_credential_link }}"
aw-tool-tip="Edit the credential"
aw-tool-tip="{{'Edit the credential' | translate}}"
data-placement="top">
{{ job.summary_fields.network_credential.name }}
</a>
@ -326,12 +326,12 @@
<!-- VAULT CREDENTAIL DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.summary_fields.vault_credential.name">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Vault Credential
</label>
<div class="JobResults-resultRowText">
<a href="{{ vault_credential_link }}"
aw-tool-tip="Edit the credential"
aw-tool-tip="{{'Edit the credential' | translate}}"
data-placement="top">
{{ job.summary_fields.vault_credential.name }}
</a>
@ -341,7 +341,7 @@
<!-- FORKS DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.forks !== undefined">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Forks
</label>
<div class="JobResults-resultRowText">
@ -352,7 +352,7 @@
<!-- LIMIT DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.limit">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Limit
</label>
<div class="JobResults-resultRowText">
@ -363,7 +363,7 @@
<!-- VERBOSITY DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.verbosity !== undefined">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Verbosity
</label>
<div class="JobResults-resultRowText">
@ -374,7 +374,7 @@
<!-- IG DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.instance_group">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Instance Group
</label>
<div class="JobResults-resultRowText JobResults-resultRowText--instanceGroup">
@ -389,7 +389,7 @@
<!-- TAGS DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.job_tags">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Job Tags
</label>
<div class="JobResults-resultRowText">
@ -400,7 +400,7 @@
<!-- SKIP TAGS DETAIL -->
<div class="JobResults-resultRow"
ng-show="job.skip_tags">
<label class="JobResults-resultRowLabel">
<label class="JobResults-resultRowLabel" translate>
Skip Tags
</label>
<div class="JobResults-resultRowText">
@ -414,9 +414,9 @@
ng-show="variables">
<label class="JobResults-resultRowLabel
JobResults-resultRowLabel--fullWidth">
Extra Variables
<span translate> Extra Variables </span>
<i class="JobResults-extraVarsHelp fa fa-question-circle"
aw-tool-tip="Read only view of extra variables added to the job template."
aw-tool-tip="{{'Read only view of extra variables added to the job template.' | translate}}"
data-placement="top">
</i>
</label>
@ -439,7 +439,7 @@
ng-show="lessLabels"
href=""
ng-click="toggleLessLabels()">
Labels
<span translate>Labels</span>
<i class="JobResults-expandArrow
fa fa-caret-right"></i>
</a>
@ -448,7 +448,7 @@
ng-show="!lessLabels"
href=""
ng-click="toggleLessLabels()">
Labels
<span translate>Labels</span>
<i class="JobResults-expandArrow
fa fa-caret-down"></i>
</a>
@ -493,7 +493,7 @@
<!-- HEADER COUNTS -->
<div class="JobResults-badgeRow">
<!-- PLAYS COUNT -->
<div class="JobResults-badgeTitle">
<div class="JobResults-badgeTitle" translate>
Plays
</div>
<span class="badge List-titleBadge">
@ -501,7 +501,7 @@
</span>
<!-- TASKS COUNT -->
<div class="JobResults-badgeTitle">
<div class="JobResults-badgeTitle" translate>
Tasks
</div>
<span class="badge List-titleBadge">
@ -509,7 +509,7 @@
</span>
<!-- HOSTS COUNT -->
<div class="JobResults-badgeTitle">
<div class="JobResults-badgeTitle" translate>
Hosts
</div>
<span class="badge List-titleBadge"
@ -518,14 +518,14 @@
</span>
<span class="badge List-titleBadge"
aw-tool-tip="The host count will update when the job is complete."
aw-tool-tip="{{'The host count will update when the job is complete.' | translate}}"
data-placement="top"
ng-if="!jobFinished">
<i class="fa fa-ellipsis-h"></i>
</span>
<!-- ELAPSED TIME -->
<div class="JobResults-badgeTitle">
<div class="JobResults-badgeTitle" translate>
Elapsed
</div>
<span class="badge List-titleBadge">

View File

@ -4,7 +4,7 @@
* All Rights Reserved
*************************************************/
export default ['$log', 'moment', function($log, moment){
export default ['$log', 'moment', 'i18n', function($log, moment, i18n){
var val = {
// parses stdout string from api and formats various codes to the
// correct dom structure
@ -77,7 +77,7 @@ export default ['$log', 'moment', function($log, moment){
return `"`;
}
else{
return ` JobResultsStdOut-stdoutColumn--clickable" ui-sref="jobResult.host-event.json({eventId: ${event.id}, taskUuid: '${event.event_data.task_uuid}' })" aw-tool-tip="Event ID: ${event.id} <br>Status: ${event.event_display} <br>Click for details" data-placement="top"`;
return ` JobResultsStdOut-stdoutColumn--clickable" ui-sref="jobResult.host-event.json({eventId: ${event.id}, taskUuid: '${event.event_data.task_uuid}' })" aw-tool-tip="${i18n._("Event ID")}: ${event.id} <br>${i18n._("Status")}: ${event.event_display} <br>${i18n._("Click for details")}" data-placement="top"`;
}
},

View File

@ -21,7 +21,7 @@
</div>
<div class="SurveyMaker-header">
<div class="SurveyMaker-title">
<div class="SurveyMaker-titleText">{{name || "New Job Template"}}<div class="SurveyMaker-titleLockup"></div>SURVEY</div>
<div class="SurveyMaker-titleText">{{name || "New Job Template"}}<div class="SurveyMaker-titleLockup"></div><span translate>SURVEY</span></div>
<div class="ScheduleToggle" ng-class="{'is-on': survey_enabled}" aw-tool-tip="surveyEnabledTooltip" data-container="#survey-modal-dialog" data-placement="right" data-tip-watch="surveyEnabledTooltip">
<button ng-show="survey_enabled" class="ScheduleToggle-switch is-on" ng-click="toggleSurveyEnabled()" translate>ON</button>
<button ng-show="!survey_enabled" class="ScheduleToggle-switch" ng-click="toggleSurveyEnabled()" translate>OFF</button>

View File

@ -2,4 +2,4 @@ import form from './question-definition.form';
export default
angular.module('jobTemplates.surveyMaker.shared', [])
.value('questionDefinitionForm', form);
.factory('questionDefinitionForm', form);

View File

@ -10,11 +10,11 @@
* @description This form is for adding a question
*/
export default
{
export default ['i18n', function(i18n){
return {
addTitle: 'ADD SURVEY PROMPT',
editTitle: 'EDIT SURVEY PROMPT',
addTitle: i18n._('ADD SURVEY PROMPT'),
editTitle: i18n._('EDIT SURVEY PROMPT'),
titleClass: 'Form-secondaryTitle',
base: 'survey_question',
name: 'survey_question',
@ -24,7 +24,7 @@ export default
fields: {
question_name: {
realName: 'question_text',
label: 'Prompt',
label: i18n._('Prompt'),
type: 'text',
required: true,
column: 1,
@ -33,36 +33,33 @@ export default
},
question_description: {
realName: 'question_description',
label: 'Description',
label: i18n._('Description'),
type: 'text',
column: 1,
class: 'Form-formGroup--singleColumn'
},
variable: {
realName: 'variable',
type: 'custom',
control:'<label class="prepend-asterisk" for="variable"><span class="Form-inputLabel"> ANSWER VARIABLE NAME</span>'+
control:'<label class="prepend-asterisk" for="variable"><span class="Form-inputLabel" translate> ANSWER VARIABLE NAME</span>'+
'<a id="awp-variable" href="" aw-pop-over="<p>The suggested format for variable names is lowercase and underscore-separated. Also note that this field cannot accept variable names with spaces.</p><p>For example: <br>foo_bar<br>'+
'user_id<br>host_name<br><div class=&quot;popover-footer&quot;><span class=&quot;key&quot;>esc</span> or click to close</div>" '+
'data-placement="right" data-container="body" popover-title="Answer Variable Name" class="help-link" data-original-title="" title="" tabindex="-1"><i class="fa fa-question-circle"></i></a> </label>'+
'<div><input type="text" ng-model="variable" name="variable" id="survey_question_variable" class="form-control Form-textInput ng-pristine ng-invalid ng-invalid-required" required="" aw-survey-variable-name>'+
'<div class="error ng-hide" id="survey_question-variable-required-error" ng-show="survey_question_form.variable.$dirty && survey_question_form.variable.$error.required">Please enter an answer variable name.</div>'+
'<div class="error ng-hide" id="survey_question-variable-variable-error" ng-show="survey_question_form.variable.$dirty && survey_question_form.variable.$error.variable">Please remove the illegal character from the survey question variable name.</div>'+
'<div class="error ng-hide" id="survey_question-variable-duplicate-error" ng-show="duplicate">This question variable is already in use. Please enter a different variable name.</div>' +
'<div class="error ng-hide" id="survey_question-variable-required-error" ng-show="survey_question_form.variable.$dirty && survey_question_form.variable.$error.required" translate>Please enter an answer variable name.</div>'+
'<div class="error ng-hide" id="survey_question-variable-variable-error" ng-show="survey_question_form.variable.$dirty && survey_question_form.variable.$error.variable" translate>Please remove the illegal character from the survey question variable name.</div>'+
'<div class="error ng-hide" id="survey_question-variable-duplicate-error" ng-show="duplicate" translate>This question variable is already in use. Please enter a different variable name.</div>' +
'<div class="error api-error ng-binding" id="survey_question-variable-api-error" ng-bind="variable_api_error"></div>'+
'</div>',
required: true,
column: 1,
class: 'Form-formGroup--singleColumn'
},
type: {
realName: 'answer_type',
label: 'Answer Type',
label: i18n._('Answer Type'),
type: 'select',
defaultText: 'Choose an answer type',
defaultText: i18n._('Choose an answer type'),
ngOptions: 'answer_types.name for answer_types in answer_types track by answer_types.type',
required: true,
@ -72,7 +69,7 @@ export default
},
choices: {
realName: 'answer_options',
label: 'Multiple Choice Options',
label: i18n._('Multiple Choice Options'),
type: 'textarea',
rows: 3,
required: true,
@ -82,7 +79,7 @@ export default
awPopOver: '<p>Type an option on each line.</p>'+
'<p>For example the following input:<br><br>Apple<br>\n Banana<br>\n Cherry<br><br>would be displayed as:</p>\n'+
'<ol><li>Apple</li><li>Banana</li><li>Cherry</li></ol>',
dataTitle: 'Multiple Choice Options',
dataTitle: i18n._('Multiple Choice Options'),
dataPlacement: 'right',
dataContainer: "body",
column: 2,
@ -93,20 +90,19 @@ export default
type: 'custom',
control:'<div class="row">'+
'<div class="col-xs-6">'+
'<label for="text_min"><span class="Form-inputLabel">Minimum Length</span></label><input id="text_min" name="text_min" ng-model="text_min" min=0 aw-min="0" aw-max="text_max" aw-spinner="text_min" integer>'+
'<div class="error" ng-show="survey_question_form.text_min.$error.integer || survey_question_form.text_min.$error.number">The minimum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.text_min.$error.awMax">The minimium length is too high. Please enter a lower number.</div>'+
'<div class="error" ng-show="survey_question_form.text_min.$error.awMin">The minimum length is too low. Please enter a positive number.</div>'+
'<label for="text_min"><span class="Form-inputLabel" translate>Minimum Length</span></label><input id="text_min" name="text_min" ng-model="text_min" min=0 aw-min="0" aw-max="text_max" aw-spinner="text_min" integer>'+
'<div class="error" ng-show="survey_question_form.text_min.$error.integer || survey_question_form.text_min.$error.number" translate>The minimum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.text_min.$error.awMax" translate>The minimium length is too high. Please enter a lower number.</div>'+
'<div class="error" ng-show="survey_question_form.text_min.$error.awMin" translate>The minimum length is too low. Please enter a positive number.</div>'+
'</div>'+
'<div class="col-xs-6">'+
'<label for="text_max"><span class="Form-inputLabel">Maximum Length</span></label><input id="text_max" name="text_max" ng-model="text_max" aw-min="text_min || 0" min=0 aw-spinner="text_max" integer>'+
'<div class="error" ng-show="survey_question_form.text_max.$error.integer || survey_question_form.text_max.$error.number">The maximum length you entered is not a valid number. Please enter a whole nnumber.</div>'+
'<div class="error" ng-show="survey_question_form.text_max.$error.awMin">The maximum length is too low. Please enter a number larger than the minimum length you set.</div>'+
'<label for="text_max"><span class="Form-inputLabel" translate>Maximum Length</span></label><input id="text_max" name="text_max" ng-model="text_max" aw-min="text_min || 0" min=0 aw-spinner="text_max" integer>'+
'<div class="error" ng-show="survey_question_form.text_max.$error.integer || survey_question_form.text_max.$error.number" translate>The maximum length you entered is not a valid number. Please enter a whole nnumber.</div>'+
'<div class="error" ng-show="survey_question_form.text_max.$error.awMin" translate>The maximum length is too low. Please enter a number larger than the minimum length you set.</div>'+
'</div>'+
'</div>',
ngShow: 'type.type==="text" ',
required: true,
column: 2,
class: 'Form-formGroup--singleColumn'
},
@ -115,20 +111,19 @@ export default
type: 'custom',
control:'<div class="row">'+
'<div class="col-xs-6">'+
'<label for="textarea_min"><span class="Form-inputLabel">Minimum Length</span></label><input id="textarea_min" type="number" name="textarea_min" ng-model="textarea_min" min=0 aw-min="0" aw-max="textarea_max" class="form-control Form-textInput" integer />'+
'<div class="error" ng-show="survey_question_form.textarea_min.$error.integer || survey_question_form.textarea_min.$error.number">The minimum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.textarea_min.$error.awMax">The minimium length is too high. Please enter a lower number.</div>'+
'<div class="error" ng-show="survey_question_form.textarea_min.$error.awMin">The minimum length is too low. Please enter a positive number.</div>'+
'<label for="textarea_min"><span class="Form-inputLabel" translate>Minimum Length</span></label><input id="textarea_min" type="number" name="textarea_min" ng-model="textarea_min" min=0 aw-min="0" aw-max="textarea_max" class="form-control Form-textInput" integer />'+
'<div class="error" ng-show="survey_question_form.textarea_min.$error.integer || survey_question_form.textarea_min.$error.number" translate>The minimum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.textarea_min.$error.awMax" translate>The minimium length is too high. Please enter a lower number.</div>'+
'<div class="error" ng-show="survey_question_form.textarea_min.$error.awMin" translate>The minimum length is too low. Please enter a positive number.</div>'+
'</div>'+
'<div class="col-xs-6">'+
'<label for="textarea_max"><span class="Form-inputLabel">Maximum Length</span></label><input id="textarea_max" type="number" name="textarea_max" ng-model="textarea_max" aw-min="textarea_min || 0" min=0 class="form-control Form-textInput" integer >'+
'<div class="error" ng-show="survey_question_form.textarea_max.$error.integer || survey_question_form.textarea_max.$error.number">The maximum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.textarea_max.$error.awMin">The maximum length is too low. Please enter a number larger than the minimum length you set.</div>'+
'<label for="textarea_max"><span class="Form-inputLabel" translate>Maximum Length</span></label><input id="textarea_max" type="number" name="textarea_max" ng-model="textarea_max" aw-min="textarea_min || 0" min=0 class="form-control Form-textInput" integer >'+
'<div class="error" ng-show="survey_question_form.textarea_max.$error.integer || survey_question_form.textarea_max.$error.number" translate>The maximum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.textarea_max.$error.awMin" translate>The maximum length is too low. Please enter a number larger than the minimum length you set.</div>'+
'</div>'+
'</div>',
ngShow: 'type.type==="textarea" ',
required: true,
column: 2,
class: 'Form-formGroup--singleColumn'
},
@ -137,15 +132,15 @@ export default
type: 'custom',
control:'<div class="row">'+
'<div class="col-xs-6">'+
'<label for="password_min"><span class="Form-inputLabel">Minimum Length</span></label><input id="password_min" type="number" name="password_min" ng-model="password_min" min=0 aw-min="0" aw-max="password_max" class="form-control Form-textInput" integer />'+
'<div class="error" ng-show="survey_question_form.password_min.$error.integer || survey_question_form.password_min.$error.number">The minimum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.password_min.$error.awMax">The minimium length is too high. Please enter a lower number.</div>'+
'<div class="error" ng-show="survey_question_form.password_min.$error.awMin">The minimum length is too low. Please enter a positive number.</div>'+
'<label for="password_min"><span class="Form-inputLabel" translate>Minimum Length</span></label><input id="password_min" type="number" name="password_min" ng-model="password_min" min=0 aw-min="0" aw-max="password_max" class="form-control Form-textInput" integer />'+
'<div class="error" ng-show="survey_question_form.password_min.$error.integer || survey_question_form.password_min.$error.number" translate>The minimum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.password_min.$error.awMax" translate>The minimium length is too high. Please enter a lower number.</div>'+
'<div class="error" ng-show="survey_question_form.password_min.$error.awMin" translate>The minimum length is too low. Please enter a positive number.</div>'+
'</div>'+
'<div class="col-xs-6">'+
'<label for="password_max"><span class="Form-inputLabel">Maximum Length</span></label><input id="password_max" type="number" name="password_max" ng-model="password_max" aw-min="password_min || 0" min=0 class="form-control Form-textInput" integer >'+
'<div class="error" ng-show="survey_question_form.password_max.$error.integer || survey_question_form.password_max.$error.number">The maximum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.password_max.$error.awMin">The maximum length is too low. Please enter a number larger than the minimum length you set.</div>'+
'<label for="password_max"><span class="Form-inputLabel" translate>Maximum Length</span></label><input id="password_max" type="number" name="password_max" ng-model="password_max" aw-min="password_min || 0" min=0 class="form-control Form-textInput" integer >'+
'<div class="error" ng-show="survey_question_form.password_max.$error.integer || survey_question_form.password_max.$error.number" translate>The maximum length you entered is not a valid number. Please enter a whole number.</div>'+
'<div class="error" ng-show="survey_question_form.password_max.$error.awMin" translate>The maximum length is too low. Please enter a number larger than the minimum length you set.</div>'+
'</div>'+
'</div>',
ngShow: 'type.type==="password" ',
@ -159,14 +154,14 @@ export default
type: 'custom',
control:'<div class="row">'+
'<div class="col-xs-6">'+
'<label for="minimum"><span class="Form-inputLabel">Minimum</span></label><input id="int_min" type="number" name="int_min" ng-model="int_min" aw-max="int_max" class="form-control Form-textInput" integer >'+
'<div class="error" ng-show="survey_question_form.int_min.$error.integer || survey_question_form.int_min.$error.number">Please enter a valid integer.</div>'+
'<div class="error" ng-show="survey_question_form.int_min.$error.awMax">Please enter a smaller integer.</div>'+
'<label for="minimum"><span class="Form-inputLabel" translate>Minimum</span></label><input id="int_min" type="number" name="int_min" ng-model="int_min" aw-max="int_max" class="form-control Form-textInput" integer >'+
'<div class="error" ng-show="survey_question_form.int_min.$error.integer || survey_question_form.int_min.$error.number" translate>Please enter a valid integer.</div>'+
'<div class="error" ng-show="survey_question_form.int_min.$error.awMax" translate>Please enter a smaller integer.</div>'+
'</div>'+
'<div class="col-xs-6">'+
'<label for="minimum"><span class="Form-inputLabel">Maximum</span></label><input id="int_max" type="number" name="int_max" ng-model="int_max" aw-min="int_min" class="form-control Form-textInput" integer >'+
'<div class="error" ng-show="survey_question_form.int_max.$error.integer || survey_question_form.int_max.$error.number">Please enter a valid integer.</div>'+
'<div class="error" ng-show="survey_question_form.int_max.$error.awMin">Please enter a larger integer.</div>'+
'<label for="minimum"><span class="Form-inputLabel" translate>Maximum</span></label><input id="int_max" type="number" name="int_max" ng-model="int_max" aw-min="int_min" class="form-control Form-textInput" integer >'+
'<div class="error" ng-show="survey_question_form.int_max.$error.integer || survey_question_form.int_max.$error.number" translate>Please enter a valid integer.</div>'+
'<div class="error" ng-show="survey_question_form.int_max.$error.awMin" translate>Please enter a larger integer.</div>'+
'</div>'+
'</div>',
ngShow: 'type.type==="integer" ',
@ -179,14 +174,14 @@ export default
type: 'custom',
control: '<div class="row">'+
'<div class="col-xs-6">'+
'<label for="minimum"><span class="Form-inputLabel">Minimum</span></label><input id="float_min" type="number" name="float_min" ng-model="float_min" class="form-control Form-textInput" smart-float aw-max="float_max">'+
'<div class="error" ng-show="survey_question_form.float_min.$error.float || survey_question_form.float_min.$error.number">Please enter a valid float.</div>'+
'<div class="error" ng-show="survey_question_form.float_min.$error.awMax">Please enter a smaller float.</div>'+
'<label for="minimum"><span class="Form-inputLabel" translate>Minimum</span></label><input id="float_min" type="number" name="float_min" ng-model="float_min" class="form-control Form-textInput" smart-float aw-max="float_max">'+
'<div class="error" ng-show="survey_question_form.float_min.$error.float || survey_question_form.float_min.$error.number" translate>Please enter a valid float.</div>'+
'<div class="error" ng-show="survey_question_form.float_min.$error.awMax" translate>Please enter a smaller float.</div>'+
'</div>'+
'<div class="col-xs-6">'+
'<label for="maximum"><span class="Form-inputLabel">Maximum</span></label><input id="float_max" type="number" name="float_max" ng-model="float_max" class="form-control Form-textInput" smart-float aw-min="float_min">'+
'<div class="error" ng-show="survey_question_form.float_max.$error.float">Please enter a valid float.</div>'+
'<div class="error" ng-show="survey_question_form.float_max.$error.awMin">Please enter a larger float.</div>'+
'<label for="maximum"><span class="Form-inputLabel" translate>Maximum</span></label><input id="float_max" type="number" name="float_max" ng-model="float_max" class="form-control Form-textInput" smart-float aw-min="float_min">'+
'<div class="error" ng-show="survey_question_form.float_max.$error.float" translate>Please enter a valid float.</div>'+
'<div class="error" ng-show="survey_question_form.float_max.$error.awMin" translate>Please enter a larger float.</div>'+
'</div>'+
'</div>',
@ -199,12 +194,12 @@ export default
realName: 'default_answer',
type: 'custom' ,
control: '<div class="form-group" >'+
'<label for="default"><span class="Form-inputLabel">Default Answer</span></label>'+
'<label for="default"><span class="Form-inputLabel" translate>Default Answer</span></label>'+
'<div>'+
'<input type="text" ng-model="default" name="default" id="default" class="form-control Form-textInput">'+
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="invalidChoice">Please enter an answer from the choices listed.</div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="minTextError">The answer is shorter than the minimium length. Please make the answer longer. </div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="maxTextError">The answer is longer than the maximum length. Please make the answer shorter. </div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="invalidChoice" translate>Please enter an answer from the choices listed.</div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="minTextError" translate>The answer is shorter than the minimium length. Please make the answer longer. </div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="maxTextError" translate>The answer is longer than the maximum length. Please make the answer shorter. </div>' +
'<div class="error api-error ng-binding" id="survey_question-default-api-error" ng-bind="default_api_error"></div>'+
'</div>'+
'</div>',
@ -216,10 +211,10 @@ export default
realName: 'default_answer' ,
type: 'custom',
control: '<div class="form-group">'+
'<label for="default_multiselect"><span class="Form-inputLabel">Default Answer</span></label>'+
'<label for="default_multiselect"><span class="Form-inputLabel" translate>Default Answer</span></label>'+
'<div>'+
'<textarea rows="3" ng-model="default_multiselect" name="default_multiselect" class="form-control Form-textArea ng-pristine ng-valid" id="default_multiselect" aw-watch=""></textarea>'+
'<div class="error ng-hide" id="survey_question-default_multiselect-duplicate-error" ng-show="invalidChoice">Please enter an answer/answers from the choices listed.</div>' +
'<div class="error ng-hide" id="survey_question-default_multiselect-duplicate-error" ng-show="invalidChoice" translate>Please enter an answer/answers from the choices listed.</div>' +
'<div class="error api-error ng-binding" id="survey_question-default_multiselect-api-error" ng-bind="default_multiselect_api_error"></div>'+
'</div>'+
'</div>',
@ -231,11 +226,11 @@ export default
realName: 'default_answer',
type: 'custom',
control: '<div>'+
'<label for="default_int"><span class="Form-inputLabel">Default Answer</span></label>'+
'<label for="default_int"><span class="Form-inputLabel" translate>Default Answer</span></label>'+
'<input type="number" ng-model="default_int" name="default_int" aw-range range-min="int_min" range-max="int_max" class="form-control Form-textInput" integer />'+
'<div class="error" ng-show="survey_question_form.default_int.$error.number || survey_question_form.default_int.$error.integer">Please enter a valid integer.</div>'+
'<div class="error" ng-show="survey_question_form.default_int.$error.awRangeMin"> Please enter a minimum default of {{int_min}}.</div>'+
'<div class="error" ng-show="survey_question_form.default_int.$error.awRangeMax"> Please enter a maximum default of {{int_max}}.</div>'+
'<div class="error" ng-show="survey_question_form.default_int.$error.number || survey_question_form.default_int.$error.integer" translate>Please enter a valid integer.</div>'+
'<div class="error" ng-show="survey_question_form.default_int.$error.awRangeMin" translate> Please enter a minimum default of {{int_min}}.</div>'+
'<div class="error" ng-show="survey_question_form.default_int.$error.awRangeMax" translate> Please enter a maximum default of {{int_max}}.</div>'+
'</div>',
column: 2,
ngShow: 'type.type === "integer" ',
@ -245,11 +240,11 @@ export default
realName: 'default_answer',
type: 'custom',
control: '<div>'+
'<label for="default_float"><span class="Form-inputLabel">Default Answer</span></label>'+
'<label for="default_float"><span class="Form-inputLabel" translate>Default Answer</span></label>'+
'<input type="number" ng-model="default_float" name="default_float" aw-range range-min="float_min" range-max="float_max" class="form-control Form-textInput" />'+
'<div class="error" ng-show="survey_question_form.default_float.$error.number || survey_question_form.default_float.$error.float">Please enter a valid float.</div>'+
'<div class="error" ng-show="survey_question_form.default_float.$error.awRangeMin"> Please enter a minimum default of {{float_min}}.</div>'+
'<div class="error" ng-show="survey_question_form.default_float.$error.awRangeMax"> Please enter a maximum default of {{float_max}}.</div>'+
'<div class="error" ng-show="survey_question_form.default_float.$error.number || survey_question_form.default_float.$error.float" translate>Please enter a valid float.</div>'+
'<div class="error" ng-show="survey_question_form.default_float.$error.awRangeMin" translate> Please enter a minimum default of {{float_min}}.</div>'+
'<div class="error" ng-show="survey_question_form.default_float.$error.awRangeMax" translate> Please enter a maximum default of {{float_max}}.</div>'+
'</div>',
column: 2,
ngShow: 'type.type=== "float" ',
@ -259,11 +254,11 @@ export default
realName: "default_answer" ,
type: 'custom',
control: '<div class="form-group Form-formGroup Form-formGroup--singleColumn">'+
'<label for="default_textarea"><span class="Form-inputLabel">Default Answer</span></label>'+
'<label for="default_textarea"><span class="Form-inputLabel" translate>Default Answer</span></label>'+
'<div>'+
'<textarea rows="3" ng-model="default_textarea" name="default_textarea" class="form-control Form-textArea ng-valid ng-dirty" id="default_textarea"></textarea>'+
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="minTextError">The answer is shorter than the minimium length. Please make the answer longer. </div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="maxTextError">The answer is longer than the maximum length. Please make the answer shorter. </div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="minTextError" translate>The answer is shorter than the minimium length. Please make the answer longer. </div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="maxTextError" translate>The answer is longer than the maximum length. Please make the answer shorter. </div>' +
'<div class="error api-error ng-binding" id="survey_question-default_textarea-api-error" ng-bind="default_textarea_api_error"></div>'+
'</div>'+
'</div>',
@ -275,7 +270,7 @@ export default
realName: 'default_answer' ,
type: 'custom' ,
control: '<div class="form-group">'+
'<label for="default_password"><span class="Form-inputLabel">Default Answer</span></label>'+
'<label for="default_password"><span class="Form-inputLabel" translate>Default Answer</span></label>'+
'<div>'+
'<div class="input-group">'+
'<span class="input-group-btn">'+
@ -283,8 +278,8 @@ export default
'</span>'+
'<input id="default_password" type="password" ng-model="default_password" name="default_password" class="form-control Form-textInput" autocomplete="false">'+
'</div>'+
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="minTextError">The answer is shorter than the minimium length. Please make the answer longer. </div>' +
'<div class="error ng-hide" id="survey_question-default-password-duplicate-error" ng-show="maxTextError">The answer is longer than the maximum length. Please make the answer shorter. </div>' +
'<div class="error ng-hide" id="survey_question-default-duplicate-error" ng-show="minTextError" translate>The answer is shorter than the minimium length. Please make the answer longer. </div>' +
'<div class="error ng-hide" id="survey_question-default-password-duplicate-error" ng-show="maxTextError" translate>The answer is longer than the maximum length. Please make the answer shorter. </div>' +
'<div class="error api-error ng-binding" id="survey_question-default-password-api-error" ng-bind="default_api_error"></div>'+
'</div>'+
'</div>',
@ -294,7 +289,7 @@ export default
},
required: {
realName: 'required_answer',
label: 'Required',
label: i18n._('Required'),
type: 'checkbox',
column: 2,
class: 'Form-formGroup--singleColumn'
@ -302,7 +297,7 @@ export default
},
buttons: {
question_cancel : {
label: 'Clear',
label: i18n._('Clear'),
'class' : 'btn btn-default Form-cancelButton',
ngClick: 'generateAddQuestionForm()',
ngDisabled: 'survey_question_form.$pristine'
@ -314,5 +309,5 @@ export default
label: '{{editQuestionIndex === null ? "+ ADD" : "UPDATE"}}'
}
}
};
};
}];