[text] available_books.html

Viewer

copydownloadembedprintName: available_books.html
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4.     <meta charset="ISO-8859-1">
  5.     <title>Welcome to Tas kLibrary</title>
  6.     <link rel="stylesheet" type="text/css" href="/webjars/bootstrap/css/bootstrap.min.css">
  7.     <script type="text/javascript" src="/webjars/jquery/jquery.min.js"></script>
  8.     <script type="text/javascript" src="/webjars/bootstrap/js/bootstrap.min.js"></script>
  9.     <script type="text/javascript">
  10. function borrowBook(userEmail, bookIds){
  11. let fetchRes = fetch(
  12. "https://localhost:8081/book?userEmail=email&bookIds=["abc","bbc"]");
  13. fetchRes.then(res =>
  14. userEmail=this.userEmail
  15.  
  16.     res.json()).then(d => {
  17.         console.log(d)
  18.     })
  19. }
  20. </script>
  21.     <title>Books List</title>
  22. </head>
  23. </head>
  24. <body>
  25. <div class="container text-center">
  26.     <div>
  27.         <form th:action="@{/logout}" method="post">
  28.             <p>
  29.                 Welcome <b>[[${#request.userPrincipal.principal.fullName}]]</b>
  30.             </p>
  31.             <input type="submit" value="Sign Out">
  32.         </form>
  33.     </div>
  34.     <div class="btn-group">
  35.         <form th:action="@{/all}" method="get">
  36.             <input type="submit" value="All books">
  37.         </form>
  38.         <form th:action="@{/available}" method="get">
  39.             <input type="submit" value="Available books">
  40.         </form>
  41.         <form th:action="@{/filter}" method="get">
  42.             <input type="submit" value="Filter books">
  43.         </form>
  44.  
  45.  
  46.     </div>
  47.  
  48.  
  49.     <div>
  50.         <h1>Welcome to the books List</h1>
  51.     </div>
  52.  
  53.  
  54.     <div>
  55.         <table class="table table-striped table-bordered">
  56.             <thead class="thead-dark">
  57.             <tr>
  58.                 <th>Book ID</th>
  59.                 <th>Title</th>
  60.                 <th>Author</th>
  61.                 <th>Genre</th>
  62.                 <th>Price</th>
  63.                 <th>Publish Date</th>
  64.                 <th>Description</th>
  65.                 <th>Borrowed</th>
  66.                 <th>Borrowed By</th>
  67.             </tr>
  68.             </thead>
  69.             <tbody>
  70.             <tr th:each="book: ${listBooks}">
  71.                 <td th:text="${book.getId}"> Book-ID </td>
  72.                 <td th:text="${book.getTitle}">Title </td>
  73.                 <td th:text="${book.author}">Author</td>
  74.                 <td th:text="${book.genre}">Genre</td>
  75.                 <td th:text="${book.price}">Price</td>
  76.                 <td th:text="${book.publish_date}">Publish-Date</td>
  77.                 <td th:text="${book.description}">Description</td>
  78.                 <td th:text="${book.borrowed}">Borrowed</td>
  79.                 <td th:text="${book.borrowedBy}">Borrowed-By</td>
  80.                 <td> <input type="checkbox"id="" name="requestedBooks"value=""></td>
  81.             </tr>
  82.             </tbody>
  83.         </table>
  84.     </div>
  85.     <div class="btn-group">
  86.         <button onclick="borrowBook(userEmail, bookIds)">Borrow</button>
  87.         <button onclick="returnBook(userEmail, bookId)">Return</button>
  88.     </div>
  89.  
  90. </div>
  91. </body>
  92. </html>

Editor

You can edit this paste and save as new:


File Description
  • available_books.html
  • Paste Code
  • 19 May-2021
  • 2.97 Kb
You can Share it: