added email notifications to json form data

This commit is contained in:
David Baldwynn 2017-11-13 22:09:15 -08:00
parent 67a3013945
commit 9d51608a62
5 changed files with 15 additions and 15 deletions

View file

@ -462,7 +462,7 @@ exports.formByID = function(req, res, next, id) {
}
Form.findById(id)
.select('admin title language form_fields startPage endPage hideFooter isLive design analytics.gaCode')
.select('admin title language form_fields startPage endPage hideFooter isLive design analytics.gaCode respondentNotifications selfNotifications')
.populate('admin')
.exec(function(err, form) {
if (err) {

View file

@ -14,6 +14,8 @@ angular.module('forms').directive('configureFormDirective', ['$rootScope', '$fil
$scope.resetForm = $rootScope.resetForm;
$scope.update = $rootScope.update;
console.log($scope.myform);
$scope.$evalAsync(function() {
angular.element('.tag')
});

View file

@ -302,12 +302,6 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
newField.fieldValue = 0;
}
if(fieldType === 'dropdown' || fieldType === 'radio'){
newField.fieldOptions = [{
option_value: 'Option1'
}];
}
$scope.openEditModal(newField, false, $scope.myform.form_fields.length);
};

View file

@ -39,7 +39,7 @@
</div>
<div class="field-input col-sm-4 text-right">
<input class="toggle-switch" type="checkbox" name="my-checkbox"
<input class="toggle-switch" type="checkbox"
bs-switch ng-model="myform.isLive"
switch-on-text="{{ 'PUBLIC' | translate }}"
switch-off-text="{{ 'PRIVATE' | translate }}"

View file

@ -1,5 +1,12 @@
<div class="row">
<div class="col-sm-offset-2 col-sm-10">
<div class="row field" ng-if="!formHasEmailField">
<strong>
{{ 'NO_EMAIL_FIELD_WARNING' | translate }}
</strong>
</div>
<div class="row field">
<div class="notification-row">
<i class="status-light status-light-on fa fa-circle" ng-if="myform.respondentNotifications.enabled"></i>
@ -13,7 +20,10 @@
<input class="toggle-switch notification-toggle" type="checkbox" switch-size="small"
bs-switch ng-model="myform.respondentNotifications.enabled"
switch-on-text="{{ 'ON' | translate }}"
switch-off-text="{{ 'OFF' | translate }}">
switch-off-text="{{ 'OFF' | translate }}"
ng-disabled="!formHasEmailField"
ng-true-value="true"
ng-false-value="false">
</div>
</div>
@ -35,12 +45,6 @@
</div>
</div>
<div class="row field" ng-if="!formHasEmailField">
<strong>
{{ 'NO_EMAIL_FIELD_WARNING' | translate }}
</strong>
</div>
<div class="row field">
<div class="field-title col-sm-12">
<h5>{{ 'REPLY_TO' | translate }}:</h5>