-<div crm-ui-accordion crm-title="ts('Debug')" crm-collapsed="true">
- <pre>{{mailing|json}}</pre>
-</div>
+<div crm-ui-debug="mailing"></div>
<div ng-show="isSubmitted()">
{{ts('This mailing has been submitted.')}}
</div>
-<form name="crmMailing" novalidate ng-hide="isSubmitted()" crm-autosave="save()" crm-autosave-model="mailing" crm-autosave-if="true">
+<form name="crmMailing" novalidate ng-hide="isSubmitted()">
<div class="crm-block crm-form-block crmMailing">
<div crm-ui-wizard>
<div crm-ui-wizard-step crm-title="ts('Define Mailing')" ng-form="defineForm">
- <div crm-ui-accordion crm-title="ts('Summary')">
- <div crm-mailing-block-summary crm-mailing="mailing"/>
- </div>
<div crm-ui-tab-set>
<div crm-ui-tab id="tab-mailing" crm-title="ts('Mailing')">
+ <div crm-mailing-block-summary crm-mailing="mailing"/>
<div crm-mailing-block-mailing crm-mailing="mailing"/>
<div crm-ui-accordion crm-title="ts('HTML')">
<div crm-mailing-body-html crm-mailing="mailing"/>
</div>
- <div crm-ui-accordion crm-title="ts('Plain Text')" crm-collapsed='true'>
+ <div crm-ui-accordion crm-title="ts('Plain Text')" crm-collapsed='!mailing.body_text'>
<div crm-mailing-body-text crm-mailing="mailing"/>
</div>
<span ng-model="placeholder" crm-ui-validate="mailing.body_html || mailing.body_text"></span>
<div crm-mailing-block-schedule crm-mailing="mailing"/>
</div>
<center>
- <a class="crmMailing-submit-button" ng-click="submit()" ng-class="{disabled: block.check() || crmMailing.$invalid}">
+ <a class="button crmMailing-submit-button" ng-click="submit()" ng-class="{blocking: block.check(), disabled: crmMailing.$invalid}">
<div>{{ts('Submit Mailing')}}</div>
</a>
</center>
</div>
<span crm-ui-wizard-buttons style="float:right;">
- <button ng-disabled="block.check()" crm-confirm="{title:ts('Delete Draft?'), message:ts('Are you sure you want to delete the draft mailing?')}" on-yes="delete()">{{ts('Delete Draft')}}</button>
- <button ng-disabled="block.check()" ng-click="save()">{{ts('Save Draft')}}</button>
+ <button
+ crm-icon="trash"
+ ng-show="checkPerm('delete in CiviMail')"
+ ng-disabled="block.check()"
+ crm-confirm="{title:ts('Delete Draft'), message:ts('Are you sure you want to permanently delete this mailing?')}"
+ on-yes="delete()">{{ts('Delete Draft')}}</button>
+ <button crm-icon="disk" ng-disabled="block.check()" ng-click="save().then(leave)">{{ts('Save Draft')}}</button>
</span>
</div>
</div>