Second Commit

This commit is contained in:
2021-04-15 13:06:31 +05:30
parent 7f1d1f54e7
commit 129cd9cbcc
169 changed files with 11137 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<div class="col-lg-4 mb-4" id="book_<%= book.id%>">
<div class="card h-100 shadow-sm">
<h4 class="card-header"><%= book.title %></h4>
<div class="card-body">
<p class="card-text">
<span> <%= book.description %> </span>
</div>
<% if current_user %>
<div class="card-footer">
<% if book.available_copies > 0 %>
<% unless current_user.books.include?book %>
<%= link_to 'Borrow', borrow_path(book), class: "btn btn-success", remote: true %>
<% else %>
<%= link_to 'Borrowed', 'javascript:;', class: "btn btn-primary", remote: true %>
<% end %>
<% else %>
<a href="javascript:;" class= "btn btn-secondary">Not available</a>
<% end %>
</div>
<% end %>
</div>
</div>

View File

@@ -0,0 +1,5 @@
<h1 class="my-4">The complete list of all books</h1>
<div class="row">
<%= render partial: 'books/book', collection: @books%>
</div>
<%= paginate @books, theme: 'twitter-bootstrap-4' %>