<!--
Controller: EditMailingCtrl
Required vars: mailing, attachments
-->
<div>
  <div class="crm-block" ng-form="reviewForm" crm-ui-id-scope>
    <div class="crm-group">
      <div crm-ui-field="{title: ts('Mailing Name')}">
        {{mailing.name}}
      </div>
      <div crm-ui-field="{title: ts('Recipients')}">
        <div ng-controller="ViewRecipCtrl">
          <div ng-controller="EditRecipCtrl">
            <div><a crm-icon="fa-users" class="crm-hover-button action-item" ng-click="previewRecipients()">{{getRecipientCount()}}</a></div>
            <div ng-show="getIncludesAsString(mailing)">
              (<strong>{{:: ts('Include:') }}</strong> {{getIncludesAsString(mailing)}})
            </div>
            <div ng-show="getExcludesAsString(mailing)">
              (<strong>{{:: ts('Exclude:') }}</strong> <s>{{getExcludesAsString(mailing)}}</s>)
            </div>
          </div>
        </div>
      </div>
      <div crm-ui-field="{title: ts('Content')}">
        <span ng-show="mailing.body_html"><a crm-icon="fa-television" 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="fa-file-text-o" class="crm-hover-button action-item" ng-click="previewMailing(mailing, 'text')">{{:: ts('Plain Text') }}</a></span>
      </div>
      <div crm-ui-field="{title: ts('Attachments')}">
        <div ng-repeat="file in attachments.files">
          <a ng-href="{{file.url}}" target="_blank">{{file.name}}</a>
        </div>
        <div ng-repeat="item in attachments.uploader.queue">
          {{item.file.name}}
        </div>
        <div ng-show="!attachments.files.length && !attachments.uploader.queue.length"><em>{{:: ts('None') }}</em></div>
      </div>
      <div ng-if="crmMailingConst.isMultiLingual" crm-ui-field="{title: ts('Language')}">
        {{crmMailingConst.enabledLanguages[mailing.language]}}
      </div>
      <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="{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>
        </div>
        <div ng-controller="PreviewComponentCtrl">
          <span ng-show="mailing.override_verp == '0' && mailing.auto_responder"><a crm-icon="fa-envelope" class="crm-hover-button action-item" ng-click="previewComponent(ts('Auto-Respond'), mailing.reply_id)">{{:: ts('Auto-Respond') }}</a></span>
          <span><a crm-icon="fa-envelope" class="crm-hover-button action-item" ng-click="previewComponent(ts('Opt-out'), mailing.optout_id)">{{:: ts('Opt-out') }}</a></span>
          <span><a crm-icon="fa-envelope" class="crm-hover-button action-item" ng-click="previewComponent(ts('Resubscribe'), mailing.resubscribe_id)">{{:: ts('Resubscribe') }}</a></span>
          <span><a crm-icon="fa-envelope" class="crm-hover-button action-item" ng-click="previewComponent(ts('Unsubscribe'), mailing.unsubscribe_id)">{{:: ts('Unsubscribe') }}</a></span>
        </div>
      </div>
      <div crm-ui-field="{title: ts('Publication')}">
        {{mailing.visibility}}
      </div>
    </div>
  </div>
</div>
