diff --git a/app/controllers/users/users.authentication.server.controller.js b/app/controllers/users/users.authentication.server.controller.js index 46213490..5be06c43 100755 --- a/app/controllers/users/users.authentication.server.controller.js +++ b/app/controllers/users/users.authentication.server.controller.js @@ -190,7 +190,7 @@ exports.signin = function(req, res, next) { */ exports.signout = function(req, res) { if(req.cookies.hasOwnProperty('userLang')){ - res.destroyCookie('userLang'); + res.clearCookie('userLang'); } req.logout(); return res.status(200).send('You have successfully logged out.'); diff --git a/public/dist/application.js b/public/dist/application.js index 0833220a..910d3244 100644 --- a/public/dist/application.js +++ b/public/dist/application.js @@ -664,7 +664,7 @@ ApplicationConfiguration.registerModule('core', ['users']); // Use Application configuration module to register a new module ApplicationConfiguration.registerModule('forms', [ - 'ngFileUpload', 'ui.router.tabs', 'ui.date', 'ui.sortable', + 'ngFileUpload', 'ui.date', 'ui.sortable', 'angular-input-stars', 'users', 'ngclipboard' ]);//, 'colorpicker.module' @TODO reactivate this module diff --git a/public/dist/form_populate_template_cache.js b/public/dist/form_populate_template_cache.js index e89e3c03..3e094dc7 100644 --- a/public/dist/form_populate_template_cache.js +++ b/public/dist/form_populate_template_cache.js @@ -1,4 +1,4 @@ -angular.module('TellForm-Form.form_templates', []).run(['$templateCache', function($templateCache) { +angular.module('TellForm-Form.form_templates', []).run(['$templateCache', function ($templateCache) { "use strict"; $templateCache.put("form_modules/forms/base/views/form-not-found.client.view.html", "

{{ 'FORM_404_HEADER' | translate }}

{{ 'FORM_404_BODY' | translate }}
"); @@ -10,26 +10,26 @@ angular.module('TellForm-Form.form_templates', []).run(['$templateCache', functi $templateCache.put("form_modules/forms/base/views/directiveViews/entryPage/startPage.html", "

{{pageData.introTitle}}

{{pageData.introParagraph}}

"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/date.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/dropdown.html", - "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/hidden.html", ""); $templateCache.put("form_modules/forms/base/views/directiveViews/field/legal.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}


{{field.description}}


"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}


{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/radio.html", - "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/rating.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/statement.html", "

{{field.title}}

{{field.description}}

{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/textarea.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{ 'NEWLINE' | translate }}

{{field.description}}

{{ 'ADD_NEW_LINE_INSTR' | translate }}
{{ 'ENTER' | translate }}
"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/textfield.html", - "

{{index+1}} {{field.title}} ({{ 'OPTIONAL' | translate }})

{{field.description}}

{{ 'ENTER' | translate }}
"); + "

{{index+1}} {{field.title}} ({{ 'OPTIONAL' | translate }})

{{field.description}}

{{ 'ENTER' | translate }}
"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/yes_no.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html", "

{{myform.startPage.introTitle}}

{{myform.startPage.introParagraph}}

{{ 'COMPLETING_NEEDED' | translate:translateAdvancementData }}
{{ 'ENTER' | translate }}

{{ 'ADVANCEMENT' | translate:translateAdvancementData }}

{{ 'FORM_SUCCESS' | translate }}

{{myform.endPage.title}}

{{myform.endPage.paragraph}}

"); }]); diff --git a/public/modules/core/config/core.client.routes.js b/public/modules/core/config/core.client.routes.js index c3d1ad25..9616c61a 100755 --- a/public/modules/core/config/core.client.routes.js +++ b/public/modules/core/config/core.client.routes.js @@ -15,10 +15,13 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope' $rootScope.$stateParams = $stateParams; // add previous state property - $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState) { - $state.previous = fromState; + $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) { + $state.previous = { + state: fromState, + params: fromParams + } - var statesToIgnore = ['home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success']; + var statesToIgnore = ['', 'home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success']; //Redirect to listForms if user is authenticated if(statesToIgnore.indexOf(toState.name) > 0){ diff --git a/public/modules/forms/config/forms.client.routes.js b/public/modules/forms/config/forms.client.routes.js index 13247964..aa38bde0 100644 --- a/public/modules/forms/config/forms.client.routes.js +++ b/public/modules/forms/config/forms.client.routes.js @@ -57,7 +57,10 @@ angular.module('forms').config(['$stateProvider', }); return deferred.promise; - } + }, + formId: ['$stateParams', function ($stateParams) { + return $stateParams.formId; + }] }, controller: 'AdminFormController' }).state('viewForm.configure', { diff --git a/public/modules/forms/forms.client.module.js b/public/modules/forms/forms.client.module.js index ada60435..07d98366 100644 --- a/public/modules/forms/forms.client.module.js +++ b/public/modules/forms/forms.client.module.js @@ -2,6 +2,6 @@ // Use Application configuration module to register a new module ApplicationConfiguration.registerModule('forms', [ - 'ngFileUpload', 'ui.router.tabs', 'ui.date', 'ui.sortable', + 'ngFileUpload', 'ui.date', 'ui.sortable', 'angular-input-stars', 'users', 'ngclipboard' ]);//, 'colorpicker.module' @TODO reactivate this module diff --git a/public/modules/forms/services/forms.client.service.js b/public/modules/forms/services/forms.client.service.js index 15aa1040..b1f3b4eb 100644 --- a/public/modules/forms/services/forms.client.service.js +++ b/public/modules/forms/services/forms.client.service.js @@ -8,6 +8,7 @@ angular.module('forms').factory('GetForms', ['$resource', 'FORM_URL', }, { 'query' : { method: 'GET', + url: '/forms', isArray: true }, 'get' : { diff --git a/public/modules/users/controllers/authentication.client.controller.js b/public/modules/users/controllers/authentication.client.controller.js index b2bb6c89..fffb453c 100755 --- a/public/modules/users/controllers/authentication.client.controller.js +++ b/public/modules/users/controllers/authentication.client.controller.js @@ -8,6 +8,8 @@ angular.module('users').controller('AuthenticationController', ['$scope', '$loca $scope.error = ''; $scope.forms = {}; + var statesToIgnore = ['', 'home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success']; + $scope.signin = function() { if(!$scope.forms.signinForm.$invalid){ User.login($scope.credentials).then( @@ -15,8 +17,8 @@ angular.module('users').controller('AuthenticationController', ['$scope', '$loca Auth.login(response); $scope.user = $rootScope.user = Auth.ensureHasCurrentUser(User); - if($state.previous.name !== 'home' && $state.previous.name !== 'verify' && $state.previous.name !== '') { - $state.go($state.previous.name); + if(statesToIgnore.indexOf($state.previous.state.name) === -1) { + $state.go($state.previous.state.name, $state.previous.params); } else { $state.go('listForms'); }