fixed form preview issues
This commit is contained in:
parent
18cde5213d
commit
3f20bcf712
|
@ -174,7 +174,7 @@ exports.uploadTemp = function(req, res) {
|
|||
*/
|
||||
exports.readForRender = function(req, res) {
|
||||
var newForm = req.form.toJSON();
|
||||
|
||||
console.log(req.user);
|
||||
if (!newForm.isLive && !req.user) {
|
||||
return res.status(404).send({
|
||||
message: 'Form Does Not Exist'
|
||||
|
|
5
config/env/all.js
vendored
5
config/env/all.js
vendored
|
@ -28,6 +28,7 @@ module.exports = {
|
|||
reCAPTCHA_Key: process.env.reCAPTCHA_KEY || '',
|
||||
|
||||
signupDisabled: (process.env.SIGNUP_DISABLED === "TRUE"),
|
||||
disableClusterMode: (process.env.DISABLE_CLUSTER_MODE === "TRUE"),
|
||||
baseUrl: '',
|
||||
tempUserCollection: 'temporary_users',
|
||||
|
||||
|
@ -57,10 +58,10 @@ module.exports = {
|
|||
secure: false,
|
||||
// Only set the maxAge to null if the cookie shouldn't be expired
|
||||
// at all. The cookie will expunge when the browser is closed.
|
||||
maxAge: null
|
||||
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
||||
// To set the cookie in a specific domain uncomment the following
|
||||
// setting:
|
||||
// domain: 'tellform.com'
|
||||
//domain: process.env.COOKIE_SESSION_URL || process.env.BASE_URL || '.tellform.com'
|
||||
},
|
||||
|
||||
/*
|
||||
|
|
4
config/env/development.js
vendored
4
config/env/development.js
vendored
|
@ -19,9 +19,7 @@ module.exports = {
|
|||
// stream: 'access.log'
|
||||
}
|
||||
},
|
||||
sessionCookie: {
|
||||
//domain: process.env.BASE_URL || 'http://localhost:3000'
|
||||
},
|
||||
|
||||
facebook: {
|
||||
clientID: process.env.FACEBOOK_ID || 'APP_ID',
|
||||
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
|
||||
|
|
4
config/env/production.js
vendored
4
config/env/production.js
vendored
|
@ -18,7 +18,9 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
sessionCookie: {
|
||||
//domain: process.env.BASE_URL || 'tellform.com'
|
||||
secure: false,
|
||||
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
||||
domain: process.env.BASE_URL || '.tellform.com'
|
||||
},
|
||||
assets: {
|
||||
bower_js: 'public/dist/vendor.min.js',
|
||||
|
|
|
@ -16,7 +16,7 @@ module.exports = function (app, db) {
|
|||
io = socketio(config.socketPort, { transports: ['websocket', 'polling'] });
|
||||
}
|
||||
|
||||
if(process.env.DISABLE_CLUSTER_MODE !== "TRUE"){
|
||||
if(config.disableClusterMode){
|
||||
var redis = require('socket.io-redis');
|
||||
io.adapter(redis( process.env.REDIS_URL || { host: process.env.REDIS_DB_PORT_6379_TCP_ADDR || '127.0.0.1' , port: process.env.REDIS_DB_PORT_6379_TCP_PORT || 6379 }));
|
||||
}
|
||||
|
|
5
public/dist/application.js
vendored
5
public/dist/application.js
vendored
|
@ -2252,6 +2252,7 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo
|
|||
|
||||
$scope.formURL = "/#!/forms/" + $scope.myform._id;
|
||||
|
||||
if ($scope.myform.isLive) {
|
||||
if ($window.subdomainsDisabled == true) {
|
||||
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + '/view' + $scope.formURL;
|
||||
} else {
|
||||
|
@ -2261,6 +2262,10 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo
|
|||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host.split('.').slice(1, 3).join('.') + $scope.formURL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + $scope.formURL;
|
||||
}
|
||||
|
||||
|
||||
var refreshFrame = $scope.refreshFrame = function(){
|
||||
if(document.getElementById('iframe')) {
|
||||
|
|
4
public/dist/application.min.js
vendored
4
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -25,6 +25,7 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo
|
|||
|
||||
$scope.formURL = "/#!/forms/" + $scope.myform._id;
|
||||
|
||||
if ($scope.myform.isLive) {
|
||||
if ($window.subdomainsDisabled == true) {
|
||||
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + '/view' + $scope.formURL;
|
||||
} else {
|
||||
|
@ -34,6 +35,10 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo
|
|||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host.split('.').slice(1, 3).join('.') + $scope.formURL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + $scope.formURL;
|
||||
}
|
||||
|
||||
|
||||
var refreshFrame = $scope.refreshFrame = function(){
|
||||
if(document.getElementById('iframe')) {
|
||||
|
|
Loading…
Reference in a new issue