2015-06-29 22:51:29 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Setting up route
|
2016-04-28 23:47:50 +00:00
|
|
|
angular.module('forms').config(['$stateProvider',
|
|
|
|
|
2016-04-27 20:02:01 +00:00
|
|
|
function($stateProvider) {
|
2015-06-29 22:51:29 +00:00
|
|
|
// Forms state routing
|
|
|
|
$stateProvider.
|
|
|
|
state('listForms', {
|
|
|
|
url: '/forms',
|
2016-04-27 21:38:56 +00:00
|
|
|
templateUrl: 'modules/forms/admin/views/list-forms.client.view.html'
|
2015-06-29 22:51:29 +00:00
|
|
|
}).
|
2015-09-15 22:21:49 +00:00
|
|
|
state('submitForm', {
|
|
|
|
url: '/forms/:formId',
|
2016-04-27 21:38:56 +00:00
|
|
|
templateUrl: 'modules/forms/base/views/submit-form.client.view.html',
|
2015-09-15 22:21:49 +00:00
|
|
|
data: {
|
2016-04-28 01:40:51 +00:00
|
|
|
hideNav: true
|
2015-09-15 22:21:49 +00:00
|
|
|
},
|
2015-10-30 18:40:02 +00:00
|
|
|
resolve: {
|
|
|
|
Forms: 'Forms',
|
|
|
|
myForm: function (Forms, $stateParams) {
|
|
|
|
return Forms.get({formId: $stateParams.formId}).$promise;
|
2016-04-28 01:40:51 +00:00
|
|
|
}
|
2015-10-30 18:40:02 +00:00
|
|
|
},
|
2016-04-22 19:36:34 +00:00
|
|
|
controller: 'SubmitFormController',
|
|
|
|
controllerAs: 'ctrl'
|
2015-11-06 17:25:30 +00:00
|
|
|
}).state('viewForm', {
|
2015-06-29 22:51:29 +00:00
|
|
|
url: '/forms/:formId/admin',
|
2016-04-27 20:02:01 +00:00
|
|
|
templateUrl: 'modules/forms/views/admin-form.client.view.html',
|
2015-07-21 23:25:45 +00:00
|
|
|
data: {
|
|
|
|
permissions: [ 'editForm' ]
|
2015-10-30 18:40:02 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
Forms: 'Forms',
|
|
|
|
myForm: function (Forms, $stateParams) {
|
|
|
|
return Forms.get({formId: $stateParams.formId}).$promise;
|
2016-04-28 01:40:51 +00:00
|
|
|
}
|
2015-10-30 18:40:02 +00:00
|
|
|
},
|
|
|
|
controller: 'AdminFormController'
|
2015-11-06 17:25:30 +00:00
|
|
|
}).state('viewForm.configure', {
|
|
|
|
url: '/configure',
|
2016-04-27 20:02:01 +00:00
|
|
|
templateUrl: 'modules/forms/views/adminTabs/configure.html'
|
2015-11-06 17:25:30 +00:00
|
|
|
}).state('viewForm.design', {
|
|
|
|
url: '/design',
|
2016-04-27 20:02:01 +00:00
|
|
|
templateUrl: 'modules/forms/views/adminTabs/design.html'
|
2015-11-06 17:25:30 +00:00
|
|
|
}).state('viewForm.analyze', {
|
|
|
|
url: '/analyze',
|
2016-04-28 23:47:50 +00:00
|
|
|
templateUrl: 'modules/forms/views/adminTabs/analyze.html',
|
2015-11-06 17:25:30 +00:00
|
|
|
}).state('viewForm.create', {
|
|
|
|
url: '/create',
|
2016-04-27 20:02:01 +00:00
|
|
|
templateUrl: 'modules/forms/views/adminTabs/create.html'
|
2015-11-06 17:25:30 +00:00
|
|
|
});
|
2015-06-29 22:51:29 +00:00
|
|
|
}
|
2016-04-10 21:23:13 +00:00
|
|
|
]);
|