// 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});
}
+<!--
+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
<div>
- {{tab_val}}
+ {{tab_val}}<br>
+
<div ui-jq="tabs" id="alltabs">
<ul>
<h3> What would you like to test ?</h3><br><br>
-   <input type="radio" ng-model="template" ng-value="templates[0]" ng-click="init(2)"> Subject Lines <br/><br>
-   <input type="radio" ng-model="template" ng-value="templates[1]" ng-click="init(3)"> From Names <br/><br>
-   <input type="radio" ng-model="template" ng-value="templates[2]" ng-click="init(1)"> Two different Emails <br/><br>
+   <input type="radio" ng-model="template" ng-value="templates[0]" ng-click="init(2)" ng-checked="template.val==1"> Subject Lines <br/><br>
+   <input type="radio" ng-model="template" ng-value="templates[1]" ng-click="init(3)" ng-checked="template.val==2"> From Names <br/><br>
+   <input type="radio" ng-model="template" ng-value="templates[2]" ng-click="init(1)" ng-checked="template.val==3"> Two different Emails <br/><br>
 
<div style="position:relative; left:220px; top: 30px;" nextbutton></div>
<div style="position:relative; left:300px; top:-1px;" cancelbutton></div>