books-list.template.html 1.8 KB

12345678910111213141516171819202122232425262728293031
  1. <div class="page-header">
  2. <h1>Books list</h1>
  3. </div>
  4. <input type="text" placeholder="Filter" class="form-control" ng-model="searchString" /><br />
  5. <table class="table table-hover">
  6. <thead>
  7. <tr>
  8. <th ng-click="sortBy('title')"><i class="glyphicon" ng-class="{'glyphicon-chevron-up' : sortField === 'title', 'glyphicon-chevron-down' : sortField === '-title'}"></i> Title</th>
  9. <th ng-click="sortBy('author')"><i class="glyphicon" ng-class="{'glyphicon-chevron-up' : sortField === 'author', 'glyphicon-chevron-down' : sortField === '-author'}"></i>Author</th>
  10. <th ng-click="sortBy('date')"><i class="glyphicon" ng-class="{'glyphicon-chevron-up' : sortField === 'date', 'glyphicon-chevron-down' : sortField === '-date'}"></i>Date</th>
  11. <th ng-click="sortBy('cost')"><i class="glyphicon" ng-class="{'glyphicon-chevron-up' : sortField === 'cost', 'glyphicon-chevron-down' : sortField === '-cost'}"></i>Cost</th>
  12. <th ng-click="sortBy('rate')"><i class="glyphicon" ng-class="{'glyphicon-chevron-up' : sortField === 'rate', 'glyphicon-chevron-down' : sortField === '-rate'}"></i>Rate</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. <tr ng-repeat="book in books | orderBy:sortField | filter: searchString track by $index">
  17. <td>{{book.title}}</td>
  18. <td>{{book.author | uppercase}}</td>
  19. <td>{{book.date | date: 'longDate'}}</td>
  20. <td>{{book.cost | currency}}</td>
  21. <td>{{book.rate | number : 1 }}</td>
  22. <td>
  23. <a href="#/books/{{book.id}}" class="btn btn-info btn-xs"><i class="glyphicon glyphicon-eye-open"></i></a>
  24. <button class="btn-danger btn-xs" ng-click="deleteBook(book)"><i class="glyphicon glyphicon-trash"></i></button>
  25. </td>
  26. </tr>
  27. </tbody>
  28. </table>
  29. <div class="text-center" ng-if="!books.length">
  30. No Data
  31. </div>