<div id="bootstrap-theme" crm-dialog="crmSearchTask">
  <form ng-controller="crmSearchTaskDelete as $ctrl">
    <p><strong>{{:: ts('Are you sure you want to delete %1 %2?', {1: model.ids.length, 2: $ctrl.entityTitle}) }}</strong></p>
    <hr />
    <div ng-if="$ctrl.run" class="crm-search-task-progress">
      <h5>{{:: ts('Deleting %1 %2...', {1: model.ids.length, 2: $ctrl.entityTitle}) }}</h5>
      <crm-search-batch-runner entity="model.entity" action="delete" params="$ctrl.run" ids="model.ids" success="$ctrl.onSuccess()" error="$ctrl.onError()" ></crm-search-batch-runner>
    </div>

    <crm-dialog-button text="ts('Cancel')" icons="{primary: 'fa-times'}" on-click="$ctrl.cancel()" disabled="$ctrl.run" ></crm-dialog-button>
    <crm-dialog-button text="ts('Delete %1', {1: $ctrl.entityTitle})" icons="{primary: $ctrl.run ? 'fa-spin fa-spinner' : 'fa-trash'}" on-click="$ctrl.start()" disabled="$ctrl.run" ></crm-dialog-button>
  </form>
</div>
