<div class="container">
  <div class="margin-bottom-md clearfix">
    <div class="col-sm-8 col-xs-12 margin-bottom-md">
      <form action="" name="searchForm" ng-submit="search()" novalidate>
        <select ng-options="item.value as item.name for item in searchOptions" ng-model="filterType"></select>
        <input type="text" ng-model="filterValue" placeholder="Enter search" size="12" required>
        <button type="submit" class="btn btn-default btn-xs" ng-disabled="searchForm.$invalid"><i class="fa fa-search"></i></button>
      </form>
    </div>

    <div class="col-sm-4 col-xs-12 text-right">
      <button class="btn btn-default" type="button" ng-click="clearSorting()">Clear sorting</button>
    </div>
  </div>

  <div loading-container="tableParams.settings().$loading">
    <table ng-table="tableParams" show-filter="false" class="table">
      <tbody>
        <tr ng-repeat="request in $data track by request.id">
          <td data-title="'File Name'" sortable="'title'">{{request.title}}</td>
          <td data-title="'Job ID'" sortable="'job_id'">{{request.job_id}}</td>
          <!-- <td data-title="'Last Name'" sortable="'installer_last'">{{request.installer_last}}</td>
          <td data-title="'First Name'" sortable="'installer_first'">{{request.installer_first}}</td> -->
          <td data-title="'Installation Date'" sortable="'date'">{{request.date}}</td>
          <td  data-title="'Status'" sortable="'status'"> 
            <span class="text-danger" ng-if="request.status == 0">Not Ready</span>
            <span class="text-primary" ng-if="request.status == 1">Processing</span>
            <button type="button" class="btn btn-default" ng-if="request.status == 2" ng-click="jobImport(request.job_id)"><span class="text-success">Ready</span></button>
         </td>
        </tr>
      </tbody>
    </table>
  </div> 
  

  <ul class="pager">
    <li class="previous">
      <button type="button" ng-disabled="tableParams.$params.page === 1" ng-click="tableParams.page(tableParams.$params.page-1)"><span aria-hidden="true">&larr;</span> Previous</button>
    </li>

    <li class="next">
      <button type="button" ng-disabled="tableParams.data.length < tableParams.$params.count" ng-click="tableParams.page(tableParams.$params.page+1)">Next <span aria-hidden="true">&rarr;</span></button>
    </li>
  </ul>
</div>