CRM-15706 - Modify crmUiField signature to use options object
authorColeman Watts <coleman@civicrm.org>
Mon, 16 Mar 2015 21:19:19 +0000 (17:19 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 19 Mar 2015 15:39:48 +0000 (11:39 -0400)
15 files changed:
js/angular-crm-ui.js
partials/crmCaseType/caseTypeDetails.html
partials/crmMailing/approve.html
partials/crmMailing/dialog/recipientOptions.html
partials/crmMailing/headerFooter.html
partials/crmMailing/mailing.html
partials/crmMailing/publication.html
partials/crmMailing/responses.html
partials/crmMailing/review.html
partials/crmMailing/summary.html
partials/crmMailing/tracking.html
partials/crmMailingAB/joint-mailing.html
partials/crmMailingAB/setup.html
partials/crmUi/field-cb.html
partials/crmUi/field.html

index e46f814b1ff3b70f406cd5fdfdf11b27527bf521..2ae109d1a0a574fbdd8bef535ae64a273ff25c92 100644 (file)
     })
 
     // Display a field/row in a field list
-    // example: <div crm-ui-field crm-title="My Field"> {{mydata}} </div>
-    // example: <div crm-ui-field="subform.myfield" crm-title="'My Field'"> <input crm-ui-id="subform.myfield" name="myfield" /> </div>
-    // example: <div crm-ui-field="subform.myfield" crm-title="'My Field'"> <input crm-ui-id="subform.myfield" name="myfield" required /> </div>
-    // example: <div crm-ui-field crm-title="My Field" crm-ui-help="'help_field_name'"> {{mydata}} </div>
+    // example: <div crm-ui-field="{title: ts('My Field')}"> {{mydata}} </div>
+    // example: <div crm-ui-field="{name: 'subform.myfield', title: ts('My Field')}"> <input crm-ui-id="subform.myfield" name="myfield" /> </div>
+    // example: <div crm-ui-field="{name: 'subform.myfield', title: ts('My Field')}"> <input crm-ui-id="subform.myfield" name="myfield" required /> </div>
+    // example: <div crm-ui-field="{name: 'subform.myfield', title: ts('My Field'), help: 'help_field_name'}"> {{mydata}} </div>
     .directive('crmUiField', function() {
       // Note: When writing new templates, the "label" position is particular. See/patch "var label" below.
       var templateUrls = {
         require: '^crmUiIdScope',
         restrict: 'EA',
         scope: {
-          // string, e.g. "myform.myfield"
-          crmUiField: '@',
-          // string, an expression producing a printable title
-          crmTitle: '=',
-          // string, an expression producing a help id
-          crmHelp: '='
+          // {title, name, help}
+          crmUiField: '='
         },
         templateUrl: function(tElement, tAttrs){
           var layout = tAttrs.crmLayout ? tAttrs.crmLayout : 'default';
         transclude: true,
         link: function (scope, element, attrs, crmUiIdCtrl) {
           $(element).addClass('crm-section');
-          scope.crmUiField = attrs.crmUiField;
           scope.crmUiHelpFile = scope.$parent.crmUiHelpFile; // propagate default
         }
       };
index 9cb878981a20742e3d8a1caa9347bf367483e20b..1d8558ec1b5c5fb0a39c91d04904eb94acb3de54 100644 (file)
@@ -6,7 +6,7 @@ The original form used table layout; don't know if we have an alternative, CSS-b
 -->
 <div class="crm-block" ng-form="caseTypeDetailForm" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field="caseTypeDetailForm.title" crm-title="ts('Title')">
+    <div crm-ui-field="{name: 'caseTypeDetailForm.title', title: ts('Title')}">
       <input
         crm-ui-id="caseTypeDetailForm.title"
         type="text"
@@ -16,7 +16,7 @@ The original form used table layout; don't know if we have an alternative, CSS-b
         required
         />
     </div>
-    <div crm-ui-field="caseTypeDetailForm.caseTypeName" crm-title="ts('Name')">
+    <div crm-ui-field="{name: 'caseTypeDetailForm.caseTypeName', title: ts('Name')}">
       <input
         crm-ui-id="caseTypeDetailForm.caseTypeName"
         type="text"
@@ -35,10 +35,10 @@ The original form used table layout; don't know if we have an alternative, CSS-b
         <em>WARNING: If any external files or programs reference the old "Name", then they must be updated manually.</em>
       </div>
     </div>
-    <div crm-ui-field="caseTypeDetailForm.description" crm-title="ts('Description')">
+    <div crm-ui-field="{name: 'caseTypeDetailForm.description', title: ts('Description')}">
       <textarea crm-ui-id="caseTypeDetailForm.description" name="description" ng-model="caseType.description" class="big crm-form-textarea"></textarea>
     </div>
-    <div crm-ui-field crm-title="ts('Enabled?')">
+    <div crm-ui-field="{title: ts('Enabled?')}">
       <input name="is_active" type="checkbox" ng-model="caseType.is_active" ng-true-value="1" ng-false-value="0"/>
     </div>
   </div>
index ce50e718521b8facd31fdb19c613fdc7d18b0c70..e3971ca7cb49b5f5497c2448350c808393893751 100644 (file)
@@ -1,9 +1,9 @@
 <div class="crm-block" ng-form="apprForm" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field crm-title="ts('Status')">
+    <div crm-ui-field="{title: ts('Status')}">
       {{mailingFields.approval_status_id.optionsMap[mailing.approval_status_id] || ts('Unreviewed')}}
     </div>
-    <div crm-ui-field="apprForm.approval_note" crm-title="ts('Note')">
+    <div crm-ui-field="{name: 'apprForm.approval_note', title: ts('Note')}">
       <textarea
         crm-ui-id="apprForm.approval_note"
         name="approval_note"
index 3deb9f769e3cdd49cf2eb27ebf5e1ee108dd5056..3d381d04b453b4ed2235953f092532b9deead334 100644 (file)
@@ -3,7 +3,7 @@
     <div class="crm-group">
 
       <!-- FIXME: ts is not working here. -->
-      <div crm-ui-field crm-title="'Dedupe by email'" crm-layout="checkbox">
+      <div crm-ui-field="{title: 'Dedupe by email'}" crm-layout="checkbox">
         <input
           type='checkbox'
           ng-model='model.mailing.dedupe_email'
@@ -17,7 +17,7 @@
         <p>{{ts('To send separate messages for each person, disable this option. Mail-merge tokens will be filled separately for each person.')}}</p>
       </div>
 
-      <div crm-ui-field="editRecipOptionsForm.location_type_id" crm-title="ts('Location Type')">
+      <div crm-ui-field="{name: 'editRecipOptionsForm.location_type_id', title: ts('Location Type')}">
         <select
           crm-ui-id="editRecipOptionsForm.location_type_id"
           crm-ui-select="{dropdownAutoWidth : true}"
@@ -32,7 +32,7 @@
         </select>
       </div>
 
-      <div crm-ui-field="editRecipOptionsForm.email_selection_method" crm-title="ts('Selection Method')">
+      <div crm-ui-field="{name: 'editRecipOptionsForm.email_selection_method', title: ts('Selection Method')}">
         <select
           crm-ui-id="editRecipOptionsForm.email_selection_method"
           crm-ui-select=""
index 5446b7e7d942103f549e57b9d7091de95603d797..165ecd9812de8caab8f74fe4369f1e805c996dc8 100644 (file)
@@ -4,7 +4,7 @@ Required vars: mailing, crmMailingConst
 -->
 <div class="crm-block"  ng-form="subform" crm-ui-id-scope>
   <div class="crm-group" ng-controller="EmailBodyCtrl">
-    <div crm-ui-field="subform.header_id" crm-title="ts('Mailing Header')">
+    <div crm-ui-field="{name: 'subform.header_id', title: ts('Mailing Header')}">
       <select
         crm-ui-id="subform.header_id"
         name="header_id"
@@ -16,7 +16,7 @@ Required vars: mailing, crmMailingConst
         <option value=""></option>
       </select>
     </div>
-    <div crm-ui-field="subform.footer_id" crm-title="ts('Mailing Footer')">
+    <div crm-ui-field="{name: 'subform.footer_id', title: ts('Mailing Footer')}">
       <select
         crm-ui-id="subform.footer_id"
         name="footer_id"
index 79603b1b6e4326891e879932129088e955b6bc40..4521b29593060cd489e166b6a009544bbdbfc54d 100644 (file)
@@ -6,7 +6,7 @@ It could perhaps be thinned by 30-60% by making more directives.
 -->
 <div class="crm-block" ng-form="subform" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field="subform.msg_template_id" crm-title="ts('Template')">
+    <div crm-ui-field="{name: 'subform.msg_template_id', title: ts('Template')}">
       <div ng-controller="MsgTemplateCtrl">
         <select
           crm-ui-id="subform.msg_template_id"
@@ -21,7 +21,7 @@ It could perhaps be thinned by 30-60% by making more directives.
         <a crm-icon="disk" ng-click="saveTemplate(mailing)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
       </div>
     </div>
-    <div crm-ui-field="subform.fromAddress" crm-title="ts('From')" crm-help="'id-from_email'">
+    <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From'), help: 'id-from_email'}">
       <div ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="mailing">
         <select
           crm-ui-id="subform.fromAddress"
@@ -34,7 +34,7 @@ It could perhaps be thinned by 30-60% by making more directives.
         </select>
       </div>
     </div>
-    <div crm-ui-field="subform.replyTo" crm-title="ts('Reply-To')" ng-show="crmMailingConst.enableReplyTo">
+    <div crm-ui-field="{name: 'subform.replyTo', title: ts('Reply-To')}" ng-show="crmMailingConst.enableReplyTo">
       <div ng-controller="EmailAddrCtrl">
         <select
           crm-ui-id="subform.replyTo"
@@ -48,11 +48,11 @@ It could perhaps be thinned by 30-60% by making more directives.
         </select>
       </div>
     </div>
-    <div crm-ui-field="subform.recipients" crm-title="ts('Recipients')">
+    <div crm-ui-field="{name: 'subform.recipients', title: ts('Recipients')}">
       <div crm-mailing-block-recipients="{name: 'recipients', id: 'subform.recipients'}" crm-mailing="mailing"></div>
     </div>
     <span ng-controller="EditUnsubGroupCtrl">
-      <div crm-ui-field="subform.baseGroup" crm-title="ts('Unsubscribe Group')" ng-if="isUnsubGroupRequired(mailing)">
+      <div crm-ui-field="{name: 'subform.baseGroup', title: ts('Unsubscribe Group')}" ng-if="isUnsubGroupRequired(mailing)">
         <select
           crm-ui-id="subform.baseGroup"
           crm-ui-select
@@ -64,7 +64,7 @@ It could perhaps be thinned by 30-60% by making more directives.
         </select>
       </div>
     </span>
-    <div crm-ui-field="subform.subject" crm-title="ts('Subject')">
+    <div crm-ui-field="{name: 'subform.subject', title: ts('Subject')}">
       <div style="float: right;">
         <input crm-mailing-token on-select="$broadcast('insert:subject', token.name)" tabindex="-1"/>
       </div>
index e51f7b1204645a0d7fc66eeb40cd1616516ced15..fd4e2f378f6e89b0896b2a16f0b194ca3070bbfd 100644 (file)
@@ -1,6 +1,6 @@
 <div class="crm-block" ng-form="subform" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field="subform.visibility" crm-title="ts('Mailing Visibility')">
+    <div crm-ui-field="{name: 'subform.visibility', title: ts('Mailing Visibility')}">
       <select
         crm-ui-id="subform.visibility"
         name="visibility"
index 43d8f7ddf6c7f6dd3a3b44142a4985f0fe018d30..3ba9c6372d424caf196f3a602ee901b95ed28532 100644 (file)
@@ -4,7 +4,7 @@ Required vars: mailing, crmMailingConst
 -->
 <div class="crm-block" ng-form="responseForm" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field crm-title="ts('Track Replies')" crm-layout="checkbox">
+    <div crm-ui-field="{title: ts('Track Replies')}" crm-layout="checkbox">
       <!-- Comparing data-model and UI of "override_verp", note that true/false are inverted (enabled==0,disabled==1) -->
       <span ng-controller="EmailAddrCtrl">
         <input
@@ -20,13 +20,13 @@ Required vars: mailing, crmMailingConst
     <div class="crm-section" id="help">
       {{ts('Recipients\' replies are sent to a CiviMail specific address instead of the sender\'s address so they can be stored within CiviCRM.')}}
     </div>
-    <div crm-ui-field crm-title="ts('Forward Replies')" crm-layout="checkbox" ng-show="'0' == mailing.override_verp">
+    <div crm-ui-field="{title: ts('Forward Replies')}" crm-layout="checkbox" ng-show="'0' == mailing.override_verp">
       <input name="forward_replies" type="checkbox" ng-model="mailing.forward_replies" ng-true-value="'1'" ng-false-value="'0'" />
     </div>
     <div class="crm-section" id="help" ng-show="'0' == mailing.override_verp">
       {{ts('If a recipient replies to this mailing, forward the reply to the FROM Email address specified for the mailing.')}}
     </div>
-    <div crm-ui-field crm-title="ts('Auto-Respond to Replies')" crm-layout="checkbox" ng-show="'0' == mailing.override_verp">
+    <div crm-ui-field="{title: ts('Auto-Respond to Replies')}" crm-layout="checkbox" ng-show="'0' == mailing.override_verp">
       <input name="auto_responder" type="checkbox" ng-model="mailing.auto_responder" ng-true-value="'1'" ng-false-value="'0'" />
     </div>
     <div class="crm-section" id="help" ng-show="'0' == mailing.override_verp">
@@ -39,7 +39,7 @@ Required vars: mailing, crmMailingConst
 
 <div class="crm-block" ng-form="subform" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field="subform.reply_id" crm-title="ts('Auto-Respond Message')" ng-show="'0' == mailing.override_verp && '1' == mailing.auto_responder">
+    <div crm-ui-field="{name: 'subform.reply_id', title: ts('Auto-Respond Message')}" ng-show="'0' == mailing.override_verp && '1' == mailing.auto_responder">
       <select
         crm-ui-id="subform.reply_id"
         name="reply_id"
@@ -51,7 +51,7 @@ Required vars: mailing, crmMailingConst
         <option value=""></option>
       </select>
     </div>
-    <div crm-ui-field="subform.optout_id" crm-title="ts('Opt-out Message')">
+    <div crm-ui-field="{name: 'subform.optout_id', title: ts('Opt-out Message')}">
       <select
         crm-ui-id="subform.optout_id"
         name="optout_id"
@@ -63,7 +63,7 @@ Required vars: mailing, crmMailingConst
         <option value=""></option>
       </select>
     </div>
-    <div crm-ui-field="subform.resubscribe_id" crm-title="ts('Resubscribe Message')">
+    <div crm-ui-field="{name: 'subform.resubscribe_id', title: ts('Resubscribe Message')}">
       <select
         crm-ui-id="subform.resubscribe_id"
         name="resubscribe_id"
@@ -75,7 +75,7 @@ Required vars: mailing, crmMailingConst
         <option value=""></option>
       </select>
     </div>
-    <div crm-ui-field="subform.unsubscribe_id" crm-title="ts('Unsubscribe Message')">
+    <div crm-ui-field="{name: 'subform.unsubscribe_id', title: ts('Unsubscribe Message')}">
       <select
         crm-ui-id="subform.unsubscribe_id"
         name="unsubscribe_id"
index 13d22116b2f5e84514b2b2c3e746bd608102b85b..9ce64b092a8db4d615730955596af966e7972668 100644 (file)
@@ -5,10 +5,10 @@ Required vars: mailing
 <div>
   <div class="crm-block" ng-form="reviewForm" crm-ui-id-scope>
     <div class="crm-group">
-      <div crm-ui-field crm-title="ts('Mailing Name')">
+      <div crm-ui-field="{title: ts('Mailing Name')}">
         {{mailing.name}}
       </div>
-      <div crm-ui-field crm-title="ts('Recipients')">
+      <div crm-ui-field="{title: ts('Recipients')}">
         <div ng-controller="ViewRecipCtrl">
           <div ng-controller="EditRecipCtrl">
             <div><a crm-icon="newwin" class="crm-hover-button action-item" ng-click="previewRecipients()">{{getRecipientsEstimate()}}</a></div>
@@ -21,12 +21,12 @@ Required vars: mailing
           </div>
         </div>
       </div>
-      <div crm-ui-field crm-title="ts('Content')">
+      <div crm-ui-field="{title: ts('Content')}">
         <span ng-show="mailing.body_html"><a crm-icon="newwin" class="crm-hover-button action-item" ng-click="previewMailing(mailing, 'html')">{{ts('HTML')}}</a></span>
         <span ng-show="mailing.body_html || mailing.body_text"><a crm-icon="newwin" class="crm-hover-button action-item" ng-click="previewMailing(mailing, 'text')">{{ts('Plain Text')}}</a></span>
         <!-- TODO: attachments -->
       </div>
-      <div crm-ui-field crm-title="ts('Attachments')" ng-show="attachments.files.length > 0 || attachments.uploader.queue.length > 0">
+      <div crm-ui-field="{title: ts('Attachments')}" ng-show="attachments.files.length > 0 || attachments.uploader.queue.length > 0">
         <div ng-repeat="file in attachments.files">
           <a ng-href="{{file.url}}" target="_blank">{{file.name}}</a>
         </div>
@@ -34,11 +34,11 @@ Required vars: mailing
           {{item.file.name}}
         </div>
       </div>
-      <div crm-ui-field crm-title="ts('Tracking')">
+      <div crm-ui-field="{title: ts('Tracking')}">
         <span crm-mailing-review-bool crm-on="mailing.url_tracking=='1'" crm-title="ts('Click Throughs')"></span>
         <span crm-mailing-review-bool crm-on="mailing.open_tracking=='1'" crm-title="ts('Opens')"></span>
       </div>
-      <div crm-ui-field crm-title="ts('Responding')">
+      <div crm-ui-field="{title: ts('Responding')}">
         <div>
           <span crm-mailing-review-bool crm-on="mailing.override_verp=='0'" crm-title="ts('Track Replies')"></span>
           <span crm-mailing-review-bool crm-on="mailing.override_verp=='0' && mailing.forward_replies=='1'" crm-title="ts('Forward Replies')"></span>
@@ -50,7 +50,7 @@ Required vars: mailing
           <span><a crm-icon="newwin" class="crm-hover-button action-item" ng-click="previewComponent(ts('Unsubscribe'), mailing.unsubscribe_id)">{{ts('Unsubscribe')}}</a></span>
         </div>
       </div>
-      <div crm-ui-field crm-title="ts('Publication')">
+      <div crm-ui-field="{title: ts('Publication')}">
         {{mailing.visibility}}
       </div>
     </div>
index 710734f7293d0c8fddaacfbd8956115162d16113..42421103a732e61679c8ff01d7b714c67a3fc0f2 100644 (file)
@@ -5,7 +5,7 @@ FIXME: Don't hardcode table-based layout!
 -->
 <div class="crm-block" ng-form="subform" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field="subform.mailingName" crm-title="ts('Mailing Name')">
+    <div crm-ui-field="{name: 'subform.mailingName', title: ts('Mailing Name')}">
       <div>
         <input
           crm-ui-id="subform.mailingName"
@@ -17,7 +17,7 @@ FIXME: Don't hardcode table-based layout!
           name="mailingName" />
       </div>
     </div>
-    <div crm-ui-field="subform.campaign" crm-title="ts('Campaign')" ng-show="crmMailingConst.campNames.length > 0">
+    <div crm-ui-field="{name: 'subform.campaign', title: ts('Campaign')}" ng-show="crmMailingConst.campNames.length > 0">
       <select
         crm-ui-id="subform.campaign"
         name="campaign"
index dd1500ea77a2cddc019e3f0137310c2b700fac28..85beb3803b2e3fff26e75450ab9ba328d250d0f9 100644 (file)
@@ -4,13 +4,13 @@ Required vars: mailing
 -->
 <div class="crm-block" ng-form="subform" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field="subform.url_tracking" crm-title="ts('Track Click Throughs')" crm-layout="checkbox">
+    <div crm-ui-field="{name: 'subform.url_tracking', title: ts('Track Click Throughs')}" crm-layout="checkbox">
       <input crm-ui-id="subform.url_tracking" name="url_tracking" type="checkbox" ng-model="mailing.url_tracking" ng-true-value="'1'" ng-false-value="'0'" />
     </div>
     <div class="crm-section" id="help">
       {{ts('Track the number of times recipients click each link in this mailing. NOTE: When this feature is enabled, all links in the message body will be automatically re-written to route through your CiviCRM server prior to redirecting to the target page.')}}
     </div>
-    <div crm-ui-field="subform.open_tracking" crm-title="ts('Track Opens')" crm-layout="checkbox">
+    <div crm-ui-field="{name: 'subform.open_tracking', title: ts('Track Opens')}" crm-layout="checkbox">
       <input crm-ui-id="subform.open_tracking" name="open_tracking" type="checkbox" ng-model="mailing.open_tracking" ng-true-value="'1'" ng-false-value="'0'" />
     </div>
     <div class="crm-section" id="help">
index b2d4aa203d846d325e0b9b0f1e6ef6c009052d42..82aa5c4e500911a928b11d5ea7e3bdd109c6a2eb 100644 (file)
@@ -15,7 +15,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
   <div class="crm-group">
 
 
-    <div crm-ui-field="subform.msg_template_id" crm-title="ts('Template')" ng-if="fields.msg_template_id">
+    <div crm-ui-field="{name: 'subform.msg_template_id', title: ts('Template')}" ng-if="fields.msg_template_id">
       <div ng-controller="MsgTemplateCtrl">
         <select
           crm-ui-id="subform.msg_template_id"
@@ -30,7 +30,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         <a crm-icon="disk" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
       </div>
     </div>
-    <div crm-ui-field="subform.msg_template_idA" crm-title="ts('Template (A)')" ng-if="fields.msg_template_idA">
+    <div crm-ui-field="{name: 'subform.msg_template_idA', title: ts('Template (A)')}" ng-if="fields.msg_template_idA">
       <div ng-controller="MsgTemplateCtrl">
         <select
           crm-ui-id="subform.msg_template_idA"
@@ -45,7 +45,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         <a crm-icon="disk" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
       </div>
     </div>
-    <div crm-ui-field="subform.msg_template_idB" crm-title="ts('Template (B)')" ng-if="fields.msg_template_idB">
+    <div crm-ui-field="{name: 'subform.msg_template_idB', title: ts('Template (B)')}" ng-if="fields.msg_template_idB">
       <div ng-controller="MsgTemplateCtrl">
         <select
           crm-ui-id="subform.msg_template_idB"
@@ -62,7 +62,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
     </div>
 
 
-    <div crm-ui-field="subform.fromAddress" crm-title="ts('From')" ng-if="fields.fromAddress">
+    <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From')}" ng-if="fields.fromAddress">
       <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a">
         <select
           crm-ui-id="subform.fromAddress"
@@ -75,7 +75,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         </select>
       </span>
     </div>
-    <div crm-ui-field="subform.fromAddressA" crm-title="ts('From (A)')" ng-if="fields.fromAddressA">
+    <div crm-ui-field="{name: 'subform.fromAddressA', title: ts('From (A)')}" ng-if="fields.fromAddressA">
       <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a">
         <select
           crm-ui-id="subform.fromAddressA"
@@ -88,7 +88,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         </select>
       </span>
     </div>
-    <div crm-ui-field="subform.fromAddressB" crm-title="ts('From (B)')" ng-if="fields.fromAddressB">
+    <div crm-ui-field="{name: 'subform.fromAddressB', title: ts('From (B)')}" ng-if="fields.fromAddressB">
       <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.b">
         <select
           crm-ui-id="subform.fromAddressB"
@@ -103,7 +103,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
     </div>
 
 
-    <div crm-ui-field="subform.replyTo" crm-title="ts('Reply-To')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyTo">
+    <div crm-ui-field="{name: 'subform.replyTo', title: ts('Reply-To')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyTo">
       <span ng-controller="EmailAddrCtrl">
         <select
           crm-ui-id="subform.replyTo"
@@ -117,7 +117,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         </select>
       </span>
     </div>
-    <div crm-ui-field="subform.replyToA" crm-title="ts('Reply-To (A)')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToA">
+    <div crm-ui-field="{name: 'subform.replyToA', title: ts('Reply-To (A)')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToA">
       <span ng-controller="EmailAddrCtrl">
         <select
           crm-ui-id="subform.replyToA"
@@ -131,7 +131,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         </select>
       </span>
     </div>
-    <div crm-ui-field="subform.replyToB" crm-title="ts('Reply-To (B)')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToB">
+    <div crm-ui-field="{name: 'subform.replyToB', title: ts('Reply-To (B)')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToB">
       <span ng-controller="EmailAddrCtrl">
         <select
           crm-ui-id="subform.replyToB"
@@ -147,7 +147,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
     </div>
 
 
-    <div crm-ui-field="subform.subject" crm-title="ts('Subject')" ng-if="fields.subject">
+    <div crm-ui-field="{name: 'subform.subject', title: ts('Subject')}" ng-if="fields.subject">
       <div style="float: right;">
         <input crm-mailing-token on-select="$broadcast('insert:subject', token.name)" tabindex="-1"/>
       </div>
@@ -161,7 +161,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         placeholder="Subject"
         name="subject" />
     </div>
-    <div crm-ui-field="subform.subjectA" crm-title="ts('Subject (A)')" ng-if="fields.subjectA">
+    <div crm-ui-field="{name: 'subform.subjectA', title: ts('Subject (A)')}" ng-if="fields.subjectA">
       <div style="float: right;">
         <input crm-mailing-token on-select="$broadcast('insert:subjectA', token.name)" tabindex="-1"/>
       </div>
@@ -175,7 +175,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         placeholder="Subject"
         name="subjectA" />
     </div>
-    <div crm-ui-field="subform.subjectB" crm-title="ts('Subject (B)')" ng-if="fields.subjectB">
+    <div crm-ui-field="{name: 'subform.subjectB', title: ts('Subject (B)')}" ng-if="fields.subjectB">
       <div style="float: right;">
         <input crm-mailing-token on-select="$broadcast('insert:subjectB', token.name)" tabindex="-1"/>
       </div>
index 7167566373d509fac83dc75e9acf0a03585407b4..2e30dd8dcadaeedc0aaa2c1181634362d9c1f49f 100644 (file)
@@ -4,7 +4,7 @@
       {{ts('A/B testing allows you to send two test mailings to a random subset of your recipients. After collecting and
       comparing metrics, the more successful mailing will be sent to the remaining recipients.')}}
     </div>
-    <div crm-ui-field="setupForm.abName" crm-title="ts('Name')" ng-if="fields.abName">
+    <div crm-ui-field="{name: 'setupForm.abName', title: ts('Name')}" ng-if="fields.abName">
       <input
         crm-ui-id="setupForm.abName"
         name="abName"
@@ -13,7 +13,7 @@
         placeholder="A/B Test Name"
         required/>
     </div>
-    <div crm-ui-field="setupForm.campaign" crm-title="ts('Campaign')" ng-show="crmMailingConst.campNames.length > 0"
+    <div crm-ui-field="{name: 'setupForm.campaign', title: ts('Campaign')}" ng-show="crmMailingConst.campNames.length > 0"
          ng-if="fields.campaign">
       <select
         crm-ui-id="setupForm.campaign"
@@ -26,7 +26,7 @@
         <option value=""></option>
       </select>
     </div>
-    <div crm-ui-field crm-title="ts('Test Type')" ng-if="fields.testing_criteria">
+    <div crm-ui-field="{title: ts('Test Type')}" ng-if="fields.testing_criteria">
       <div ng-repeat="criteria in crmMailingABCriteria.getAll()">
         <label>
           <input name="testing_criteria" ng-model="abtest.ab.testing_criteria" type="radio"
         </label>
       </div>
     </div>
-    <div crm-ui-field="setupForm.recipients" crm-title="ts('Recipients')" ng-if="fields.recipients">
+    <div crm-ui-field="{name: 'setupForm.recipients', title: ts('Recipients')}" ng-if="fields.recipients">
       <div crm-mailing-block-recipients="{name: 'recipients', id: 'setupForm.recipients'}" crm-mailing="abtest.mailings.a"></div>
     </div>
-    <div crm-ui-field crm-title="ts('Distribution')" ng-if="fields.group_percentage">
+    <div crm-ui-field="{title: ts('Distribution')}" ng-if="fields.group_percentage">
       <div crm-mailing-ab-slider ng-model="abtest.ab.group_percentage"></div>
     </div>
-    <div crm-ui-field crm-title="ts('Send')" ng-if="fields.scheduled_date">
+    <div crm-ui-field="{title: ts('Send')}" ng-if="fields.scheduled_date">
       <div crm-mailing-radio-date="schedule" ng-model="abtest.mailings.a.scheduled_date">
           <div>
             <input ng-model="schedule.mode" type="radio" name="send" value="now" id="schedule-send-now"/>
@@ -54,7 +54,7 @@
           </div>
       </div>
     </div>
-    <div crm-ui-field crm-title="ts('Assess')" ng-if="fields.declare_winning_time">
+    <div crm-ui-field="{title: ts('Assess')}" ng-if="fields.declare_winning_time">
       <div crm-mailing-radio-date="assessSched" ng-model="abtest.ab.declare_winning_time">
         <div>
           <input ng-model="assessSched.mode" type="radio" name="assess" value="now" id="schedule-assess-now"/>
index 5428b7316e9b44ed2dd6f4c45752e02c0c7d6c9a..3c0c4732c67ca149d9c1c4b3e8bf8591b483e7db 100644 (file)
@@ -1,7 +1,7 @@
 <label crm-depth="1">
   <span ng-transclude></span>
   <span ng-class="cssClasses">
-    {{crmTitle}}
+    {{crmUiField.title}}
   </span>
 </label>
 <div class="clear"></div>
index 5667526b47381ebdd676184674a6a0279510cada..20a5216b25ac6b54732721355738bc3808ad0dca 100644 (file)
@@ -1,6 +1,6 @@
 <div class="label">
-  <label crm-ui-for="{{crmUiField}}" crm-depth="1">{{crmTitle}}</label>
-  <a crm-ui-help="{title: crmTitle, id: crmHelp}" ng-if="crmHelp"></a>
+  <label crm-ui-for="{{crmUiField.name}}" crm-depth="1">{{crmUiField.title}}</label>
+  <a crm-ui-help="{title: crmUiField.title, id: crmUiField.help}" ng-if="crmUiField.help"></a>
 </div>
 <div class="content" ng-transclude></div>
 <div class="clear"></div>