added loading indicator to submit form button
This commit is contained in:
parent
ae3337f150
commit
7e40886bb3
|
@ -34,7 +34,8 @@
|
||||||
"angular-ui-router-tabs": "~1.7.0",
|
"angular-ui-router-tabs": "~1.7.0",
|
||||||
"angular-scroll": "^1.0.0",
|
"angular-scroll": "^1.0.0",
|
||||||
"ui-select": "angular-ui-select#^0.16.1",
|
"ui-select": "angular-ui-select#^0.16.1",
|
||||||
"angular-sanitize": "^1.5.3"
|
"angular-sanitize": "^1.5.3",
|
||||||
|
"v-button": "^1.1.1"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"angular-bootstrap": "^0.14.0",
|
"angular-bootstrap": "^0.14.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
var ApplicationConfiguration = (function() {
|
var ApplicationConfiguration = (function() {
|
||||||
// Init module configuration options
|
// Init module configuration options
|
||||||
var applicationModuleName = 'NodeForm';
|
var applicationModuleName = 'NodeForm';
|
||||||
var applicationModuleVendorDependencies = ['duScroll', 'ngSanitize', 'ui.select', 'ngResource', 'NodeForm.templates', 'ngAnimate', 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven', 'cgBusy'];
|
var applicationModuleVendorDependencies = ['duScroll', 'ngSanitize', 'vButton', 'ngResource', 'NodeForm.templates', 'ngAnimate', 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven', 'cgBusy'];
|
||||||
|
|
||||||
// Add a new vertical module
|
// Add a new vertical module
|
||||||
var registerModule = function(moduleName, dependencies) {
|
var registerModule = function(moduleName, dependencies) {
|
||||||
|
|
28
public/dist/application.js
vendored
28
public/dist/application.js
vendored
|
@ -4,7 +4,7 @@
|
||||||
var ApplicationConfiguration = (function() {
|
var ApplicationConfiguration = (function() {
|
||||||
// Init module configuration options
|
// Init module configuration options
|
||||||
var applicationModuleName = 'NodeForm';
|
var applicationModuleName = 'NodeForm';
|
||||||
var applicationModuleVendorDependencies = ['duScroll', 'ngSanitize', 'ui.select', 'ngResource', 'NodeForm.templates', 'ngAnimate', 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven', 'cgBusy'];
|
var applicationModuleVendorDependencies = ['duScroll', 'ngSanitize', 'vButton', 'ngResource', 'NodeForm.templates', 'ngAnimate', 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven', 'cgBusy'];
|
||||||
|
|
||||||
// Add a new vertical module
|
// Add a new vertical module
|
||||||
var registerModule = function(moduleName, dependencies) {
|
var registerModule = function(moduleName, dependencies) {
|
||||||
|
@ -403,7 +403,7 @@ angular.module('NodeForm.templates', []).run(['$templateCache', function($templa
|
||||||
$templateCache.put("../public/modules/forms/views/directiveViews/form/edit-submissions-form.client.view.html",
|
$templateCache.put("../public/modules/forms/views/directiveViews/form/edit-submissions-form.client.view.html",
|
||||||
"<div class=\"submissions-table row container\" ng-init=initFormSubmissions()><div class=row><div class=col-xs-2><button class=\"btn btn-danger\" ng-click=deleteSelectedSubmissions() ng-disabled=!isAtLeastOneChecked();><i class=\"fa fa-trash-o\"></i> Delete Selected</button></div><div class=\"col-xs-2 col-xs-offset-4 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('xls')\"><small>Export to Excel</small></button></div><div class=\"col-md-2 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('csv')\"><small>Export to CSV</small></button></div><div class=\"col-md-2 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('json')\"><small>Export to JSON</small></button></div></div><div class=\"row table-outer\"><div class=col-xs-12><table id=table-submission-data class=\"table table-striped table-hover table-condensed\"><thead><tr><th><input ng-model=table.masterChecker ng-change=toggleAllCheckers() type=\"checkbox\"></th><th>#</th><th data-ng-repeat=\"(key, value) in myform.form_fields\">{{value.title}}</th><th ng-if=myform.plugins.oscarhost.baseUrl>OscarEMR User Profile</th><th>Percentage Complete</th><th>Time Elapsed</th><th>Device</th><th>Location</th><th>IP Address</th><th>Date Submitted (UTC)</th><th ng-if=myform.autofillPDFs>Generated PDF</th></tr></thead><tbody><tr data-ng-repeat=\"row in table.rows\" ng-click=rowClicked($index) ng-class=\"{selected: row.selected === true}\"><td><input ng-model=row.selected type=\"checkbox\"></td><th class=scope>{{$index+1}}</th><td data-ng-repeat=\"field in row.form_fields\">{{field.fieldValue}}</td><td ng-if=myform.plugins.oscarhost.baseUrl><a href=\"{{myform.plugins.oscarhost.baseUrl.split('ws')[0]}}demographic/demographiccontrol.jsp?demographic_no={{row.oscarDemoNum}}&displaymode=edit\">User Profile #{{row.oscarDemoNum}}</a></td><td>{{row.percentageComplete}}%</td><td>{{row.timeElapsed}}</td><td>{{row.device.name}}, {{row.device.type}}</td><td>{{row.geoLocation.city}}, {{row.geoLocation.country}}</td><td>{{row.ipAddr}}</td><td>{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}</td><td ng-if=row.pdf><a href={{row.pdfFilePath}} download={{row.pdf.name}} target=_self>Generated PDF</a></td></tr></tbody></table></div></div></div>");
|
"<div class=\"submissions-table row container\" ng-init=initFormSubmissions()><div class=row><div class=col-xs-2><button class=\"btn btn-danger\" ng-click=deleteSelectedSubmissions() ng-disabled=!isAtLeastOneChecked();><i class=\"fa fa-trash-o\"></i> Delete Selected</button></div><div class=\"col-xs-2 col-xs-offset-4 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('xls')\"><small>Export to Excel</small></button></div><div class=\"col-md-2 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('csv')\"><small>Export to CSV</small></button></div><div class=\"col-md-2 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('json')\"><small>Export to JSON</small></button></div></div><div class=\"row table-outer\"><div class=col-xs-12><table id=table-submission-data class=\"table table-striped table-hover table-condensed\"><thead><tr><th><input ng-model=table.masterChecker ng-change=toggleAllCheckers() type=\"checkbox\"></th><th>#</th><th data-ng-repeat=\"(key, value) in myform.form_fields\">{{value.title}}</th><th ng-if=myform.plugins.oscarhost.baseUrl>OscarEMR User Profile</th><th>Percentage Complete</th><th>Time Elapsed</th><th>Device</th><th>Location</th><th>IP Address</th><th>Date Submitted (UTC)</th><th ng-if=myform.autofillPDFs>Generated PDF</th></tr></thead><tbody><tr data-ng-repeat=\"row in table.rows\" ng-click=rowClicked($index) ng-class=\"{selected: row.selected === true}\"><td><input ng-model=row.selected type=\"checkbox\"></td><th class=scope>{{$index+1}}</th><td data-ng-repeat=\"field in row.form_fields\">{{field.fieldValue}}</td><td ng-if=myform.plugins.oscarhost.baseUrl><a href=\"{{myform.plugins.oscarhost.baseUrl.split('ws')[0]}}demographic/demographiccontrol.jsp?demographic_no={{row.oscarDemoNum}}&displaymode=edit\">User Profile #{{row.oscarDemoNum}}</a></td><td>{{row.percentageComplete}}%</td><td>{{row.timeElapsed}}</td><td>{{row.device.name}}, {{row.device.type}}</td><td>{{row.geoLocation.city}}, {{row.geoLocation.country}}</td><td>{{row.ipAddr}}</td><td>{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}</td><td ng-if=row.pdf><a href={{row.pdfFilePath}} download={{row.pdf.name}} target=_self>Generated PDF</a></td></tr></tbody></table></div></div></div>");
|
||||||
$templateCache.put("../public/modules/forms/views/directiveViews/form/submit-form.client.view.html",
|
$templateCache.put("../public/modules/forms/views/directiveViews/form/submit-form.client.view.html",
|
||||||
"<section class=\"overlay submitform\" ng-if=\"!myform.submitted && !myform.startPage.showStart\"></section><div ng-show=\"!myform.submitted && myform.startPage.showStart\" class=form-submitted style=\"margin-top: 35vh\"><div class=row><div class=\"col-xs-12 text-center\" style=\"overflow-wrap: break-word\"><h1 style=\"font-weight: 400; font-size: 25px\">{{myform.startPage.introTitle}}</h1></div><div class=\"col-xs-10 col-xs-offset-1 text-center\" style=\"overflow-wrap: break-word\"><p style=\"color: grey; font-weight: 100; font-size: 16px\">{{myform.startPage.introParagraph}}</p></div></div><div class=\"row form-actions text-center\" style=\"padding: 5px 25px 5px 25px\"><button ng-click=exitStartPage() class=\"btn btn-info\" type=button><a style=\"font-size: 1.6em; text-decoration: none\">Start</a></button></div><div class=\"row form-actions\" style=\"padding-bottom:3em; padding-left: 1em; padding-right: 1em\"><p ng-repeat=\"button in myform.startPage.buttons\" class=text-center style=display:inline><button class=btn style=\"background-color:rgb(156, 226, 235)\" type=button ng-style=\"{'background-color':button.bgColor, 'color':button.color}\"><a href={{button.url}} style=\"font-size: 1.6em; text-decoration: none\" ng-style=\"{'color':button.color}\">{{button.text}}</a></button></p></div></div><div class=form-fields cg-busy=\"{promise:submitPromise,message:'Submitting form...',wrapperClass:'busy-submitting-wrapper',backdrop:true}\" ng-show=\"!myform.submitted && !myform.startPage.showStart\"><div class=row><form name=myForm du-scroll-container novalidate class=\"submission-form col-sm-12 col-md-offset-1 col-md-10\"><div ng-repeat=\"field in myform.form_fields\" ng-if=!field.deletePreserved data-index={{$index}} data-id={{field._id}} du-scrollspy ng-class=\"{activeField: selected._id == field._id }\" class=\"row field-directive\"><field-directive field=field design=myform.design index=$index></field-directive></div></form></div><div class=\"row form-actions\" id=submit_field ng-click=\"setActiveField('submit_field', myform.form_fields.length)\" ng-class=\"{activeField: selected._id == 'submit_field' }\" style=\"border-top: 1px solid #ddd; margin-right: -13% ;margin-left: -13%; padding-bottom: 25vh\"><button ng-focus=\"setActiveField('submit_field', myform.form_fields.length)\" class=\"btn btn-success col-sm-2\" type=button ng-disabled=\"myform.$invalid || $scope.loading\" ng-click=submitForm() style=\"font-size: 1.6em; margin-left: 1em; margin-top: 1em\">Submit</button><div class=col-sm-2 style=\"font-size: 75%; margin-top:2.5em\"><small>press ENTER</small></div></div><section ng-if=!myform.hideFooter class=\"navbar navbar-fixed-bottom\" style=\"background-color:rgba(242,242,242,0.5); padding-top:15px\"><div class=container-fluid><div class=row><div class=\"col-sm-5 col-md-6 col-xs-5\" ng-show=!myform.submitted><p class=lead>{{myform | formValidity}} out of {{form_fields_count}} answered</p></div><div class=\"col-md-6 col-md-offset-0 col-sm-offset-2 col-sm-3 col-xs-offset-1 col-xs-6 row\"><div class=\"col-md-4 col-md-offset-2 hidden-sm hidden-xs\" ng-if=!authentication.isAuthenticated()><a href=/#!/forms class=\"btn btn-default\">Create a TellForm</a></div><div class=\"col-md-4 col-md-offset-2 hidden-sm hidden-xs\" ng-if=authentication.isAuthenticated()><a href=/#!/forms/{{myform._id}}/admin/create class=\"btn btn-default\">Edit this TellForm</a></div><div class=\"col-md-4 col-sm-10 col-md-offset-0 col-sm-offset-2 col-xs-12\"><button class=\"btn btn-info btn-lg\" id=focusDownButton ng-click=nextField() ng-disabled=\"selected.index > myform.form_fields.length-1\"><i class=\"fa fa-chevron-down\"></i></button> <button class=\"btn btn-info btn-lg\" id=focusUpButton ng-click=prevField() ng-disabled=\"selected.index == 0\"><i class=\"fa fa-chevron-up\"></i></button></div></div></div></div></section></div><div ng-if=myform.submitted class=form-submitted><div class=\"field row text-center\"><div class=\"col-xs-6 col-xs-offset-3 text-center\">Form entry successfully submitted!</div></div><div class=\"row form-actions\"><p class=\"text-center col-xs-4 col-xs-offset-4\"><button ng-click=reloadForm() class=\"btn btn-info\" type=button><a style=\"color:white; font-size: 1.6em; text-decoration: none\">Go back to Form</a></button></p></div></div>");
|
"<section class=\"overlay submitform\" ng-if=\"loading || (!myform.submitted && !myform.startPage.showStart)\"></section><div ng-show=\"!myform.submitted && myform.startPage.showStart\" class=form-submitted style=\"margin-top: 35vh\"><div class=row><div class=\"col-xs-12 text-center\" style=\"overflow-wrap: break-word\"><h1 style=\"font-weight: 400; font-size: 25px\">{{myform.startPage.introTitle}}</h1></div><div class=\"col-xs-10 col-xs-offset-1 text-center\" style=\"overflow-wrap: break-word\"><p style=\"color: grey; font-weight: 100; font-size: 16px\">{{myform.startPage.introParagraph}}</p></div></div><div class=\"row form-actions text-center\" style=\"padding: 5px 25px 5px 25px\"><button ng-click=exitStartPage() class=\"btn btn-info\" type=button><a style=\"font-size: 1.6em; text-decoration: none\">Start</a></button></div><div class=\"row form-actions\" style=\"padding-bottom:3em; padding-left: 1em; padding-right: 1em\"><p ng-repeat=\"button in myform.startPage.buttons\" class=text-center style=display:inline><button class=btn style=\"background-color:rgb(156, 226, 235)\" type=button ng-style=\"{'background-color':button.bgColor, 'color':button.color}\"><a href={{button.url}} style=\"font-size: 1.6em; text-decoration: none\" ng-style=\"{'color':button.color}\">{{button.text}}</a></button></p></div></div><div class=form-fields ng-show=\"!myform.submitted && !myform.startPage.showStart\"><div class=row><form name=myForm du-scroll-container novalidate class=\"submission-form col-sm-12 col-md-offset-1 col-md-10\"><div ng-repeat=\"field in myform.form_fields\" ng-if=!field.deletePreserved data-index={{$index}} data-id={{field._id}} du-scrollspy ng-class=\"{activeField: selected._id == field._id }\" class=\"row field-directive\"><field-directive field=field design=myform.design index=$index></field-directive></div></form></div><div class=\"row form-actions\" id=submit_field ng-click=\"setActiveField('submit_field', myform.form_fields.length)\" ng-class=\"{activeField: selected._id == 'submit_field' }\" style=\"border-top: 1px solid #ddd; margin-right: -13% ;margin-left: -13%; padding-bottom: 25vh\"><button ng-focus=\"setActiveField('submit_field', myform.form_fields.length)\" class=\"Button btn btn-success col-sm-2\" v-busy=loading v-busy-label=\"Please wait\" v-pressable ng-disabled=loading ng-click=submitForm() style=\"font-size: 1.6em; margin-left: 1em; margin-top: 1em\">Submit</button><div class=col-sm-2 style=\"font-size: 75%; margin-top:2.5em\"><small>press ENTER</small></div></div><section ng-if=!myform.hideFooter class=\"navbar navbar-fixed-bottom\" style=\"background-color:rgba(242,242,242,0.5); padding-top:15px\"><div class=container-fluid><div class=row><div class=\"col-sm-5 col-md-6 col-xs-5\" ng-show=!myform.submitted><p class=lead>{{myform | formValidity}} out of {{form_fields_count}} answered</p></div><div class=\"col-md-6 col-md-offset-0 col-sm-offset-2 col-sm-3 col-xs-offset-1 col-xs-6 row\"><div class=\"col-md-4 col-md-offset-2 hidden-sm hidden-xs\" ng-if=!authentication.isAuthenticated()><a href=/#!/forms class=\"btn btn-default\">Create a TellForm</a></div><div class=\"col-md-4 col-md-offset-2 hidden-sm hidden-xs\" ng-if=authentication.isAuthenticated()><a href=/#!/forms/{{myform._id}}/admin/create class=\"btn btn-default\">Edit this TellForm</a></div><div class=\"col-md-4 col-sm-10 col-md-offset-0 col-sm-offset-2 col-xs-12\"><button class=\"btn btn-info btn-lg\" id=focusDownButton ng-click=nextField() ng-disabled=\"selected.index > myform.form_fields.length-1\"><i class=\"fa fa-chevron-down\"></i></button> <button class=\"btn btn-info btn-lg\" id=focusUpButton ng-click=prevField() ng-disabled=\"selected.index == 0\"><i class=\"fa fa-chevron-up\"></i></button></div></div></div></div></section></div><div ng-if=\"myform.submitted && !loading\" class=form-submitted><div class=\"field row text-center\"><div class=\"col-xs-6 col-xs-offset-3 text-center\">Form entry successfully submitted!</div></div><div class=\"row form-actions\"><p class=\"text-center col-xs-4 col-xs-offset-4\"><button ng-click=reloadForm() class=\"btn btn-info\" type=button><a style=\"color:white; font-size: 1.6em; text-decoration: none\">Go back to Form</a></button></p></div></div>");
|
||||||
$templateCache.put("../public/modules/users/views/authentication/access-denied.client.view.html",
|
$templateCache.put("../public/modules/users/views/authentication/access-denied.client.view.html",
|
||||||
"<section class=\"row text-center auth\"><h3 class=col-md-12>You need to be logged in to access this page</h3><a href=/#!/sigin class=col-md-12>Login</a></section>");
|
"<section class=\"row text-center auth\"><h3 class=col-md-12>You need to be logged in to access this page</h3><a href=/#!/sigin class=col-md-12>Login</a></section>");
|
||||||
$templateCache.put("../public/modules/users/views/authentication/signin.client.view.html",
|
$templateCache.put("../public/modules/users/views/authentication/signin.client.view.html",
|
||||||
|
@ -1771,7 +1771,7 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
controller: ["$document", "$window", "$scope", function($document, $window, $scope){
|
controller: ["$document", "$window", "$scope", function($document, $window, $scope){
|
||||||
$scope.authentication = $rootScope.authentication;
|
$scope.authentication = $rootScope.authentication;
|
||||||
$scope.noscroll = false;
|
$scope.noscroll = false;
|
||||||
|
|
||||||
$scope.form_fields_count = $scope.myform.visible_form_fields.filter(function(field){
|
$scope.form_fields_count = $scope.myform.visible_form_fields.filter(function(field){
|
||||||
if(field.fieldType === 'statement' || field.fieldType === 'rating'){
|
if(field.fieldType === 'statement' || field.fieldType === 'rating'){
|
||||||
return false;
|
return false;
|
||||||
|
@ -1882,13 +1882,6 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.hideOverlay = function(){
|
|
||||||
$scope.selected = {
|
|
||||||
_id: '',
|
|
||||||
index: null,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Form Display Functions
|
** Form Display Functions
|
||||||
*/
|
*/
|
||||||
|
@ -1904,19 +1897,24 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
var form = _.cloneDeep($scope.myform);
|
var form = _.cloneDeep($scope.myform);
|
||||||
form.timeElapsed = _timeElapsed;
|
form.timeElapsed = _timeElapsed;
|
||||||
|
|
||||||
form.percentageComplete = $filter('formValidity')($scope.myform)/$scope.myform.visible_form_fields.length*100;
|
form.percentageComplete = $filter('formValidity')($scope.myform)/$scope.myform.visible_form_fields.length*100;
|
||||||
delete form.visible_form_fields;
|
delete form.visible_form_fields;
|
||||||
|
|
||||||
$scope.submitPromise = $http.post('/forms/'+$scope.myform._id, form)
|
$scope.submitPromise = $http.post('/forms/'+$scope.myform._id, form)
|
||||||
.success(function(data, status, headers){
|
.success(function(data, status, headers){
|
||||||
console.log('form submitted successfully');
|
console.log('form submitted successfully');
|
||||||
$scope.myform.submitted = true;
|
setTimeout(function() {
|
||||||
|
$scope.myform.submitted = true;
|
||||||
|
$scope.loading = false;
|
||||||
|
}, 20);
|
||||||
})
|
})
|
||||||
.error(function(error){
|
.error(function(error){
|
||||||
$scope.loading = false;
|
setTimeout(function(){
|
||||||
console.log(error);
|
$scope.loading = false;
|
||||||
$scope.error = error.message;
|
console.log(error);
|
||||||
|
$scope.error = error.message;
|
||||||
|
}, 20);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
6
public/dist/application.min.js
vendored
6
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -11,7 +11,7 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
controller: function($document, $window, $scope){
|
controller: function($document, $window, $scope){
|
||||||
$scope.authentication = $rootScope.authentication;
|
$scope.authentication = $rootScope.authentication;
|
||||||
$scope.noscroll = false;
|
$scope.noscroll = false;
|
||||||
|
|
||||||
$scope.form_fields_count = $scope.myform.visible_form_fields.filter(function(field){
|
$scope.form_fields_count = $scope.myform.visible_form_fields.filter(function(field){
|
||||||
if(field.fieldType === 'statement' || field.fieldType === 'rating'){
|
if(field.fieldType === 'statement' || field.fieldType === 'rating'){
|
||||||
return false;
|
return false;
|
||||||
|
@ -122,13 +122,6 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.hideOverlay = function(){
|
|
||||||
$scope.selected = {
|
|
||||||
_id: '',
|
|
||||||
index: null,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Form Display Functions
|
** Form Display Functions
|
||||||
*/
|
*/
|
||||||
|
@ -144,19 +137,24 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
var form = _.cloneDeep($scope.myform);
|
var form = _.cloneDeep($scope.myform);
|
||||||
form.timeElapsed = _timeElapsed;
|
form.timeElapsed = _timeElapsed;
|
||||||
|
|
||||||
form.percentageComplete = $filter('formValidity')($scope.myform)/$scope.myform.visible_form_fields.length*100;
|
form.percentageComplete = $filter('formValidity')($scope.myform)/$scope.myform.visible_form_fields.length*100;
|
||||||
delete form.visible_form_fields;
|
delete form.visible_form_fields;
|
||||||
|
|
||||||
$scope.submitPromise = $http.post('/forms/'+$scope.myform._id, form)
|
$scope.submitPromise = $http.post('/forms/'+$scope.myform._id, form)
|
||||||
.success(function(data, status, headers){
|
.success(function(data, status, headers){
|
||||||
console.log('form submitted successfully');
|
console.log('form submitted successfully');
|
||||||
$scope.myform.submitted = true;
|
setTimeout(function() {
|
||||||
|
$scope.myform.submitted = true;
|
||||||
|
$scope.loading = false;
|
||||||
|
}, 20);
|
||||||
})
|
})
|
||||||
.error(function(error){
|
.error(function(error){
|
||||||
$scope.loading = false;
|
setTimeout(function(){
|
||||||
console.log(error);
|
$scope.loading = false;
|
||||||
$scope.error = error.message;
|
console.log(error);
|
||||||
|
$scope.error = error.message;
|
||||||
|
}, 20);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<section class="overlay submitform" ng-if="!myform.submitted && !myform.startPage.showStart"></section>
|
<section class="overlay submitform" ng-if="loading || (!myform.submitted && !myform.startPage.showStart)"></section>
|
||||||
|
|
||||||
<!-- Start Page View -->
|
<!-- Start Page View -->
|
||||||
<div ng-show="!myform.submitted && myform.startPage.showStart"
|
<div ng-show="!myform.submitted && myform.startPage.showStart"
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Form Fields View -->
|
<!-- Form Fields View -->
|
||||||
<div class="form-fields" cg-busy="{promise:submitPromise,message:'Submitting form...',wrapperClass:'busy-submitting-wrapper',backdrop:true}" ng-show="!myform.submitted && !myform.startPage.showStart">
|
<div class="form-fields" ng-show="!myform.submitted && !myform.startPage.showStart">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<form name="myForm"
|
<form name="myForm"
|
||||||
du-scroll-container
|
du-scroll-container
|
||||||
|
@ -63,13 +63,13 @@
|
||||||
style="border-top: 1px solid #ddd; margin-right: -13% ;margin-left: -13%; padding-bottom: 25vh;">
|
style="border-top: 1px solid #ddd; margin-right: -13% ;margin-left: -13%; padding-bottom: 25vh;">
|
||||||
|
|
||||||
<button ng-focus="setActiveField('submit_field', myform.form_fields.length)"
|
<button ng-focus="setActiveField('submit_field', myform.form_fields.length)"
|
||||||
class="btn btn-success col-sm-2"
|
class="Button btn btn-success col-sm-2"
|
||||||
type="button"
|
v-busy="loading" v-busy-label="Please wait" v-pressable
|
||||||
ng-disabled="myform.$invalid || $scope.loading"
|
ng-disabled="loading"
|
||||||
ng-click="submitForm()"
|
ng-click="submitForm()"
|
||||||
style="font-size: 1.6em; margin-left: 1em; margin-top: 1em;">
|
style="font-size: 1.6em; margin-left: 1em; margin-top: 1em;">
|
||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="col-sm-2" style="font-size: 75%; margin-top:2.5em">
|
<div class="col-sm-2" style="font-size: 75%; margin-top:2.5em">
|
||||||
<small>
|
<small>
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- End Page View -->
|
<!-- End Page View -->
|
||||||
<div ng-if="myform.submitted" class="form-submitted">
|
<div ng-if="myform.submitted && !loading" class="form-submitted">
|
||||||
|
|
||||||
<div class="field row text-center">
|
<div class="field row text-center">
|
||||||
<div class="col-xs-6 col-xs-offset-3 text-center">Form entry successfully submitted!</div>
|
<div class="col-xs-6 col-xs-offset-3 text-center">Form entry successfully submitted!</div>
|
||||||
|
|
|
@ -288,7 +288,7 @@ angular.module('NodeForm.templates', []).run(['$templateCache', function($templa
|
||||||
$templateCache.put("../public/modules/forms/views/directiveViews/form/edit-submissions-form.client.view.html",
|
$templateCache.put("../public/modules/forms/views/directiveViews/form/edit-submissions-form.client.view.html",
|
||||||
"<div class=\"submissions-table row container\" ng-init=initFormSubmissions()><div class=row><div class=col-xs-2><button class=\"btn btn-danger\" ng-click=deleteSelectedSubmissions() ng-disabled=!isAtLeastOneChecked();><i class=\"fa fa-trash-o\"></i> Delete Selected</button></div><div class=\"col-xs-2 col-xs-offset-4 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('xls')\"><small>Export to Excel</small></button></div><div class=\"col-md-2 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('csv')\"><small>Export to CSV</small></button></div><div class=\"col-md-2 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('json')\"><small>Export to JSON</small></button></div></div><div class=\"row table-outer\"><div class=col-xs-12><table id=table-submission-data class=\"table table-striped table-hover table-condensed\"><thead><tr><th><input ng-model=table.masterChecker ng-change=toggleAllCheckers() type=\"checkbox\"></th><th>#</th><th data-ng-repeat=\"(key, value) in myform.form_fields\">{{value.title}}</th><th ng-if=myform.plugins.oscarhost.baseUrl>OscarEMR User Profile</th><th>Percentage Complete</th><th>Time Elapsed</th><th>Device</th><th>Location</th><th>IP Address</th><th>Date Submitted (UTC)</th><th ng-if=myform.autofillPDFs>Generated PDF</th></tr></thead><tbody><tr data-ng-repeat=\"row in table.rows\" ng-click=rowClicked($index) ng-class=\"{selected: row.selected === true}\"><td><input ng-model=row.selected type=\"checkbox\"></td><th class=scope>{{$index+1}}</th><td data-ng-repeat=\"field in row.form_fields\">{{field.fieldValue}}</td><td ng-if=myform.plugins.oscarhost.baseUrl><a href=\"{{myform.plugins.oscarhost.baseUrl.split('ws')[0]}}demographic/demographiccontrol.jsp?demographic_no={{row.oscarDemoNum}}&displaymode=edit\">User Profile #{{row.oscarDemoNum}}</a></td><td>{{row.percentageComplete}}%</td><td>{{row.timeElapsed}}</td><td>{{row.device.name}}, {{row.device.type}}</td><td>{{row.geoLocation.city}}, {{row.geoLocation.country}}</td><td>{{row.ipAddr}}</td><td>{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}</td><td ng-if=row.pdf><a href={{row.pdfFilePath}} download={{row.pdf.name}} target=_self>Generated PDF</a></td></tr></tbody></table></div></div></div>");
|
"<div class=\"submissions-table row container\" ng-init=initFormSubmissions()><div class=row><div class=col-xs-2><button class=\"btn btn-danger\" ng-click=deleteSelectedSubmissions() ng-disabled=!isAtLeastOneChecked();><i class=\"fa fa-trash-o\"></i> Delete Selected</button></div><div class=\"col-xs-2 col-xs-offset-4 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('xls')\"><small>Export to Excel</small></button></div><div class=\"col-md-2 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('csv')\"><small>Export to CSV</small></button></div><div class=\"col-md-2 text-right\"><button class=\"btn btn-default\" ng-click=\"exportSubmissions('json')\"><small>Export to JSON</small></button></div></div><div class=\"row table-outer\"><div class=col-xs-12><table id=table-submission-data class=\"table table-striped table-hover table-condensed\"><thead><tr><th><input ng-model=table.masterChecker ng-change=toggleAllCheckers() type=\"checkbox\"></th><th>#</th><th data-ng-repeat=\"(key, value) in myform.form_fields\">{{value.title}}</th><th ng-if=myform.plugins.oscarhost.baseUrl>OscarEMR User Profile</th><th>Percentage Complete</th><th>Time Elapsed</th><th>Device</th><th>Location</th><th>IP Address</th><th>Date Submitted (UTC)</th><th ng-if=myform.autofillPDFs>Generated PDF</th></tr></thead><tbody><tr data-ng-repeat=\"row in table.rows\" ng-click=rowClicked($index) ng-class=\"{selected: row.selected === true}\"><td><input ng-model=row.selected type=\"checkbox\"></td><th class=scope>{{$index+1}}</th><td data-ng-repeat=\"field in row.form_fields\">{{field.fieldValue}}</td><td ng-if=myform.plugins.oscarhost.baseUrl><a href=\"{{myform.plugins.oscarhost.baseUrl.split('ws')[0]}}demographic/demographiccontrol.jsp?demographic_no={{row.oscarDemoNum}}&displaymode=edit\">User Profile #{{row.oscarDemoNum}}</a></td><td>{{row.percentageComplete}}%</td><td>{{row.timeElapsed}}</td><td>{{row.device.name}}, {{row.device.type}}</td><td>{{row.geoLocation.city}}, {{row.geoLocation.country}}</td><td>{{row.ipAddr}}</td><td>{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}</td><td ng-if=row.pdf><a href={{row.pdfFilePath}} download={{row.pdf.name}} target=_self>Generated PDF</a></td></tr></tbody></table></div></div></div>");
|
||||||
$templateCache.put("../public/modules/forms/views/directiveViews/form/submit-form.client.view.html",
|
$templateCache.put("../public/modules/forms/views/directiveViews/form/submit-form.client.view.html",
|
||||||
"<section class=\"overlay submitform\" ng-if=\"!myform.submitted && !myform.startPage.showStart\"></section><div ng-show=\"!myform.submitted && myform.startPage.showStart\" class=form-submitted style=\"margin-top: 35vh\"><div class=row><div class=\"col-xs-12 text-center\" style=\"overflow-wrap: break-word\"><h1 style=\"font-weight: 400; font-size: 25px\">{{myform.startPage.introTitle}}</h1></div><div class=\"col-xs-10 col-xs-offset-1 text-center\" style=\"overflow-wrap: break-word\"><p style=\"color: grey; font-weight: 100; font-size: 16px\">{{myform.startPage.introParagraph}}</p></div></div><div class=\"row form-actions text-center\" style=\"padding: 5px 25px 5px 25px\"><button ng-click=exitStartPage() class=\"btn btn-info\" type=button><a style=\"font-size: 1.6em; text-decoration: none\">Start</a></button></div><div class=\"row form-actions\" style=\"padding-bottom:3em; padding-left: 1em; padding-right: 1em\"><p ng-repeat=\"button in myform.startPage.buttons\" class=text-center style=display:inline><button class=btn style=\"background-color:rgb(156, 226, 235)\" type=button ng-style=\"{'background-color':button.bgColor, 'color':button.color}\"><a href={{button.url}} style=\"font-size: 1.6em; text-decoration: none\" ng-style=\"{'color':button.color}\">{{button.text}}</a></button></p></div></div><div class=form-fields cg-busy=\"{promise:submitPromise,message:'Submitting form...',wrapperClass:'busy-submitting-wrapper',backdrop:true}\" ng-show=\"!myform.submitted && !myform.startPage.showStart\"><div class=row><form name=myForm du-scroll-container novalidate class=\"submission-form col-sm-12 col-md-offset-1 col-md-10\"><div ng-repeat=\"field in myform.form_fields\" ng-if=!field.deletePreserved data-index={{$index}} data-id={{field._id}} du-scrollspy ng-class=\"{activeField: selected._id == field._id }\" class=\"row field-directive\"><field-directive field=field design=myform.design index=$index></field-directive></div></form></div><div class=\"row form-actions\" id=submit_field ng-click=\"setActiveField('submit_field', myform.form_fields.length)\" ng-class=\"{activeField: selected._id == 'submit_field' }\" style=\"border-top: 1px solid #ddd; margin-right: -13% ;margin-left: -13%; padding-bottom: 25vh\"><button ng-focus=\"setActiveField('submit_field', myform.form_fields.length)\" class=\"btn btn-success col-sm-2\" type=button ng-disabled=\"myform.$invalid || $scope.loading\" ng-click=submitForm() style=\"font-size: 1.6em; margin-left: 1em; margin-top: 1em\">Submit</button><div class=col-sm-2 style=\"font-size: 75%; margin-top:2.5em\"><small>press ENTER</small></div></div><section ng-if=!myform.hideFooter class=\"navbar navbar-fixed-bottom\" style=\"background-color:rgba(242,242,242,0.5); padding-top:15px\"><div class=container-fluid><div class=row><div class=\"col-sm-5 col-md-6 col-xs-5\" ng-show=!myform.submitted><p class=lead>{{myform | formValidity}} out of {{form_fields_count}} answered</p></div><div class=\"col-md-6 col-md-offset-0 col-sm-offset-2 col-sm-3 col-xs-offset-1 col-xs-6 row\"><div class=\"col-md-4 col-md-offset-2 hidden-sm hidden-xs\" ng-if=!authentication.isAuthenticated()><a href=/#!/forms class=\"btn btn-default\">Create a TellForm</a></div><div class=\"col-md-4 col-md-offset-2 hidden-sm hidden-xs\" ng-if=authentication.isAuthenticated()><a href=/#!/forms/{{myform._id}}/admin/create class=\"btn btn-default\">Edit this TellForm</a></div><div class=\"col-md-4 col-sm-10 col-md-offset-0 col-sm-offset-2 col-xs-12\"><button class=\"btn btn-info btn-lg\" id=focusDownButton ng-click=nextField() ng-disabled=\"selected.index > myform.form_fields.length-1\"><i class=\"fa fa-chevron-down\"></i></button> <button class=\"btn btn-info btn-lg\" id=focusUpButton ng-click=prevField() ng-disabled=\"selected.index == 0\"><i class=\"fa fa-chevron-up\"></i></button></div></div></div></div></section></div><div ng-if=myform.submitted class=form-submitted><div class=\"field row text-center\"><div class=\"col-xs-6 col-xs-offset-3 text-center\">Form entry successfully submitted!</div></div><div class=\"row form-actions\"><p class=\"text-center col-xs-4 col-xs-offset-4\"><button ng-click=reloadForm() class=\"btn btn-info\" type=button><a style=\"color:white; font-size: 1.6em; text-decoration: none\">Go back to Form</a></button></p></div></div>");
|
"<section class=\"overlay submitform\" ng-if=\"loading || (!myform.submitted && !myform.startPage.showStart)\"></section><div ng-show=\"!myform.submitted && myform.startPage.showStart\" class=form-submitted style=\"margin-top: 35vh\"><div class=row><div class=\"col-xs-12 text-center\" style=\"overflow-wrap: break-word\"><h1 style=\"font-weight: 400; font-size: 25px\">{{myform.startPage.introTitle}}</h1></div><div class=\"col-xs-10 col-xs-offset-1 text-center\" style=\"overflow-wrap: break-word\"><p style=\"color: grey; font-weight: 100; font-size: 16px\">{{myform.startPage.introParagraph}}</p></div></div><div class=\"row form-actions text-center\" style=\"padding: 5px 25px 5px 25px\"><button ng-click=exitStartPage() class=\"btn btn-info\" type=button><a style=\"font-size: 1.6em; text-decoration: none\">Start</a></button></div><div class=\"row form-actions\" style=\"padding-bottom:3em; padding-left: 1em; padding-right: 1em\"><p ng-repeat=\"button in myform.startPage.buttons\" class=text-center style=display:inline><button class=btn style=\"background-color:rgb(156, 226, 235)\" type=button ng-style=\"{'background-color':button.bgColor, 'color':button.color}\"><a href={{button.url}} style=\"font-size: 1.6em; text-decoration: none\" ng-style=\"{'color':button.color}\">{{button.text}}</a></button></p></div></div><div class=form-fields ng-show=\"!myform.submitted && !myform.startPage.showStart\"><div class=row><form name=myForm du-scroll-container novalidate class=\"submission-form col-sm-12 col-md-offset-1 col-md-10\"><div ng-repeat=\"field in myform.form_fields\" ng-if=!field.deletePreserved data-index={{$index}} data-id={{field._id}} du-scrollspy ng-class=\"{activeField: selected._id == field._id }\" class=\"row field-directive\"><field-directive field=field design=myform.design index=$index></field-directive></div></form></div><div class=\"row form-actions\" id=submit_field ng-click=\"setActiveField('submit_field', myform.form_fields.length)\" ng-class=\"{activeField: selected._id == 'submit_field' }\" style=\"border-top: 1px solid #ddd; margin-right: -13% ;margin-left: -13%; padding-bottom: 25vh\"><button ng-focus=\"setActiveField('submit_field', myform.form_fields.length)\" class=\"Button btn btn-success col-sm-2\" v-busy=loading v-busy-label=\"Please wait\" v-pressable ng-disabled=loading ng-click=submitForm() style=\"font-size: 1.6em; margin-left: 1em; margin-top: 1em\">Submit</button><div class=col-sm-2 style=\"font-size: 75%; margin-top:2.5em\"><small>press ENTER</small></div></div><section ng-if=!myform.hideFooter class=\"navbar navbar-fixed-bottom\" style=\"background-color:rgba(242,242,242,0.5); padding-top:15px\"><div class=container-fluid><div class=row><div class=\"col-sm-5 col-md-6 col-xs-5\" ng-show=!myform.submitted><p class=lead>{{myform | formValidity}} out of {{form_fields_count}} answered</p></div><div class=\"col-md-6 col-md-offset-0 col-sm-offset-2 col-sm-3 col-xs-offset-1 col-xs-6 row\"><div class=\"col-md-4 col-md-offset-2 hidden-sm hidden-xs\" ng-if=!authentication.isAuthenticated()><a href=/#!/forms class=\"btn btn-default\">Create a TellForm</a></div><div class=\"col-md-4 col-md-offset-2 hidden-sm hidden-xs\" ng-if=authentication.isAuthenticated()><a href=/#!/forms/{{myform._id}}/admin/create class=\"btn btn-default\">Edit this TellForm</a></div><div class=\"col-md-4 col-sm-10 col-md-offset-0 col-sm-offset-2 col-xs-12\"><button class=\"btn btn-info btn-lg\" id=focusDownButton ng-click=nextField() ng-disabled=\"selected.index > myform.form_fields.length-1\"><i class=\"fa fa-chevron-down\"></i></button> <button class=\"btn btn-info btn-lg\" id=focusUpButton ng-click=prevField() ng-disabled=\"selected.index == 0\"><i class=\"fa fa-chevron-up\"></i></button></div></div></div></div></section></div><div ng-if=\"myform.submitted && !loading\" class=form-submitted><div class=\"field row text-center\"><div class=\"col-xs-6 col-xs-offset-3 text-center\">Form entry successfully submitted!</div></div><div class=\"row form-actions\"><p class=\"text-center col-xs-4 col-xs-offset-4\"><button ng-click=reloadForm() class=\"btn btn-info\" type=button><a style=\"color:white; font-size: 1.6em; text-decoration: none\">Go back to Form</a></button></p></div></div>");
|
||||||
$templateCache.put("../public/modules/users/views/authentication/access-denied.client.view.html",
|
$templateCache.put("../public/modules/users/views/authentication/access-denied.client.view.html",
|
||||||
"<section class=\"row text-center auth\"><h3 class=col-md-12>You need to be logged in to access this page</h3><a href=/#!/sigin class=col-md-12>Login</a></section>");
|
"<section class=\"row text-center auth\"><h3 class=col-md-12>You need to be logged in to access this page</h3><a href=/#!/sigin class=col-md-12>Login</a></section>");
|
||||||
$templateCache.put("../public/modules/users/views/authentication/signin.client.view.html",
|
$templateCache.put("../public/modules/users/views/authentication/signin.client.view.html",
|
||||||
|
|
Loading…
Reference in a new issue