CRM-15578 - crmMailing2 - Add <form>, top-level CSS, and alternative layouts (/mailin...
authorTim Otten <totten@civicrm.org>
Thu, 30 Oct 2014 22:19:39 +0000 (15:19 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 11 Nov 2014 00:20:03 +0000 (16:20 -0800)
js/angular-crmMailing2.js
partials/crmMailing2/edit-unified.html [new file with mode: 0644]
partials/crmMailing2/edit-unified2.html [new file with mode: 0644]
partials/crmMailing2/edit-wizard.html [new file with mode: 0644]
partials/crmMailing2/edit.html

index d1e806d6cb20bf9941695419593a7c698ee14ba7..11ad303615f747b941491b10aff35e78e7c7b08a 100644 (file)
     };
   };
 
+  var getMailing = function ($route, crmApi) {
+    return ($route.current.params.id == 'new') ? createMailing() : crmApi('Mailing', 'getsingle', {id: $route.current.params.id});
+  };
+
   crmMailing2.config(['$routeProvider',
     function ($routeProvider) {
       $routeProvider.when('/mailing2', {
         template: '<div></div>',
         controller: 'ListMailingsCtrl'
       });
-
       $routeProvider.when('/mailing2/:id', {
         templateUrl: partialUrl('edit.html'),
         controller: 'EditMailingCtrl',
         resolve: {
-          selectedMail: function ($route, crmApi) {
-            return ($route.current.params.id == 'new')
-                    ? createMailing()
-                    : crmApi('Mailing', 'getsingle', {id: $route.current.params.id});
-          }
+          selectedMail: getMailing
+        }
+      });
+      $routeProvider.when('/mailing2/:id/unified', {
+        templateUrl: partialUrl('edit-unified.html'),
+        controller: 'EditMailingCtrl',
+        resolve: {
+          selectedMail: getMailing
+        }
+      });
+      $routeProvider.when('/mailing2/:id/unified2', {
+        templateUrl: partialUrl('edit-unified2.html'),
+        controller: 'EditMailingCtrl',
+        resolve: {
+          selectedMail: getMailing
+        }
+      });
+      $routeProvider.when('/mailing2/:id/wizard', {
+        templateUrl: partialUrl('edit-wizard.html'),
+        controller: 'EditMailingCtrl',
+        resolve: {
+          selectedMail: getMailing
         }
       });
     }
diff --git a/partials/crmMailing2/edit-unified.html b/partials/crmMailing2/edit-unified.html
new file mode 100644 (file)
index 0000000..f723d0a
--- /dev/null
@@ -0,0 +1,39 @@
+<form name="crmMailing2">
+  <div class="crm-block crm-form-block crmMailing2">
+
+    <div ng-include="partialUrl('summary.html')"/>
+    <div ng-include="partialUrl('mailing.html')" />
+
+    <div crm-ui-tab-set>
+      <div crm-ui-tab id="tab-schedule" crm-title="ts('Schedule')">
+        <div ng-include="partialUrl('schedule.html')" />
+      </div>
+      <div crm-ui-tab id="tab-attachment" crm-title="ts('Attachments')">
+        <div ng-include="partialUrl('attachments.html')" />
+      </div>
+      <div crm-ui-tab id="tab-header" crm-title="ts('Header and Footer')">
+        <div ng-include="partialUrl('headerFooter.html')" />
+      </div>
+      <div crm-ui-tab id="tab-pub" crm-title="ts('Publication')">
+        <div ng-include="partialUrl('publication.html')" />
+      </div>
+      <div crm-ui-tab id="tab-response" crm-title="ts('Responses')">
+        <div ng-include="partialUrl('responses.html')" />
+      </div>
+      <div crm-ui-tab id="tab-tracking" crm-title="ts('Tracking')">
+        <div ng-include="partialUrl('tracking.html')" />
+      </div>
+    </div>
+
+    <div crm-ui-accordion crm-title="ts('Preview')">
+      <div ng-include="partialUrl('preview.html')" />
+    </div>
+
+    <button ng-click="send();
+          leave();">{{ts('Submit Mailing')}}</button>
+    <button ng-click="save();
+          leave();">{{ts('Save Draft')}}</button>
+    <button ng-click="cancel();
+          leave();">{{ts('Delete Draft')}}</button>
+  </div>
+</form>
\ No newline at end of file
diff --git a/partials/crmMailing2/edit-unified2.html b/partials/crmMailing2/edit-unified2.html
new file mode 100644 (file)
index 0000000..a7eba60
--- /dev/null
@@ -0,0 +1,42 @@
+<form name="crmMailing2">
+  <div class="crm-block crm-form-block crmMailing2">
+
+    <div ng-include="partialUrl('summary.html')"/>
+    <div ng-include="partialUrl('mailing.html')" />
+    
+    <div crm-ui-accordion crm-title="ts('HTML')">
+      <div ng-include="partialUrl('field/body_html.html')" />
+    </div>
+    <div crm-ui-accordion crm-title="ts('Plain Text')" crm-collapsed='true'>
+      <div ng-include="partialUrl('field/body_text.html')" />
+    </div>
+    <div crm-ui-accordion id="tab-header" crm-title="ts('Header and Footer')" crm-collapsed='true'>
+      <div ng-include="partialUrl('headerFooter.html')" />
+    </div>
+    <div crm-ui-accordion id="tab-attachment" crm-title="ts('Attachments')" crm-collapsed='true'>
+      <div ng-include="partialUrl('attachments.html')" />
+    </div>
+    <div crm-ui-accordion id="tab-pub" crm-title="ts('Publication')" crm-collapsed='true'>
+      <div ng-include="partialUrl('publication.html')" />
+    </div>
+    <div crm-ui-accordion id="tab-response" crm-title="ts('Responses')" crm-collapsed='true'>
+      <div ng-include="partialUrl('responses.html')" />
+    </div>
+    <div crm-ui-accordion id="tab-tracking" crm-title="ts('Tracking')" crm-collapsed='true'>
+      <div ng-include="partialUrl('tracking.html')" />
+    </div>
+    <div crm-ui-accordion crm-title="ts('Preview')">
+      <div ng-include="partialUrl('preview.html')" />
+    </div>
+    <div crm-ui-accordion id="tab-schedule" crm-title="ts('Schedule')">
+      <div ng-include="partialUrl('schedule.html')" />
+    </div>
+
+    <button ng-click="send();
+      leave();">{{ts('Submit Mailing')}}</button>
+    <button ng-click="save();
+      leave();">{{ts('Save Draft')}}</button>
+    <button ng-click="cancel();
+      leave();">{{ts('Delete Draft')}}</button>
+  </div>
+</form>
\ No newline at end of file
diff --git a/partials/crmMailing2/edit-wizard.html b/partials/crmMailing2/edit-wizard.html
new file mode 100644 (file)
index 0000000..297684d
--- /dev/null
@@ -0,0 +1,55 @@
+<form name="crmMailing2">
+  <div class="crm-block crm-form-block crmMailing2">
+
+    <div crm-ui-wizard>
+
+      <div crm-ui-wizard-step crm-title="ts('Setup')">
+        <div ng-include="partialUrl('summary.html')" />
+      </div>
+
+      <div crm-ui-wizard-step crm-title="ts('Content')">
+        <div ng-include="partialUrl('mailing.html')" />
+        <div crm-ui-accordion crm-title="ts('Header and Footer')" crm-collapsed="true">
+          <div ng-include="partialUrl('headerFooter.html')" />
+        </div>
+        <div crm-ui-accordion crm-title="ts('Attachments')" crm-collapsed="true">
+          <div ng-include="partialUrl('attachments.html')" />
+        </div>
+        <div crm-ui-accordion crm-title="ts('Preview')">
+          <div ng-include="partialUrl('preview.html')" />
+        </div>
+      </div>
+
+      <div crm-ui-wizard-step crm-title="ts('Options')">
+        <div crm-ui-accordion crm-title="ts('Schedule')">
+          <div ng-include="partialUrl('schedule.html')" />
+        </div>
+
+        <div crm-ui-accordion crm-title="ts('Responses')" crm-collapsed="true">
+          <div ng-include="partialUrl('responses.html')" />
+        </div>
+        <div crm-ui-accordion crm-title="ts('Tracking')" crm-collapsed="true">
+          <div ng-include="partialUrl('tracking.html')" />
+        </div>
+        <div crm-ui-accordion crm-title="ts('Publication')" crm-collapsed="true">
+          <div ng-include="partialUrl('publication.html')" />
+        </div>
+      </div>
+
+      <div crm-ui-wizard-step crm-title="ts('Review')">
+        <div crm-ui-accordion crm-title="ts('Review')">
+          <div ng-include="partialUrl('review.html')" />
+          <button ng-click="send();
+                leave();">{{ts('Submit Mailing')}}</button>
+        </div>
+      </div>
+
+      <span crm-ui-wizard-buttons style="float:right;">
+        <button ng-click="cancel();
+              leave();">{{ts('Delete Draft')}}</button>
+        <button ng-click="save();
+              leave();">{{ts('Save Draft')}}</button>
+      </span>
+    </div>
+  </div>
+</form>
\ No newline at end of file
index 5db03e2f2d331892192275282d81456c3a715763..f07f538bd386d5e0283ac71496f46939acfb7fab 100644 (file)
@@ -1,43 +1,55 @@
-<div crm-ui-wizard>
-  <div crm-ui-wizard-step crm-title="ts('Define Mailing')">
-    <div crm-ui-accordion crm-title="ts('Summary')">
-      <div ng-include="partialUrl('summary.html')" />
-    </div>
-    <div crm-ui-tab-set>
-      <div crm-ui-tab id="tab-mailing" crm-title="ts('Mailing')">
-        <div ng-include="partialUrl('mailing.html')" />
-      </div>
-      <div crm-ui-tab id="tab-attachment" crm-title="ts('Attachments')">
-        <div ng-include="partialUrl('attachments.html')" />
-      </div>
-      <div crm-ui-tab id="tab-header" crm-title="ts('Header and Footer')">
-        <div ng-include="partialUrl('headerFooter.html')" />
-      </div>
-      <div crm-ui-tab id="tab-pub" crm-title="ts('Publication')">
-        <div ng-include="partialUrl('publication.html')" />
-      </div>
-      <div crm-ui-tab id="tab-response" crm-title="ts('Responses')">
-        <div ng-include="partialUrl('responses.html')" />
+<div crm-ui-accordion crm-title="ts('Debug')" crm-collapsed="true">
+  <pre>{{mailing|json}}</pre>
+</div>
+
+<form name="crmMailing2">
+  <div class="crm-block crm-form-block crmMailing2">
+    <div crm-ui-wizard>
+      <div crm-ui-wizard-step crm-title="ts('Define Mailing')">
+        <div crm-ui-accordion crm-title="ts('Summary')">
+          <div ng-include="partialUrl('summary.html')" />
+        </div>
+        <div crm-ui-tab-set>
+          <div crm-ui-tab id="tab-mailing" crm-title="ts('Mailing')">
+            <div ng-include="partialUrl('mailing.html')" />
+          </div>
+          <div crm-ui-tab id="tab-attachment" crm-title="ts('Attachments')">
+            <div ng-include="partialUrl('attachments.html')" />
+          </div>
+          <div crm-ui-tab id="tab-header" crm-title="ts('Header and Footer')">
+            <div ng-include="partialUrl('headerFooter.html')" />
+          </div>
+          <div crm-ui-tab id="tab-pub" crm-title="ts('Publication')">
+            <div ng-include="partialUrl('publication.html')" />
+          </div>
+          <div crm-ui-tab id="tab-response" crm-title="ts('Responses')">
+            <div ng-include="partialUrl('responses.html')" />
+          </div>
+          <div crm-ui-tab id="tab-tracking" crm-title="ts('Tracking')">
+            <div ng-include="partialUrl('tracking.html')" />
+          </div>
+        </div>
+        <div crm-ui-accordion crm-title="ts('Preview')">
+          <div ng-include="partialUrl('preview.html')" />
+        </div>
       </div>
-      <div crm-ui-tab id="tab-tracking" crm-title="ts('Tracking')">
-        <div ng-include="partialUrl('tracking.html')" />
+      <div crm-ui-wizard-step crm-title="ts('Review and Schedule')">
+        <div crm-ui-accordion crm-title="ts('Review')">
+          <div ng-include="partialUrl('review.html')" />
+        </div>
+        <div crm-ui-accordion crm-title="ts('Schedule')">
+          <div ng-include="partialUrl('schedule.html')" />
+          <button ng-click="send();
+                    leave();">{{ts('Schedule')}}</button>
+        </div>
       </div>
-    </div>
-    <div crm-ui-accordion crm-title="ts('Preview')">
-      <div ng-include="partialUrl('preview.html')" />
-    </div>
-  </div>
-  <div crm-ui-wizard-step crm-title="ts('Review and Schedule')">
-    <div crm-ui-accordion crm-title="ts('Review')">
-      <div ng-include="partialUrl('review.html')" />
-    </div>
-    <div crm-ui-accordion crm-title="ts('Schedule')">
-      <div ng-include="partialUrl('schedule.html')" />
-      <button ng-click="send();leave();">{{ts('Schedule')}}</button>
+
+      <span crm-ui-wizard-buttons style="float:right;">
+        <button ng-click="cancel();
+                  leave();">{{ts('Delete Draft')}}</button>
+        <button ng-click="save();
+                  leave();">{{ts('Save Draft')}}</button>
+      </span>
     </div>
   </div>
-  <span crm-ui-wizard-buttons style="float:right;">
-    <button ng-click="cancel();leave();">{{ts('Delete Draft')}}</button>
-    <button ng-click="save();leave();">{{ts('Save Draft')}}</button>
-  </span>
-</div>
\ No newline at end of file
+</form>