Books
<% if(books.length != 0) { %>
| ID |
Name |
Author |
Year |
Genre |
ISBN |
ISBN10 |
Copies |
Actions |
<% books.forEach((book, index) => { %>
| <%= index + 1 %> |
<%= book.data.name %> |
<%= book.data.author %> |
<%= book.data.year %> |
<%= book.data.genre %> |
<%= book.data.ISBN %> |
<%= book.data.ISBN10 %> |
<%= book.data.checkout.length %> / <%= book.data.copies %> |
<% if (!user.checkout.includes(book.ID)) { %>
Checkout
<% } %>
<% if (user.checkout.includes(book.ID)) { %>
Return
<% } %>
<% if (user.role == "admin") { %>
<% if (book.data.checkout.length === 0) { %>
View <%= book.data.checkout.length %> Users
<% } else { %>
View <%= book.data.checkout.length %> Users
<% } %>
Edit
<% } %>
|
<% }); %>
<% } else {%>
No Books in Database
<% }%>