From 64ccb4488e09010174d6bcdbb63319237ab8d946 Mon Sep 17 00:00:00 2001 From: aditya-nambiar Date: Sat, 9 Aug 2014 13:14:19 +0530 Subject: [PATCH] Tab structure fixed --- js/angular-crmMailingAB.js | 31 ++++-- partials/abtesting/main.html | 209 ++--------------------------------- 2 files changed, 28 insertions(+), 212 deletions(-) diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index a08ff3e0f0..e0c35f2c7f 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -105,7 +105,8 @@ }) crmMailingAB.controller('TabsDemoCtrl', function ($scope, crmApi,selectedABTest,$sce) { - $scope.abId=""; + $scope.partialUrl = partialUrl; + $scope.abId = ""; $scope.whatnext=2; $scope.currentABTest=selectedABTest $scope.groups = CRM.crmMailing.groupNames; @@ -121,6 +122,7 @@ } + if($scope.currentABTest.just_created != 1){ console.log("Prithvi"); console.log($scope.currentABTest); @@ -328,7 +330,15 @@ $scope.whatnext = par.toString() }; + $scope.tab_upd = function(){ + $scope.tab_val = $scope.tab_val + 1; + $scope.max_tab=Math.max($scope.tab_val, $scope.max_tab); + + }; + $scope.tab_upd_dec = function(){ + $scope.tab_val = $scope.tab_val - 1; + } $scope.setdate = function (par) { console.log("called") console.log("av " + par) @@ -512,9 +522,9 @@ // responsible for registering DOM listeners as well as updating the DOM link: function (scope, element, attrs) { - $(element).parent().parent().parent().parent().parent().tabs(scope.$eval(attrs.nexttab)); + $(element).parent().parent().parent().parent().parent().parent().tabs(scope.$eval(attrs.nexttab)); var myarr = new Array(1, 2, 3) - $(element).parent().parent().parent().parent().parent().tabs({disabled: myarr}); + $(element).parent().parent().parent().parent().parent().parent().tabs({disabled: myarr}); $(element).on("click", function () { if(scope.tab_val==0){ @@ -537,15 +547,16 @@ } - scope.tab_val = scope.tab_val + 1; + scope.tab_upd(); - scope.max_tab = Math.max(scope.tab_val, scope.max_tab); + console.log("kurund "+scope.tab_val); + var myArray1 = new Array(); for (var i = scope.max_tab + 1; i < 4; i++) { myArray1.push(i); } - $(element).parent().parent().parent().parent().parent().tabs("option", "disabled", myArray1); - $(element).parent().parent().parent().parent().parent().tabs("option", "active", scope.tab_val); + $(element).parent().parent().parent().parent().parent().parent().tabs("option", "disabled", myArray1); + $(element).parent().parent().parent().parent().parent().parent().tabs("option", "active", scope.tab_val); scope.$apply(); console.log("Adir"); }); @@ -564,14 +575,14 @@ $(element).on("click", function () { var temp = scope.tab_val - 1; - scope.tab_val = scope.tab_val - 1; - + scope.tab_upd_dec(); + scope.$apply(); console.log(temp); if (temp == 3) { } else { - $(element).parent().parent().parent().parent().parent().tabs("option", "active", temp); + $(element).parent().parent().parent().parent().parent().parent().tabs("option", "active", temp); } scope.$apply(); diff --git a/partials/abtesting/main.html b/partials/abtesting/main.html index 8ec8210cfa..2a0b78f098 100644 --- a/partials/abtesting/main.html +++ b/partials/abtesting/main.html @@ -1,7 +1,6 @@
{{tab_val}}
- {{currentABTest.mailing_id_b}}
- {{currentABTest.mailing_id_a}}
+
    @@ -13,211 +12,17 @@
- -
-

What would you like to Name the Test ?


-


- -

What would you like to test ?



- -   Subject Lines

-   From Names

-   Two different Emails

-   -
-
- - -
+
-
- -
-
- -
-
-
-
- -
-
- +
+
- -
-

Select the groups you would like to add


- - -  
- -



- {{incGroup}}
{{excGroup}}
- {{incGroupids}}
{{excGroupids}}
- -

Select the size of your test group


-   Percentage Selected - {{currentABTest.group_percentage}}% - -
- -

How will the winner be decided


-   Open

-   - Total Unique Clicks

-   Total - Clicks on a particular link

- -

Declare the winner by when?


- - - - - - - - - - - -
Date - - Time - -
- -
- Enter the time in the 12:32:45 format where 12 is the hour, 32 the minutes and 45 the seconds. -
-
-
- - -
-
-
- -
+
-
- -

Details


- - - - - - - - - - - - - - - - - - - - - - - - - - -
Test Criteria{{template.name}}
Groups Included{{incGroup}}
Groups Excluded{{excGroup}}
Size of Test Group{{currentABTest.group_percentage}}
Winner Criteria{{winner_criteria}}
Declare Winner By{{currentABTest.date}} Date   {{currentABTest.time}} Time
-

Preview Mail

- - -
- -
- -
-
- -
- - -
-
-

Send Test Mails

- - - - -

When to Start


- -
- Now   - Later - -     -
- - -

- -
- -
-
-
- -
-
-
- -
- +
+
\ No newline at end of file -- 2.25.1