authors.template.html 1.6 KB

123456789101112131415161718192021222324
  1. <h2 class="page-header">Athors</h2>
  2. <button class="btn btn-primary pull-right" ng-click="addAuthors()">Add Author</button>
  3. <table class="table table-hover">
  4. <thead>
  5. <th>Firstname</th>
  6. <th>Lastname</th>
  7. </thead>
  8. <tbody ng-repeat="author in authors">
  9. <td><span editable-text="author.firstname" e-form='editableForm' e-ng-model='author.firstname' e-name='firstname'>{{author.firstname || '-'}}</span></td>
  10. <td><span editable-text="author.lastname" e-form='editableForm' e-ng-model='author.lastname' e-name='lastname'>{{author.lastname || '-'}}</span></td>
  11. <td class="float-right">
  12. <span ng-show="!editableForm.$visible">
  13. <button class="btn-danger btn-xs pull-right" ng-click="deleteAuthor(author.id)"><i class="glyphicon glyphicon-trash"></i></button>
  14. <button class="btn-warning btn-xs pull-right" ng-click="editableForm.$show()"><i class="glyphicon glyphicon-pencil"></i></button>
  15. </span>
  16. <form editable-form name="editableForm" ng-show="editableForm.$visible" onaftersave='saveAuthor($data,author.id)' shown='inserted === author'>
  17. <span>
  18. <button type="button" class="btn-danger btn-lg pull-right" ng-disabled="editableForm.$waiting" ng-click="editableForm.$cancel()"><i class="glyphicon glyphicon-remove"></i></button>
  19. <button type="submit" class="btn-warning btn-lg pull-right" ng-disabled="editableForm.$waiting" ng-click=""><i class="glyphicon glyphicon-ok "></i></button>
  20. </span>
  21. </form>
  22. </td>
  23. </tbody>
  24. </table>