added translations for email notification panel

This commit is contained in:
David Baldwynn 2017-10-30 11:41:34 -07:00
parent 3652b41fc8
commit 5451475636
8 changed files with 195 additions and 162 deletions

View file

@ -118,19 +118,17 @@ exports.listSubmissions = function(req, res) {
* Create a new form
*/
exports.create = function(req, res) {
debugger;
if(!req.body.form){
return res.status(401).send({
message: 'Invalid Input'
});
}
var form = new Form(req.body.form);
form.admin = req.user._id;
form.save(function(err) {
debugger;
if (err) {
return res.status(500).send({
message: errorHandler.getErrorMessage(err)

File diff suppressed because one or more lines are too long

View file

@ -18,6 +18,9 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
DISPLAY_END_PAGE: 'Display Custom End Page?',
ENABLE_EMAIL_NOTIFICATIONS: 'Enable Email Notifications',
EMAIL_NOTIFICATION_RECIPIENTS: 'Email Notification Recipients',
GENERAL_TAB: 'General',
SELF_NOTIFICATIONS_TAB: 'Self notifications',
RESPONDANT_NOTIFICATIONS_TAB: 'Respondent notifications',
//List Forms View
CREATE_A_NEW_FORM: 'Create a new form',

View file

@ -15,6 +15,11 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
CANCEL: 'Annuler',
DISPLAY_START_PAGE: "Afficher la page de démarrage?",
DISPLAY_END_PAGE: "Afficher la page de fin personnalisée?",
ENABLE_EMAIL_NOTIFICATIONS: 'Enable Email Notifications',
EMAIL_NOTIFICATION_RECIPIENTS: 'Email Notification Recipients',
GENERAL_TAB: 'General',
SELF_NOTIFICATIONS_TAB: 'Self notifications',
RESPONDANT_NOTIFICATIONS_TAB: 'Respondent notifications',
// Afficher les formulaires
CREATE_A_NEW_FORM: "Créer un nouveau formulaire",

View file

@ -15,6 +15,11 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
CANCEL: 'Abbrechen',
DISPLAY_START_PAGE: 'Startseite anzeigen?',
DISPLAY_END_PAGE: 'Benutzerdefinierte Endseite anzeigen?',
ENABLE_EMAIL_NOTIFICATIONS: 'E-Mail-Benachrichtigungen aktivieren',
EMAIL_NOTIFICATION_RECIPIENTS: 'E-Mail-Benachrichtigungsempfänger',
GENERAL_TAB: 'Allgemein',
SELF_NOTIFICATIONS_TAB: 'Selbstbenachrichtigungen',
RESPONDANT_NOTIFICATIONS_TAB: 'Beantwortungsbenachrichtigungen',
// Listenformularansicht
CREATE_A_NEW_FORM: 'Erstelle ein neues Formular',

View file

@ -15,6 +15,11 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
CANCEL: 'Annulla',
DISPLAY_START_PAGE: 'Visualizza pagina iniziale?',
DISPLAY_END_PAGE: 'Mostra pagina finale personalizzata?',
ENABLE_EMAIL_NOTIFICATIONS: 'Attiva notifiche e-mail',
EMAIL_NOTIFICATION_RECIPIENTS: 'Destinatari di notifica e-mail',
GENERAL_TAB: 'Generale',
SELF_NOTIFICATIONS_TAB: 'Autodiagnosi',
RESPONDANT_NOTIFICATIONS_TAB: 'Notifiche rispondenti',
// Visualizzazione dei moduli di elenco
CREATE_A_NEW_FORM: 'Crea un nuovo modulo',

View file

@ -16,6 +16,11 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
CANCEL: 'Cancelar',
DISPLAY_START_PAGE: '¿Mostrar página de inicio?',
DISPLAY_END_PAGE: '¿Mostrar paǵina de fin?',
ENABLE_EMAIL_NOTIFICATIONS: 'Habilitar notificaciones por correo electrónico',
EMAIL_NOTIFICATION_RECIPIENTS: 'Destinatarios de notificación de correo electrónico',
GENERAL_TAB: 'General',
SELF_NOTIFICATIONS_TAB: 'Auto notificaciones',
RESPONDANT_NOTIFICATIONS_TAB: 'Notificaciones de los demandados',
//List Forms View
CREATE_A_NEW_FORM: 'Crear formulario',

View file

@ -1,169 +1,181 @@
<div class="config-form container">
<!-- Settings -->
<div class="row">
<div class="col-sm-offset-2 col-sm-4">
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'FORM_NAME' | translate }}</h5>
</div>
<div class="col-sm-12">
<input class="form-control"
type="text"
ng-model="myform.title"
value="{{myform.title}}"
style="width: 100%;"
ng-minlength="4"
ng-pattern="/^[a-zA-Z0-9 \-.]*$/">
</div>
</div>
<uib-tabset active="activePill" vertical="true" type="pills">
<uib-tab index="0" heading="{{ 'GENERAL_TAB' | translate }}">
<!-- Settings -->
<div class="row">
<div class="col-sm-offset-2 col-sm-4">
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'FORM_NAME' | translate }}</h5>
</div>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'FORM_STATUS' | translate }}</h5>
</div>
<div class="col-sm-12">
<input class="form-control"
type="text"
ng-model="myform.title"
value="{{myform.title}}"
style="width: 100%;"
ng-minlength="4"
ng-pattern="/^[a-zA-Z0-9 \-.]*$/">
</div>
</div>
<div class="field-input col-sm-12">
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'FORM_STATUS' | translate }}</h5>
</div>
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.isLive" ng-required="true" style="background-color:#33CC00;"/>
&nbsp;<span>{{ 'PUBLIC' | translate }}</span>
</label>
<div class="field-input col-sm-12">
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.isLive" ng-required="true" />
&nbsp;<span>{{ 'PRIVATE' | translate }}</span>
</label>
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.isLive" ng-required="true" style="background-color:#33CC00;"/>
&nbsp;<span>{{ 'PUBLIC' | translate }}</span>
</label>
</div>
</div>
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.isLive" ng-required="true" />
&nbsp;<span>{{ 'PRIVATE' | translate }}</span>
</label>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'ENABLE_EMAIL_NOTIFICATIONS' | translate }}</h5>
</div>
</div>
</div>
<div class="field-input col-sm-12">
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'ENABLE_EMAIL_NOTIFICATIONS' | translate }}</h5>
</div>
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.emailNotifications.enabled" ng-required="true" style="background-color:#33CC00;"/>
&nbsp;<span>{{ 'YES' | translate }}</span>
</label>
<div class="field-input col-sm-12">
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.emailNotifications.enabled" ng-required="true" />
&nbsp;<span>{{ 'NO' | translate }}</span>
</label>
</div>
</div>
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.emailNotifications.enabled" ng-required="true" style="background-color:#33CC00;"/>
&nbsp;<span>{{ 'YES' | translate }}</span>
</label>
<div class="row field" ng-if="myform.emailNotifications.enabled">
<div class="field-title col-sm-12">
<h5>{{ 'EMAIL_NOTIFICATION_RECIPIENTS' | translate }}</h5>
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.emailNotifications.enabled" ng-required="true" />
&nbsp;<span>{{ 'NO' | translate }}</span>
</label>
</div>
</div>
<div class="row field" ng-if="myform.emailNotifications.enabled">
<div class="field-title col-sm-12">
<h5>{{ 'EMAIL_NOTIFICATION_RECIPIENTS' | translate }}</h5>
</div>
<div class="col-sm-12">
<input class="form-control"
type="text"
ng-model="myform.emailNotifications.recipients"
value="{{myform.emailNotifications.recipients}}"
style="width: 100%;"
placeholder="email@domain.com,email2@domain2.com,etc">
</div>
</div>
<div class="row field">
<div class="col-sm-12 field-title">{{ 'LANGUAGE' | translate }}</div>
<div class="col-sm-12 field-input">
<select ng-model="myform.language">
<option ng-repeat="language in languages"
ng-selected="language == myform.language"
value="{{language}}">
{{language}}
</option>
</select>
<span class="required-error" ng-show="field.required && !field.fieldValue">* {{ 'REQUIRED_FIELD' | translate }}</span>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'GA_TRACKING_CODE' | translate }}</h5>
</div>
<div class="col-sm-12">
<input class="form-control"
type="text"
ng-model="myform.analytics.gaCode"
value="{{myform.analytics.gaCode}}"
style="width: 100%;"
ng-minlength="4"
placeholder="UA-XXXXX-Y"
ng-pattern="/\bUA-\d{4,10}-\d{1,4}\b/">
</div>
</div>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'DISPLAY_FOOTER' | translate }}</h5>
</div>
<div class="field-input col-sm-12">
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.hideFooter" ng-required="true" />
&nbsp;<span>{{ 'YES' | translate }}</span>
</label>
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.hideFooter" ng-required="true" />
&nbsp;<span>{{ 'NO' | translate }}</span>
</label>
</div>
</div>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'DISPLAY_START_PAGE' | translate }}</h5>
</div>
<div class="field-input col-sm-12">
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.startPage.showStart" ng-required="true" style="background-color:#33CC00;"/>
&nbsp;<span>{{ 'YES' | translate }}</span>
</label>
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.startPage.showStart" ng-required="true" />
&nbsp;<span>{{ 'NO' | translate }}</span>
</label>
</div>
</div>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'DISPLAY_END_PAGE' | translate }}</h5>
</div>
<div class="field-input col-sm-12">
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.endPage.showEnd" ng-required="true" style="background-color:#33CC00;"/>
&nbsp;<span>{{ 'YES' | translate }}</span>
</label>
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.endPage.showEnd" ng-required="true" />
&nbsp;<span>{{ 'NO' | translate }}</span>
</label>
</div>
</div>
</div>
</div>
</uib-tab>
<div class="col-sm-12">
<input class="form-control"
type="text"
ng-model="myform.emailNotifications.recipients"
value="{{myform.emailNotifications.recipients}}"
style="width: 100%;"
placeholder="email@domain.com,email2@domain2.com,etc">
</div>
</div>
<uib-tab index="1" heading="{{ 'SELF_NOTIFICATIONS' | translate }}">
</uib-tab>
<uib-tab index="2" heading="{{ 'RESPONDANT_NOTIFICATIONS' | translate }}">
</uib-tab>
</uib-tabset>
<div class="row field">
<div class="col-sm-12 field-title">{{ 'LANGUAGE' | translate }}</div>
<div class="col-sm-12 field-input">
<select ng-model="myform.language">
<option ng-repeat="language in languages"
ng-selected="language == myform.language"
value="{{language}}">
{{language}}
</option>
</select>
<span class="required-error" ng-show="field.required && !field.fieldValue">* {{ 'REQUIRED_FIELD' | translate }}</span>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'GA_TRACKING_CODE' | translate }}</h5>
</div>
<div class="col-sm-12">
<input class="form-control"
type="text"
ng-model="myform.analytics.gaCode"
value="{{myform.analytics.gaCode}}"
style="width: 100%;"
ng-minlength="4"
placeholder="UA-XXXXX-Y"
ng-pattern="/\bUA-\d{4,10}-\d{1,4}\b/">
</div>
</div>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'DISPLAY_FOOTER' | translate }}</h5>
</div>
<div class="field-input col-sm-12">
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.hideFooter" ng-required="true" />
&nbsp;<span>{{ 'YES' | translate }}</span>
</label>
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.hideFooter" ng-required="true" />
&nbsp;<span>{{ 'NO' | translate }}</span>
</label>
</div>
</div>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'DISPLAY_START_PAGE' | translate }}</h5>
</div>
<div class="field-input col-sm-12">
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.startPage.showStart" ng-required="true" style="background-color:#33CC00;"/>
&nbsp;<span>{{ 'YES' | translate }}</span>
</label>
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.startPage.showStart" ng-required="true" />
&nbsp;<span>{{ 'NO' | translate }}</span>
</label>
</div>
</div>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'DISPLAY_END_PAGE' | translate }}</h5>
</div>
<div class="field-input col-sm-12">
<label style="display: inline-block;">
<input type="radio" data-ng-value="true" ng-model="myform.endPage.showEnd" ng-required="true" style="background-color:#33CC00;"/>
&nbsp;<span>{{ 'YES' | translate }}</span>
</label>
<label style="display: inline-block;">
<input type="radio" data-ng-value="false" ng-model="myform.endPage.showEnd" ng-required="true" />
&nbsp;<span>{{ 'NO' | translate }}</span>
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-offset-4 col-sm-2">
<button class="btn btn-signup btn-rounded" type="button" ng-click="update(false, myform, false, false, null)"><i class="icon-arrow-left icon-white"></i>{{ 'SAVE_CHANGES' | translate }}</button>