<div class="btn-group">
  <button type="button" ng-click="row.openScheduleMenu = true" class="btn btn-xs dropdown-toggle btn-primary-outline" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    {{:: row.data.schedule_id.length === 1 ? ts('1 Communication') : ts('%1 Communications', {1: row.data.schedule_id ? row.data.schedule_id.length : 0}) }} <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" ng-if=":: row.openScheduleMenu">
    <li ng-repeat="schedule_id in row.data.schedule_id" title="{{:: ts('Edit Scheduled Communication') }}">
      <a ng-href="{{ crmUrl('civicrm/admin/scheduleReminders/edit?reset=1&action=update&mapping_id=saved_search&id=' + schedule_id + '&entity_value=' + row.data.id) }}" target="crm-popup">
        <i class="crm-i fa-pencil"></i>
        {{ row.data.schedule_title[$index] }}
      </a>
    </li>
    <li class="divider" role="separator"></li>
    <li title="{{:: ts('Add Scheduled Communication') }}">
      <a ng-href="{{ crmUrl('civicrm/admin/scheduleReminders/edit?reset=1&action=add&mapping_id=saved_search&entity_value=' + row.data.id) }}" target="crm-popup">
        <i class="crm-i fa-plus"></i>
        {{:: ts('New Communication') }}
      </a>
    </li>
  </ul>
</div>
