From 798d28d92d0fd001342e2e1c07a1dd516d731720 Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Tue, 31 Oct 2017 10:36:01 -0700 Subject: [PATCH] added routable tabs for configure panel --- .../forms/admin/config/i18n/english.js | 2 +- .../admin-form.client.controller.js | 2 +- .../configure-form.client.directive.js | 29 ++- .../adminTabs/configureTabs/general.html | 165 ++++++++++++++++ .../respondent-notifications.html | 164 ++++++++++++++++ .../configureTabs/self-notifications.html | 165 ++++++++++++++++ .../form/configure-form.client.view.html | 182 +----------------- .../forms/config/forms.client.routes.js | 18 +- 8 files changed, 540 insertions(+), 187 deletions(-) create mode 100644 public/modules/forms/admin/views/adminTabs/configureTabs/general.html create mode 100644 public/modules/forms/admin/views/adminTabs/configureTabs/respondent-notifications.html create mode 100644 public/modules/forms/admin/views/adminTabs/configureTabs/self-notifications.html diff --git a/public/modules/forms/admin/config/i18n/english.js b/public/modules/forms/admin/config/i18n/english.js index c6189d9f..20e4a966 100644 --- a/public/modules/forms/admin/config/i18n/english.js +++ b/public/modules/forms/admin/config/i18n/english.js @@ -20,7 +20,7 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid EMAIL_NOTIFICATION_RECIPIENTS: 'Email Notification Recipients', GENERAL_TAB: 'General', SELF_NOTIFICATIONS_TAB: 'Self notifications', - RESPONDANT_NOTIFICATIONS_TAB: 'Respondent notifications', + RESPONDENT_NOTIFICATIONS_TAB: 'Respondent notifications', //List Forms View CREATE_A_NEW_FORM: 'Create a new form', diff --git a/public/modules/forms/admin/controllers/admin-form.client.controller.js b/public/modules/forms/admin/controllers/admin-form.client.controller.js index 1743e623..82a0be1a 100644 --- a/public/modules/forms/admin/controllers/admin-form.client.controller.js +++ b/public/modules/forms/admin/controllers/admin-form.client.controller.js @@ -50,7 +50,7 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo }, { heading: $filter('translate')('CONFIGURE_TAB'), - route: 'viewForm.configure' + route: 'viewForm.configure.general' }, { heading: $filter('translate')('ANALYZE_TAB'), diff --git a/public/modules/forms/admin/directives/configure-form.client.directive.js b/public/modules/forms/admin/directives/configure-form.client.directive.js index fe60f778..2f929bc3 100644 --- a/public/modules/forms/admin/directives/configure-form.client.directive.js +++ b/public/modules/forms/admin/directives/configure-form.client.directive.js @@ -1,23 +1,36 @@ 'use strict'; -angular.module('forms').directive('configureFormDirective', ['$rootScope', '$http', 'Upload', 'CurrentForm', - function ($rootScope, $http, Upload, CurrentForm) { +angular.module('forms').directive('configureFormDirective', ['$rootScope', '$filter', + function ($rootScope, $filter) { return { templateUrl: 'modules/forms/admin/views/directiveViews/form/configure-form.client.view.html', restrict: 'E', scope: { - myform:'=', - user:'=', - pdfFields:'@', - formFields:'@' + myform:'=' }, controller: function($scope){ - $scope.log = ''; $scope.languages = $rootScope.languages; - $scope.resetForm = $rootScope.resetForm; $scope.update = $rootScope.update; + $scope.configureTabs = [ + { + heading: $filter('translate')('GENERAL_TAB'), + route: 'viewForm.configure.general' + }, + { + heading: $filter('translate')('SELF_NOTIFICATIONS_TAB'), + route: 'viewForm.configure.self_notifications' + }, + { + heading: $filter('translate')('RESPONDENT_NOTIFICATIONS_TAB'), + route: 'viewForm.configure.respondent_notifications' + } + ]; + + $scope.go = function(route){ + $state.go(route); + }; } }; } diff --git a/public/modules/forms/admin/views/adminTabs/configureTabs/general.html b/public/modules/forms/admin/views/adminTabs/configureTabs/general.html new file mode 100644 index 00000000..a20176b9 --- /dev/null +++ b/public/modules/forms/admin/views/adminTabs/configureTabs/general.html @@ -0,0 +1,165 @@ + +
+
+
+
+
{{ 'FORM_NAME' | translate }}
+
+ +
+ +
+
+ +
+
+
{{ 'FORM_STATUS' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'ENABLE_EMAIL_NOTIFICATIONS' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'EMAIL_NOTIFICATION_RECIPIENTS' | translate }}
+
+ +
+ +
+
+ + +
+
{{ 'LANGUAGE' | translate }}
+
+ + * {{ 'REQUIRED_FIELD' | translate }} +
+
+
+
+
+
+
{{ 'GA_TRACKING_CODE' | translate }}
+
+ +
+ +
+
+
+
+
{{ 'DISPLAY_FOOTER' | translate }}
+
+ +
+ + + +
+
+ +
+
+
{{ 'DISPLAY_START_PAGE' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'DISPLAY_END_PAGE' | translate }}
+
+ +
+ + + + + +
+
+
+
\ No newline at end of file diff --git a/public/modules/forms/admin/views/adminTabs/configureTabs/respondent-notifications.html b/public/modules/forms/admin/views/adminTabs/configureTabs/respondent-notifications.html new file mode 100644 index 00000000..161faedb --- /dev/null +++ b/public/modules/forms/admin/views/adminTabs/configureTabs/respondent-notifications.html @@ -0,0 +1,164 @@ +
+
+
+
+
{{ 'FORM_NAME' | translate }}
+
+ +
+ +
+
+ +
+
+
{{ 'FORM_STATUS' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'ENABLE_EMAIL_NOTIFICATIONS' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'EMAIL_NOTIFICATION_RECIPIENTS' | translate }}
+
+ +
+ +
+
+ + +
+
{{ 'LANGUAGE' | translate }}
+
+ + * {{ 'REQUIRED_FIELD' | translate }} +
+
+
+
+
+
+
{{ 'GA_TRACKING_CODE' | translate }}
+
+ +
+ +
+
+
+
+
{{ 'DISPLAY_FOOTER' | translate }}
+
+ +
+ + + +
+
+ +
+
+
{{ 'DISPLAY_START_PAGE' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'DISPLAY_END_PAGE' | translate }}
+
+ +
+ + + + + +
+
+
+
\ No newline at end of file diff --git a/public/modules/forms/admin/views/adminTabs/configureTabs/self-notifications.html b/public/modules/forms/admin/views/adminTabs/configureTabs/self-notifications.html new file mode 100644 index 00000000..a20176b9 --- /dev/null +++ b/public/modules/forms/admin/views/adminTabs/configureTabs/self-notifications.html @@ -0,0 +1,165 @@ + +
+
+
+
+
{{ 'FORM_NAME' | translate }}
+
+ +
+ +
+
+ +
+
+
{{ 'FORM_STATUS' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'ENABLE_EMAIL_NOTIFICATIONS' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'EMAIL_NOTIFICATION_RECIPIENTS' | translate }}
+
+ +
+ +
+
+ + +
+
{{ 'LANGUAGE' | translate }}
+
+ + * {{ 'REQUIRED_FIELD' | translate }} +
+
+
+
+
+
+
{{ 'GA_TRACKING_CODE' | translate }}
+
+ +
+ +
+
+
+
+
{{ 'DISPLAY_FOOTER' | translate }}
+
+ +
+ + + +
+
+ +
+
+
{{ 'DISPLAY_START_PAGE' | translate }}
+
+ +
+ + + + + +
+
+ +
+
+
{{ 'DISPLAY_END_PAGE' | translate }}
+
+ +
+ + + + + +
+
+
+
\ No newline at end of file diff --git a/public/modules/forms/admin/views/directiveViews/form/configure-form.client.view.html b/public/modules/forms/admin/views/directiveViews/form/configure-form.client.view.html index a85814f4..c203ec0f 100644 --- a/public/modules/forms/admin/views/directiveViews/form/configure-form.client.view.html +++ b/public/modules/forms/admin/views/directiveViews/form/configure-form.client.view.html @@ -1,180 +1,12 @@
- - - -
-
-
-
-
{{ 'FORM_NAME' | translate }}
-
- -
- -
-
- -
-
-
{{ 'FORM_STATUS' | translate }}
-
- -
- - - - - -
-
- -
-
-
{{ 'ENABLE_EMAIL_NOTIFICATIONS' | translate }}
-
- -
- - - - - -
-
- -
-
-
{{ 'EMAIL_NOTIFICATION_RECIPIENTS' | translate }}
-
- -
- -
-
- - -
-
{{ 'LANGUAGE' | translate }}
-
- - * {{ 'REQUIRED_FIELD' | translate }} -
-
-
-
-
-
-
{{ 'GA_TRACKING_CODE' | translate }}
-
- -
- -
-
-
-
-
{{ 'DISPLAY_FOOTER' | translate }}
-
- -
- - - -
-
- -
-
-
{{ 'DISPLAY_START_PAGE' | translate }}
-
- -
- - - - - -
-
- -
-
-
{{ 'DISPLAY_END_PAGE' | translate }}
-
- -
- - - - - -
-
-
-
-
- - - - - - -
+
+ + +
+
+
+
diff --git a/public/modules/forms/config/forms.client.routes.js b/public/modules/forms/config/forms.client.routes.js index 70cabd59..fd5aeb3f 100644 --- a/public/modules/forms/config/forms.client.routes.js +++ b/public/modules/forms/config/forms.client.routes.js @@ -64,10 +64,24 @@ angular.module('forms').config(['$stateProvider', }).state('viewForm.create', { url: '/create', templateUrl: 'modules/forms/admin/views/adminTabs/create.html' - }).state('viewForm.configure', { + }) + + .state('viewForm.configure', { + abstract: true, url: '/configure', templateUrl: 'modules/forms/admin/views/adminTabs/configure.html' - }).state('viewForm.design', { + }).state('viewForm.configure.general', { + url: '/general', + templateUrl: 'modules/forms/admin/views/adminTabs/configureTabs/general.html' + }).state('viewForm.configure.self_notifications', { + url: '/self_notifications', + templateUrl: 'modules/forms/admin/views/adminTabs/configureTabs/self_notifications.html' + }).state('viewForm.configure.respondent_notifications', { + url: '/respondent_notifications', + templateUrl: 'modules/forms/admin/views/adminTabs/configureTabs/respondent_notifications.html' + }) + + .state('viewForm.design', { url: '/design', templateUrl: 'modules/forms/admin/views/adminTabs/design.html' }).state('viewForm.share', {