CRM-15979 - crmMailingAB - More symmetry between edit and report modes.
authorTim Otten <totten@civicrm.org>
Thu, 19 Feb 2015 22:15:13 +0000 (14:15 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 19 Feb 2015 23:04:08 +0000 (15:04 -0800)
The top level file is "main.html" which includes either "edit.html" or
"report.html" depending on whether the test has been submitted.

js/angular-crmMailingAB.js
partials/crmMailingAB/edit.html
partials/crmMailingAB/main.html [new file with mode: 0644]
partials/crmMailingAB/report.html

index 97251357b99fe6d82b2b8f625d845116908f80cb..0dd847c3105e6279eee40dba2c8a4e9b43a57791 100644 (file)
@@ -29,7 +29,7 @@
         }
       });
       $routeProvider.when('/abtest/:id', {
-        templateUrl: '~/crmMailingAB/edit.html',
+        templateUrl: '~/crmMailingAB/main.html',
         controller: 'CrmMailingABEditCtrl',
         resolve: {
           abtest: function ($route, CrmMailingAB) {
           }
         }
       });
-      $routeProvider.when('/abtest/:id/report', {
-        templateUrl: '~/crmMailingAB/report.html',
-        controller: 'CrmMailingABReportCtrl',
-        resolve: {
-          abtest: function ($route, CrmMailingAB) {
-            var abtest = new CrmMailingAB($route.current.params.id);
-            return abtest.load();
-          }
-        }
-      });
     }
   ]);
 
index 3def3ebbea57c69a3aa75ade2408747c0ec0cadd..357d96fcc62a6cacbe9cd49b5be5b52f89fc1e89 100644 (file)
@@ -1,20 +1,13 @@
-<div crm-ui-accordion crm-title="ts('Debug')" crm-collapsed="true">
-  <pre>{{abtest.ab|json}}</pre>
-  <pre>{{abtest.mailings|json}}</pre>
-</div>
-
 <!--
+  Implicit Controller: CrmMailingABEditCtrl
+
   An ABTest includes two mailings, but we don't require the user to enter two complete mailings. For
   simplicity, the email composition UI generally displays A (unless we specifically decided to expose an
   individual field from B). At the end of the composition process, the controller's "sync" operation will
   merge shared settings from "A" into "B".
 -->
-<div ng-if="isSubmitted()">
-  <div ng-include="'~/crmMailingAB/report.html'"></div>
-</div>
-
-<form name="crmMailingAB" novalidate>
-  <div class="crm-block crm-form-block crmMailing" ng-if="!isSubmitted()">
+<div ng-form="crmMailingABEdit">
+  <div class="crm-block crm-form-block crmMailing">
     <div crm-ui-wizard>
       <div crm-ui-wizard-step="10" crm-title="ts('Setup')" ng-form="setupForm">
         <div
         <button crm-icon="disk" ng-disabled="block.check()" ng-click="save().then(leave) ">{{ts('Save Draft')}}</button>
       </span>
     </div>
-</form>
+</div>
diff --git a/partials/crmMailingAB/main.html b/partials/crmMailingAB/main.html
new file mode 100644 (file)
index 0000000..668df76
--- /dev/null
@@ -0,0 +1,12 @@
+<!--
+  Implicit Controller: CrmMailingABEditCtrl
+-->
+<div crm-ui-accordion crm-title="ts('Debug')" crm-collapsed="true">
+  <pre>{{abtest.ab|json}}</pre>
+  <pre>{{abtest.mailings|json}}</pre>
+</div>
+
+<form name="crmMailingAB" novalidate>
+  <div ng-include="'~/crmMailingAB/edit.html'" ng-if="!isSubmitted()"></div>
+  <div ng-include="'~/crmMailingAB/report.html'" ng-if="isSubmitted()"></div>
+</form>
index 0e6d4cbc38e1cd39602c864aa2936083ac74e1aa..5cde438664c32e0a72187ecd3587a404ff6d03db 100644 (file)
@@ -1,3 +1,6 @@
+<!--
+  Implicit Controller: CrmMailingABEditCtrl
+-->
 <div ng-controller="CrmMailingABReportCtrl">
   <table>
     <thead>