Remove template field if using Mosaico in non shoreditch mode
authorSeamus Lee <seamuslee001@gmail.com>
Tue, 30 Jul 2019 21:28:19 +0000 (07:28 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Thu, 8 Aug 2019 04:51:56 +0000 (14:51 +1000)
Use double equals instead of single equals

ang/crmMailing/BlockMailing.html
ang/crmMailingAB/BlockMailing.html

index 8e09974322ce46b3edd8587e415e2db98cd026f9..3f6c7ca44aa1895d2431a409cb51c817c4d825d5 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="{name: 'subform.msg_template_id', title: ts('Template')}">
+    <div crm-ui-field="{name: 'subform.msg_template_id', title: ts('Template')}" ng-if="mailing.template_type=='traditional'">
       <div crm-mailing-block-templates="{name: 'templates', id: 'subform.msg_template_id'}" crm-mailing="mailing"></div>
     </div>
     <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From'), help: hs('from_email')}">
index 92448156415210214fa1c84f16404ef64666cee4..592e94c847fe38e9a23600790f503f631ee55013 100644 (file)
@@ -14,57 +14,57 @@ processed by Angular; if false, the field will be hidden and completely ignored
 <div class="crm-block" ng-form="subform" crm-ui-id-scope>
   <div class="crm-group">
 
-
-    <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"
-          name="msg_template_id"
-          class="fa-clipboard"
-          crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
-          ng-model="abtest.mailings.a.msg_template_id"
-          ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
-          >
-          <option value=""></option>
-          <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
-        </select>
-        <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
+    <div ng-if="abtest.mailings.a.template_type=='traditional'">
+      <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"
+            name="msg_template_id"
+            class="fa-clipboard"
+            crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
+            ng-model="abtest.mailings.a.msg_template_id"
+            ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
+            >
+            <option value=""></option>
+            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
+          </select>
+          <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
+        </div>
       </div>
-    </div>
-    <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"
-          name="msg_template_idA"
-          class="fa-clipboard"
-          crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
-          ng-model="abtest.mailings.a.msg_template_id"
-          ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
-          >
-          <option value=""></option>
-          <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
-        </select>
-        <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
+      <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"
+            name="msg_template_idA"
+            class="fa-clipboard"
+            crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
+            ng-model="abtest.mailings.a.msg_template_id"
+            ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
+            >
+            <option value=""></option>
+            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
+          </select>
+          <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
+        </div>
       </div>
-    </div>
-    <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"
-          name="msg_template_idB"
-          class="fa-clipboard"
-          crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
-          ng-model="abtest.mailings.b.msg_template_id"
-          ng-change="loadTemplate(abtest.mailings.b, abtest.mailings.b.msg_template_id)"
-          >
-          <option value=""></option>
-          <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
-        </select>
-        <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.b)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
+      <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"
+            name="msg_template_idB"
+            class="fa-clipboard"
+            crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
+            ng-model="abtest.mailings.b.msg_template_id"
+            ng-change="loadTemplate(abtest.mailings.b, abtest.mailings.b.msg_template_id)"
+            >
+            <option value=""></option>
+            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
+          </select>
+          <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.b)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
+        </div>
       </div>
     </div>
 
-
     <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From'), help: hs('from_email')}" ng-if="fields.fromAddress">
       <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a">
         <select