<fieldset class="crm-search-admin-display-header">
  <div class="form-inline">
    <label for="crm-search-admin-display-label">{{:: ts('Name') }} <span class="crm-marker">*</span></label>
    <input id="crm-search-admin-display-label" type="text" class="form-control" ng-model="$ctrl.display.label" required placeholder="{{:: ts('Untitled') }}"/>
    <div class="form-control" ng-class="{disabled: !$ctrl.parent.isSuperAdmin}" title="{{:: $ctrl.parent.aclBypassHelp }}">
      <label>
        <input type="checkbox" ng-if="$ctrl.parent.isSuperAdmin" ng-model="$ctrl.display.acl_bypass" style="display: none;">
        <i class="crm-i fa-lock text-success" ng-if="!$ctrl.display.acl_bypass"></i>
        <i class="crm-i fa-unlock text-danger" ng-if="$ctrl.display.acl_bypass"></i>
        <span>{{ $ctrl.display.acl_bypass ? ts('Bypass Permissions') : ts('Enforce Permissions') }}</span>
      </label>
    </div>
    <div class="help-block bg-warning" ng-if="$ctrl.display.acl_bypass">
      <i class="crm-i fa-unlock"></i>
      {{:: ts('Anyone who can view this display will be able to see all results, regardless of their permission level.') }}
    </div>
  </div>
  <div>
    <textarea class="form-control" placeholder="{{:: ts('Description (shown above)') }}" ng-model="$ctrl.display.settings.description"></textarea>
  </div>
</fieldset>
<div class="form-group crm-search-admin-right crm-search-admin-display-header-links" ng-if="$ctrl.display.id">
  <a ng-href="{{ $ctrl.parent.crmSearchAdmin.searchDisplayPath + '#/display/' + $ctrl.parent.savedSearch.name + '/' + $ctrl.display.name }}" target="_blank" class="btn btn-primary-outline" title="{{:: ts('View search display on its own page') }}">
    <i class="crm-i fa-external-link"></i>
    {{:: ts('View Display') }}
  </a>
</div>
