fixed listForm view

This commit is contained in:
David Baldwynn 2016-04-10 17:23:13 -04:00
parent 3b073f5ef1
commit b7e00a276e
7 changed files with 14 additions and 13 deletions

View file

@ -128,7 +128,7 @@ UserSchema.plugin(mUtilities.timestamp, {
//Create folder for user's pdfs
UserSchema.pre('save', function (next) {
this.username = this.email;
if(process.env.NODE_ENV === 'development'){
if(process.env.NODE_ENV === 'local-development'){
var newDestination = path.join(config.pdfUploadPath, this.username.replace(/ /g,'')),
stat = null;

View file

@ -1,7 +1,7 @@
'use strict';
module.exports = {
baseUrl: 'http://localhost:3000',
baseUrl: process.env.BASE_URL || 'http://localhost:3000',
db: {
uri: 'mongodb://localhost/mean-dev',
options: {

View file

@ -1,7 +1,7 @@
'use strict';
module.exports = {
baseUrl: 'dev.tellform.com',
baseUrl: process.env.BASE_URL || 'dev.tellform.com',
db: {
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/mean',
options: {
@ -19,7 +19,7 @@ module.exports = {
}
},
sessionCookie: {
domain: 'dev.tellform.com'
domain: process.env.BASE_URL || 'dev.tellform.com'
},
assets: {
css: 'public/dist/application.min.css',

View file

@ -15,6 +15,8 @@ module.exports = function() {
* We'll Look for a valid NODE_ENV variable and if one cannot be found load the development NODE_ENV
*/
var environmentFiles = glob.sync('./config/env/' + process.env.NODE_ENV + '.js');
console.log('process.env.MAILER_EMAIL_ID: '+process.env.MAILER_EMAIL_ID );
if (!environmentFiles.length) {
if (process.env.NODE_ENV) {
console.error(chalk.red('No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead'));

View file

@ -2,6 +2,8 @@
module.exports = function(grunt) {
require('jit-grunt')(grunt);
grunt.loadNpmTasks('grunt-env');
// Unified Watch Object
var watchFiles = {
@ -147,8 +149,8 @@ module.exports = function(grunt) {
secure: {
NODE_ENV: 'secure'
},
options: {
src: 'ENV.json'
default: {
src: '.env'
}
},
mochaTest: {
@ -280,7 +282,7 @@ module.exports = function(grunt) {
grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']);
// Default task(s).
grunt.registerTask('default', ['lint', 'html2js:main', 'concurrent:default']);
grunt.registerTask('default', ['lint', 'html2js:main', 'env:default', 'concurrent:default']);
// Debug task.
grunt.registerTask('debug', ['lint', 'html2js:main', 'concurrent:debug']);

View file

@ -8,10 +8,7 @@ angular.module('forms').config(['$stateProvider',
$stateProvider.
state('listForms', {
url: '/forms',
templateUrl: 'modules/forms/views/list-forms.client.view.html',
data: {
permissions: [ 'editForm' ]
}
templateUrl: 'modules/forms/views/list-forms.client.view.html'
}).
state('submitForm', {
url: '/forms/:formId',
@ -53,4 +50,4 @@ angular.module('forms').config(['$stateProvider',
templateUrl: 'modules/forms/views/adminTabs/create.html'
});
}
]);
]);

View file

@ -294,7 +294,7 @@ angular.module('NodeForm.templates', []).run(['$templateCache', function($templa
$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>");
$templateCache.put("../public/modules/forms/views/directiveViews/form/submit-form.client.view.html",
"<section class=\"overlay submitform\" ng-if=selected._id.length ng-click=hideOverlay()></section><div ng-show=\"!myform.submitted && myform.startPage.showStart\" class=form-submitted><div class=\"field row\"><div class=\"col-xs-12 text-center\" style=\"overflow-wrap: break-word\"><h1>{{myform.startPage.introTitle}}</h1></div><div class=\"col-xs-10 col-xs-offset-1 text-left\" style=\"overflow-wrap: break-word\"><p style=color:#ddd>{{myform.startPage.introParagraph}}</p></div></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 btn-info\" type=button ng-style=\"{'background-color':button.bgColor, 'color':button.color}\"><a href={{button.url}} style=\"font-size: 1.6em; text-decoration: none; color: inherit\">{{button.text}}</a></button></p></div><div class=\"row form-actions\"><button ng-click=exitStartPage() class=\"btn btn-info col-md-8 col-md-offset-2 col-lg-4 col-lg-offset-4\" type=button><a style=\"color:white; font-size: 1.6em; text-decoration: none\">Continue to Form</a></button></div></div><div cg-busy=\"{promise:submitPromise,message:'Submitting form...',wrapperClass:'busy-submitting-wrapper',backdrop:true}\" ng-show=\"!myform.submitted && !myform.startPage.showStart\"><div class=\"field row\" style=padding-bottom:5em><div class=\"col-sm-10 col-sm-offset-1\"><h1>{{ myform.title }} <span style=\"font-size:0.8em; color: #bbb\" ng-if=!myform.isLive>(private preview)</span></h1><hr></div></div><div class=row><form name=myForm 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 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><hr><div class=\"row form-actions\"><button class=\"btn btn-success col-sm-2 col-sm-offset-5\" type=button ng-disabled=myform.$invalid ng-click=submitForm() style=\"font-size: 1.6em\">Submit</button></div><section ng-if=!myform.hideFooter class=\"navbar navbar-fixed-bottom hidden-xs\" style=\"background-color:rgba(242,242,242,0.5); padding-top:15px\"><div class=container><div class=row><div class=\"col-xs-4 col-xs-offset-4 col-sm-4 col-sm-offset-4 text-center col-md-3 col-md-offset-0\" ng-show=!myform.submitted><p class=lead>{{myform | formValidity}} out of {{myform.visible_form_fields.length}} answered</p></div><div class=\"hidden-xs hidden-sm col-md-6 col-md-offset-3 row\"><div class=\"col-md-4 col-md-offset-2\" 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\" ng-if=authentication.isAuthenticated() class=\"hidden-sm hidden-xs\"><a href=/#!/forms/{{myform._id}}/admin/create class=\"btn btn-default\">Edit this TellForm</a></div><div class=\"col-md-1 col-md-offset-2\" style=padding-left:5px class=\"hidden-sm hidden-xs\"><button class=\"btn btn-info\" id=focusDownButton ng-click=nextField() ng-disabled=\"selected.index == myform.form_fields.length-1\">\\/</button></div><div class=col-md-1 class=\"hidden-sm hidden-xs\"><button class=\"btn btn-info\" id=focusUpButton ng-click=prevField() ng-disabled=\"selected.index == 0\">/\\</button></div></div></div></div></section></div><div ng-show=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=selected._id.length ng-click=hideOverlay()></section><div ng-show=\"!myform.submitted && myform.startPage.showStart\" class=form-submitted style=\"margin-top 35vh\"><div class=\"field row\"><div class=\"col-xs-12 text-center\" style=\"overflow-wrap: break-word\"><h1 style=\"font-weight: 600; 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=\"color:grey; 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 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 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 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><hr><div class=\"row form-actions\" id=submit_field ng-click=\"setActiveField('submit_field', myform.form_fields.length+1)\" ng-class=\"{activeField: selected._id == myform.form_fields.length+1 }\" 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+1)\" class=\"btn btn-success col-sm-2 col-sm-offset-5\" type=button ng-disabled=myform.$invalid ng-click=submitForm() style=\"font-size: 1.6em; margin-left: 20px; margin-top: 20px\">Submit</button></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><div class=row><div class=\"col-xs-8 col-sm-offset-4 col-sm-4 col-sm-offset-4 text-center col-md-3 col-md-offset-0\" ng-show=!myform.submitted><p class=lead>{{myform | formValidity}} out of {{myform.visible_form_fields.length}} answered</p></div><div class=\"col-md-6 col-md-offset-3 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-xs-1 col-md-offset-2\" style=padding-left:5px class=\"hidden-sm hidden-xs\"><button class=\"btn btn-info\" id=focusDownButton ng-click=nextField() ng-disabled=\"selected.index == myform.form_fields.length-1\"><i class=\"fa fa-chevron-down\"></i></button></div><div class=col-xs-1><button class=\"btn btn-info\" 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-show=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>");
$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>");
$templateCache.put("../public/modules/users/views/authentication/signin.client.view.html",