books-list.template.html 1.9 KB

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