| 1 | <!-- |
| 2 | Vars: mailing:obj, testContact:obj, testGroup:obj, crmMailing:FormController |
| 3 | --> |
| 4 | <div class="crmMailing-preview"> |
| 5 | <!-- Note: |
| 6 | In Firefox (at least), clicking the preview buttons causes the browser to display validation warnings |
| 7 | for unrelated fields *and* display preview. To avoid this weird UX, we disable preview buttons when the form is incomplete/invalid. |
| 8 | --> |
| 9 | <div class="preview-popup"> |
| 10 | <div ng-show="!mailing.body_html && !mailing.body_text"> |
| 11 | <em>({{:: ts('No content to preview') }})</em> |
| 12 | </div> |
| 13 | <div ng-hide="!mailing.body_html"> |
| 14 | <a class="crm-hover-button action-item" crm-icon="fa-television" ng-disabled="crmMailing.$invalid" ng-click="doPreview('html')">{{:: ts('Preview as HTML') }}</a> |
| 15 | </div> |
| 16 | <div ng-hide="!mailing.body_html && !mailing.body_text" style="margin-top: 1em;"> |
| 17 | <a class="crm-hover-button action-item" crm-icon="fa-file-text-o" ng-disabled="crmMailing.$invalid" ng-click="doPreview('text')">{{:: ts('Preview as Plain Text') }}</a> |
| 18 | </div> |
| 19 | <!-- |
| 20 | <div ng-hide="!mailing.body_html && !mailing.body_text"> |
| 21 | <button ng-disabled="crmMailing.$invalid" ng-click="doPreview('full')">{{:: ts('Preview') }}</button> |
| 22 | </div> |
| 23 | --> |
| 24 | </div> |
| 25 | <div class="preview-contact" ng-form=""> |
| 26 | <div> |
| 27 | {{:: ts('Send test email to:') }} |
| 28 | <a crm-ui-help="hs({id: 'test', title: ts('Test Email')})"></a> |
| 29 | </div> |
| 30 | <div> |
| 31 | <input |
| 32 | name="preview_test_email" |
| 33 | type="text" |
| 34 | class="crm-form-text" |
| 35 | ng-model="testContact.email" |
| 36 | placeholder="example@example.org" |
| 37 | crm-multiple-email |
| 38 | /> |
| 39 | </div> |
| 40 | <button crm-icon="fa-paper-plane" title="{{crmMailing.$invalid || !testContact.email ? ts('Complete all required fields first') : ts('Send test message to %1', {1: testContact.email})}}" ng-disabled="crmMailing.$invalid || !testContact.email" ng-click="doSend({email: testContact.email})" class="crmMailing-btn-primary">{{:: ts('Send test') }}</button> |
| 41 | </div> |
| 42 | <div class="preview-group" ng-form=""> |
| 43 | <div> |
| 44 | {{:: ts('Send test email to group:') }} |
| 45 | <a crm-ui-help="hs({id: 'test', title: ts('Test Email')})"></a> |
| 46 | </div> |
| 47 | <div> |
| 48 | <input |
| 49 | crm-entityref="{entity: 'Group', api: {params: {is_hidden: 0, is_active: 1}}, select: {allowClear:true, minimumInputLength: 0}}" |
| 50 | ng-model="testGroup.gid" |
| 51 | class="crm-action-menu fa-envelope-o" |
| 52 | /> |
| 53 | </div> |
| 54 | <button crm-icon="fa-paper-plane" title="{{crmMailing.$invalid || !testGroup.gid ? ts('Complete all required fields first') : ts('Send test message to group')}}" ng-disabled="crmMailing.$invalid || !testGroup.gid" crm-confirm="{resizable: true, width: '40%', height: '40%', open: previewTestGroup}" on-yes="doSend({gid: testGroup.gid})" class="crmMailing-btn-primary">{{:: ts('Send test') }}</button> |
| 55 | </div> |
| 56 | <div class="clear"></div> |
| 57 | </div> |