CRM-15578 - Change table layouts to <crm-ui-field> directive. Remove <crm-ui-label...
[civicrm-core.git] / partials / crmMailing2 / mailing.html
index 6f38677e9dcff921581ee6cb8e6539f2c1403282..3d7a50a482fb4f1c867aeab8f26de9fa76cbf890 100644 (file)
@@ -1,65 +1,53 @@
 <!--
 Controller: EditMailingCtrl
 Required vars: mailing, crmMailingConst
-FIXME: Don't hardcode table-based layout!
 -->
-<table class="form-layout-compressed">
-  <tbody>
-    <tr>
-      <td class="label">
-        <label crm-ui-label crm-for="fromAddress">{{ts('From')}}</label>
-      </td>
-      <td>
-        <select
-          name="fromAddress"
-          ui-jq="select2"
-          ui-options="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
-          ng-model="mailing.from"
-          ng-options="frm.label as frm.label for frm in crmMailingConst.fromAddress"
-          required>
-          <option value=""></option>
-        </select>
-      </td>
-    </tr>
-    <tr>
-      <td class="label">
-        <label crm-ui-label crm-for="replyTo">{{ts('Reply-To')}}</label>
-      </td>
-      <td>
-        <select
-          name="replyTo"
-          ui-jq="select2"
-          ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
-          ng-model="mailing.replyto_email"
-          ng-options="frm.label as frm.label for frm in crmMailingConst.fromAddress"
-          >
-          <option value=""></option>
-        </select>
-      </td>
-    </tr>
-    <tr>
-      <td class="label">
-        <label crm-ui-label crm-for="recipients">{{ts('Recipients')}}</label>
-      </td>
-      <td ng-include="partialUrl('field/recipients.html')">
-      </td>
-    </tr>
-    <tr>
-      <td class="label">
-        <label crm-ui-label crm-for="subject">{{ts('Subject')}}</label>
-      </td>
-      <td>
-        <div style="float: right;">
-          <input crm-mailing-token crm-for="subject" />
-        </div>
-        <input
-          type="text"
-          class="crm-form-text"
-          ng-model="mailing.subject"
-          required
-          placeholder="Subject"
-          name="subject" />
-      </td>
-    </tr>
-  </tbody>
-</table>
+
+<div class="crm-block">
+  <div class="crm-group">
+    <div crm-ui-field="msg_template_id" crm-title="ts('Template')" style="background: #bbf; width:100%; padding: 0.1em;">
+      <div>
+        <div ng-include="partialUrl('field/msg_template_id.html')"></div>
+      </div>
+    </div>
+    <div crm-ui-field="fromAddress" crm-title="ts('From')">
+      <select
+        name="fromAddress"
+        ui-jq="select2"
+        ui-options="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
+        ng-model="fromPlaceholder.label"
+        ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
+        required>
+        <option value=""></option>
+      </select>
+    </div>
+    <div crm-ui-field="replyTo" crm-title="ts('Reply-To')">
+      <select
+        name="replyTo"
+        ui-jq="select2"
+        ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
+        ng-model="mailing.replyto_email"
+        ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
+        >
+        <option value=""></option>
+      </select>
+    </div>
+    <div crm-ui-field="recipients" crm-title="ts('Recipients')">
+      <div>
+        <div ng-include="partialUrl('field/recipients.html')"></div>
+      </div>
+    </div>
+    <div crm-ui-field="subject" crm-title="ts('Subject')">
+      <div style="float: right;">
+        <input crm-mailing-token crm-for="subject" />
+      </div>
+      <input
+        type="text"
+        class="crm-form-text"
+        ng-model="mailing.subject"
+        required
+        placeholder="Subject"
+        name="subject" />
+    </div>
+  </div>
+</div>