CRM-15578 - crmMailing2 - Add basic body_text / body_html
authorTim Otten <totten@civicrm.org>
Fri, 31 Oct 2014 20:40:01 +0000 (13:40 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 11 Nov 2014 00:20:51 +0000 (16:20 -0800)
js/angular-crmMailing2.js
partials/crmMailing2/edit-unified.html
partials/crmMailing2/edit-wizard.html
partials/crmMailing2/edit.html
partials/crmMailing2/field/README.md [new file with mode: 0644]
partials/crmMailing2/field/body_html.html [new file with mode: 0644]
partials/crmMailing2/field/body_text.html [new file with mode: 0644]

index 6d1dc013f195f6e0928589f32e92dc4dd16cfd57..d1a1af837011702fbcd71ffc2cbce17c66dcb79a 100644 (file)
@@ -16,6 +16,8 @@
       from: _.where(CRM.crmMailing.fromAddress, {is_default: "1"})[0].label,
       replyto_email: "",
       subject: "",
+      body_html: "",
+      body_text: "",
       visibility: "Public Pages",
       url_tracking: "1",
       dedupe_email: "1",
index f723d0a25b8577a9133378a5e61613eb5674fa7b..565fbbbe6674f85d8166bd1dbe7e6be027a89c30 100644 (file)
@@ -4,6 +4,13 @@
     <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-tab-set>
       <div crm-ui-tab id="tab-schedule" crm-title="ts('Schedule')">
         <div ng-include="partialUrl('schedule.html')" />
index 297684dd20ffc0c43d1ad2fe8e5679e8bd54f7d9..34e545954946038964de655547df3bc632f61f85 100644 (file)
@@ -9,6 +9,12 @@
 
       <div crm-ui-wizard-step crm-title="ts('Content')">
         <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 crm-title="ts('Header and Footer')" crm-collapsed="true">
           <div ng-include="partialUrl('headerFooter.html')" />
         </div>
index f07f538bd386d5e0283ac71496f46939acfb7fab..0f7bbfc5b91edcc430b95c061a47b33f085b9d24 100644 (file)
         <div crm-ui-tab-set>
           <div crm-ui-tab id="tab-mailing" crm-title="ts('Mailing')">
             <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>
           <div crm-ui-tab id="tab-attachment" crm-title="ts('Attachments')">
             <div ng-include="partialUrl('attachments.html')" />
diff --git a/partials/crmMailing2/field/README.md b/partials/crmMailing2/field/README.md
new file mode 100644 (file)
index 0000000..4d65f0d
--- /dev/null
@@ -0,0 +1,3 @@
+This directory contains templates for various fields. This is a work-around
+for the 4.x series -- in the 5.x series, these files should be replaced by
+either (a) metadata-driven autowiring or (b) new directives.
diff --git a/partials/crmMailing2/field/body_html.html b/partials/crmMailing2/field/body_html.html
new file mode 100644 (file)
index 0000000..8ad1f33
--- /dev/null
@@ -0,0 +1,9 @@
+<!--
+Controller: EditMailingCtrl
+Required vars: mailing, crmMailingConst
+-->
+<div style="float: right;">
+  <input crm-mailing-token crm-for="body_html" />
+</div>
+
+<textarea name="body_html" ng-model="mailing.body_html"></textarea>
\ No newline at end of file
diff --git a/partials/crmMailing2/field/body_text.html b/partials/crmMailing2/field/body_text.html
new file mode 100644 (file)
index 0000000..11f336a
--- /dev/null
@@ -0,0 +1,8 @@
+<!--
+Controller: EditMailingCtrl
+Required vars: mailing, crmMailingConst
+-->
+<div style="float: right;">
+  <input crm-mailing-token crm-for="body_text" />
+</div>
+<textarea name="body_text" ng-model="mailing.body_text"></textarea>
\ No newline at end of file