<form class="form-inline" ng-submit="apply()">
  <div title="{{ 'Type filter' | translate }}" class="c8y-select-wrapper form-group">
    <select
      for="typeFilter"
      name="type"
      class="form-control"
      style="max-width: 120px"
      ng-model="viewFilter.type"
      ng-options="type.name as (type.label | translate) for type in types | orderBy:'label'"
    >
      <option value="" selected="selected">{{ 'All types' | translate }}</option>
    </select>
    <span></span>
  </div>

  <div class="form-group datepicker">
    <input
      name="dateFrom"
      class="form-control"
      placeholder="{{ 'Date from' | translate }}"
      ng-model="viewFilter.dateFrom"
      uib-datepicker-popup="{{ datepickerFormat }}"
      datepicker-options="{ maxDate: viewFilter.dateTo, showWeeks: true }"
      datepicker-append-to-body="true"
      show-button-bar="false"
      is-open="dateOpen.from"
      ng-click="open('from')"
    />
  </div>

  <div class="form-group datepicker">
    <input
      name="dateTo"
      class="form-control"
      placeholder="{{ 'Date to' | translate }}"
      ng-model="viewFilter.dateTo"
      uib-datepicker-popup="{{ datepickerFormat }}"
      datepicker-options="{ minDate: viewFilter.dateFrom, showWeeks: true }"
      datepicker-append-to-body="true"
      show-button-bar="false"
      is-open="dateOpen.to"
      ng-click="open('to')"
    />
  </div>

  <div class="input-group m-l-8">
    <label class="sr-only" for="whoUser">{{ 'Who' | translate }}</label>
    <input
      type="text"
      title="{{ 'Who' | translate }}"
      class="form-control"
      name="user"
      id="whoUser"
      placeholder="{{ 'Who' | translate }}"
      ng-model="viewFilter.user"
    />

    <div class="input-group-btn">
      <button
        title="{{ 'Apply filters' | translate }}"
        name="apply"
        type="submit"
        class="btn btn-default"
      >
        {{ 'Apply filters' | translate }}
      </button>
    </div>
    <div class="input-group-btn">
      <button
        title="{{ 'Clear filters' | translate }}"
        name="clear"
        type="button"
        class="btn btn-default"
        ng-click="clear()"
        ng-show="anyFilter()"
      >
        <i c8y-icon="times"></i>
      </button>
    </div>
  </div>
</form>
