Listing.html stage 1
authoraditya-nambiar <aditya.nambiar007@gmail.com>
Sun, 27 Jul 2014 13:52:48 +0000 (19:22 +0530)
committeraditya-nambiar <aditya.nambiar007@gmail.com>
Sun, 27 Jul 2014 13:52:48 +0000 (19:22 +0530)
js/angular-crmMailingAB.js
partials/abtesting/list.html
partials/abtesting/main.html

index a26f6d59e0cc84971fac5a594464c6bd82e2689e..3c0b80434cb18eea49afa05003f54b0358e52141 100644 (file)
@@ -53,7 +53,9 @@
   // Add a new record by name.
   // Ex: <crmAddName crm-options="['Alpha','Beta','Gamma']" crm-var="newItem" crm-on-add="callMyCreateFunction(newItem)" />
   crmMailingAB.controller('ListingCtrl', function ($scope, crmApi) {
-    $scope.mailList = CRM.crmMailing.civiMails;
+    $scope.abmailList = CRM.crmMailing.mailingabNames;
+    console.log($scope.abmailList);
+
 
   })
   crmMailingAB.controller('TabsDemoCtrl', function ($scope, crmApi,selectedABTest) {
         $scope.mailB = {};
       }
 
+    $scope.templates =
+      [
+        { name: 'Subject Lines', url: partialUrl('subject_lines.html'),val: 1},
+        { name: 'From Name', url: partialUrl('from_name.html'),val:2},
+        {name: 'Two different Emails', url: partialUrl('two_emails.html'),val:3}
+      ];
+    if(typeof $scope.template == 'undefined'){
+    console.log("adi");
+      $scope.template = $scope.templates[0];
+  }
+    else{
+      console.log("adit "+$scope.currentABTest.testing_criteria_id);
+
+      $scope.template=$scope.templates[$scope.currentABTest.testing_criteria_id-1];
+      console.log($scope.template.val);
+    }
 
     mltokens = CRM.crmMailing.mailTokens;
 
         $scope.tab_val = 3;
       }
     };
-    $scope.templates =
-      [
-        { name: 'Subject Lines', url: partialUrl('subject_lines.html'),val: 1},
-        { name: 'From Name', url: partialUrl('from_name.html'),val:2},
-        {name: 'Two different Emails', url: partialUrl('two_emails.html'),val:3}
-      ];
-    $scope.template = $scope.templates[0];
 
     $scope.slide_value = 0;
 
     return{
       restrict: 'AE',
       link: function (scope, element, attrs) {
-        if(typeof scope.currentABTest.group_percentage != undefined){
+        if(typeof scope.currentABTest.group_percentage != 'undefined'){
           console.log("Yay");
           $(element).slider({value:scope.currentABTest.group_percentage});
         }
index c964872896daff9c0089b5090fce243295592103..cacfe10cabf9fbf0ca69fd9a7fa14a695fdf019f 100644 (file)
@@ -1,26 +1,31 @@
+<!--
+Controller: CaseTypeListsCtrl
+Required vars: caseTypes
+-->
 <div id="help">
-  All partially completed and completed mail are listed here
+  A Case Type describes a group of related tasks, interactions, or processes.
 </div>
 
-<table class="form-layout">
+<table class="display">
   <thead>
   <tr>
-    <th>Mailing Name</th>
-    <!--    <th>Status</th>  -->
-    <th>Created By</th>
-    <th>Created Date</th>
-    <th>Sent By</th>
+    <th>Title</th>
+    <th>Id</th>
+    <th>Progress</th>
+
     <th></th>
   </tr>
   </thead>
-  <tr ng-repeat="mailab in mailingabNames">
-    <td>{{mailab.id}}</td>
-    <!--    <td>{{mailStatus[{{$index}}]}}</td>  -->
-
-    <td><a ng-href="#/mailing/abtesting/{{mailab.id}}">Edit</a</td>
+  <tbody>
+  <tr ng-repeat="ab in abmailList">
+    <td>{{ab.id}}</td>
+    <td>{{ab.id}}</td>
+    <td>{{ab.id}}</td>
+    <td><a class="action-item crm-hover-button" ng-href="#/mailing/abtesting/{{ab.id}}">Edit</a></td>
   </tr>
+  </tbody>
 </table>
 
-<div class="action-link">
-  <a ng-href="#/mailing/abtesting/new" class="button"><span>New Mailing</span></a>
-</div>
+<div class="crm-submit-buttons">
+  <a ng-href="#/mailing/abtesting/new" class="button"><span><div class="icon add-icon"></div>New A/B Test</span></a>
+</div>
\ No newline at end of file
index 2a7b9346ccfdf90e01dec17f9888b4d52eb2da53..a612dd3a04d9da2863b4fc22b3917e541e54c4d9 100644 (file)
@@ -1,5 +1,6 @@
 <div>
-  {{tab_val}}
+  {{tab_val}}<br>
+  
   <div ui-jq="tabs" id="alltabs">
     <ul>
 
@@ -15,9 +16,9 @@
 
         <h3> What would you like to test ?</h3><br><br>
 
-        &nbsp <input type="radio" ng-model="template" ng-value="templates[0]" ng-click="init(2)"> Subject Lines <br/><br>
-        &nbsp <input type="radio" ng-model="template" ng-value="templates[1]" ng-click="init(3)"> From Names <br/><br>
-        &nbsp <input type="radio" ng-model="template" ng-value="templates[2]" ng-click="init(1)"> Two different Emails <br/><br>
+        &nbsp <input type="radio" ng-model="template" ng-value="templates[0]" ng-click="init(2)" ng-checked="template.val==1"> Subject Lines <br/><br>
+        &nbsp <input type="radio" ng-model="template" ng-value="templates[1]" ng-click="init(3)" ng-checked="template.val==2"> From Names <br/><br>
+        &nbsp <input type="radio" ng-model="template" ng-value="templates[2]" ng-click="init(1)" ng-checked="template.val==3"> Two different Emails <br/><br>
         &nbsp
         <div style="position:relative; left:220px; top: 30px;"  nextbutton></div>
         <div style="position:relative; left:300px; top:-1px;" cancelbutton></div>