CRM-15856 - crmMailing - Display a warning inline if required tokens are missing
authorTim Otten <totten@civicrm.org>
Thu, 12 Feb 2015 23:14:58 +0000 (15:14 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 12 Feb 2015 23:14:58 +0000 (15:14 -0800)
When you first fill in the body, we produce a popup on-blur to mention the
missing tokens.  However, when you edit an existing mailing, there is no
blur at first, and it's not clear what's wrong (unless you focus and blur
the problematic field).  This makes the problem more obvious.

css/angular-crmMailing.css
partials/crmMailing/body_html.html
partials/crmMailing/body_text.html

index 1d86ccfcc722dc9b78541e1711686063fa54692f..1e450405ddaa16cba600c7138aa3ad8e96a0226a 100644 (file)
@@ -121,3 +121,6 @@ a.crmMailing-submit-button.disabled div:hover, a.crmMailing-submit-button.blocki
   background: none;
 }
 
+.crmMailing-error-link {
+  color: red;
+}
index e1d23a894993e37b8146528e7d89e877ff9b9e50..eb3b404de9c1a70230e91e2d199431be12764306 100644 (file)
@@ -16,6 +16,9 @@ Required vars: mailing
         ng-blur="checkTokens(mailing, 'body_html', 'insert:body_html')"
         ></textarea>
       <span ng-model="body_html_tokens" crm-ui-validate="hasAllTokens(mailing, 'body_html')"></span>
+      <div ng-show="htmlForm.$error.crmUiValidate" class="crmMailing-error-link">
+        {{ts('Required tokens are missing.')}} <a class="helpicon" ng-click="checkTokens(mailing, 'body_html', 'insert:body_html')"></a>
+      </div>
     </div>
   </div>
 </div>
index f3ac7c7598bbc745cb2d7117ec430efb1b8f247b..971940194df059f76e58492f073babb9bb57b14f 100644 (file)
@@ -16,6 +16,9 @@ Required vars: mailing, crmMailingConst
         ng-blur="checkTokens(mailing, 'body_text', 'insert:body_text')"
         ></textarea>
       <span ng-model="body_text_tokens" crm-ui-validate="hasAllTokens(mailing, 'body_text')"></span>
+      <div ng-show="textForm.$error.crmUiValidate" class="crmMailing-error-link">
+        {{ts('Required tokens are missing.')}} <a class="helpicon" ng-click="checkTokens(mailing, 'body_text', 'insert:body_text')"></a>
+      </div>
     </div>
   </div>
 </div>