-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6359c02
commit bafd277
Showing
2 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
full-stack-javascript/20-forms-and-deployment/views/book_delete.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<%- include('./partials/header') %> | ||
<body> | ||
<%- include('./partials/nav.ejs') %> | ||
<main> | ||
<div class="content"> | ||
<h1>Book: <%= book.title %></h1> | ||
<p><%= book.author.name %></p> | ||
<p><%= book.summary %></p> | ||
<br /> | ||
<% if (book_copies.length) { %> | ||
<p> | ||
Delete the following book copies before attempting to delete this | ||
book. | ||
</p> | ||
<h2>Book Copies</h2> | ||
<% book_copies.forEach(copy => { %> | ||
<a class="text-success" href="<%= copy.url %>"><%= copy.id %></a> | ||
<p>Imprint: <%= copy.imprint %></p> | ||
<% }) %> <% } else { %> | ||
<p>Do you really want to delete this Book?</p> | ||
<form action="" method="post"> | ||
<input | ||
type="hidden" | ||
name="bookid" | ||
id="bookid" | ||
value="<%= book._id %>" | ||
/> | ||
<button type="submit">Delete</button> | ||
</form> | ||
<% } %> | ||
</div> | ||
<%- include('./partials/footer') %> | ||
</main> | ||
</body> | ||
</html> |