You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.5 KiB
59 lines
1.5 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Edit <%=author.name%>'s Info</h1>
|
|
<nav>
|
|
<ul>
|
|
<li>
|
|
<a href="/">Home</a>
|
|
</li>
|
|
<li>
|
|
<a href="/authors/<%=author._id%>"><%=author.name%>'s Show Page</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</header>
|
|
<main>
|
|
<section>
|
|
<h2>Author Attributes:</h2>
|
|
<form action="/authors/<%=author._id%>?_method=PUT" method="post">
|
|
<input type="text" name="name" value="<%=author.name%>"/><br/>
|
|
<input type="submit" value="Update Author"/>
|
|
</form>
|
|
</section>
|
|
<section>
|
|
<h2>Articles Written By This Author</h2>
|
|
<ul>
|
|
<% for(var i = 0; i < author.articles.length; i++) { %>
|
|
<li>
|
|
<%=author.articles[i].title%>
|
|
<form action="/authors/<%=author._id%>/articles/<%=author.articles[i]._id%>?_method=DELETE" method="post">
|
|
<input type="submit" value="Remove This Author's Attribution from This Article" />
|
|
</form>
|
|
</li>
|
|
<% } %>
|
|
</ul>
|
|
</section>
|
|
<section>
|
|
<h2>Articles Not Written By This Author</h2>
|
|
<ul>
|
|
<% for(var i = 0; i < articles.length; i++) { %>
|
|
<li>
|
|
<%=articles[i].title%>
|
|
<form action="/authors/<%=author._id%>/articles" method="post">
|
|
<input type="hidden" name="articleId" value="<%=articles[i]._id%>">
|
|
<input type="submit" value="Attribute Article To This Author" />
|
|
</form>
|
|
</li>
|
|
<% } %>
|
|
</ul>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|