Added New and Update Book and Author pages

parent 77a186e1
{%extends "base.html"%}
{% load static %}
{% block content%}
<title>Add New Author</title>
<form method= "POST">
{% csrf_token %}
{{ form.as_p }}
<input type= "submit" value="Add Author">
</form>
{% endblock content%}
\ No newline at end of file
{%extends "base.html"%}
{% load static %}
{% block content%}
<title>Add New Book</title>
<form method= "POST" enctype ="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<input type= "submit" value="Add Book">
</form>
{% endblock content%}
\ No newline at end of file
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
<h2>{{object.nationality}}</h2> <h2>{{object.nationality}}</h2>
<h2>{{object.bio}}</h2> <h2>{{object.bio}}</h2>
<br>
<a href="/authors/{{object.pk}}/edit">
<input type="button" value= "Edit Author"></a>
<br>
<br>
<h1>Books by {{object.first_name}} {{object.last_name}} I love:</h1> <h1>Books by {{object.first_name}} {{object.last_name}} I love:</h1>
{% for details in bookdetail %} {% for details in bookdetail %}
<li> <li>
...@@ -18,6 +24,8 @@ ...@@ -18,6 +24,8 @@
</li> </li>
{%endfor%} {%endfor%}
<br>
<br>
<div style="text-align:center;"> <div style="text-align:center;">
<a href= "/home">Home</a> <a href= "/home">Home</a>
<a href= "/books">Books</a> <a href= "/books">Books</a>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<h1>Anchi's Favorite Authors:</h1> <h1>Anchi's Favorite Authors:</h1>
{% for author in authors_list %} {% for author in authors_list %}
<li> <li>
<a href="{% url 'author_details' author.pk %}"> <a href="{% url 'authordetails' author.pk %}">
{{author.first_name}} {{author.last_name}}<br> {{author.first_name}} {{author.last_name}}<br>
</a> </a>
</li> </li>
......
...@@ -17,4 +17,8 @@ ...@@ -17,4 +17,8 @@
<a href= "/books">Books</a> <a href= "/books">Books</a>
<a href= "/authors">Authors</a> <a href= "/authors">Authors</a>
</div> </div>
<br>
<br>
<a href="/books/{{object.pk}}/edit">
<input type="button" value= "Edit Book"></a>
{% endblock content%} {% endblock content%}
{%extends "base.html"%}
{% load static %}
{% block content%}
<title>Edit Author</title>
<form method= "POST">
{% csrf_token %}
{{ form.as_p }}
<input type= "submit" value="Save Changes">
</form>
{% endblock content%}
\ No newline at end of file
{%extends "base.html"%}
{% load static %}
{% block content%}
<title>Edit Book</title>
<form method= "POST">
{% csrf_token %}
{{ form.as_p }}
<input type= "submit" value="Save Changes">
</form>
{% endblock content%}
\ No newline at end of file
...@@ -16,5 +16,9 @@ ...@@ -16,5 +16,9 @@
<a href= "/books">Books</a> <a href= "/books">Books</a>
<a href= "/authors">Authors</a> <a href= "/authors">Authors</a>
</div> </div>
<div style="text-align:center;">
<a href="/books/add">Add Book</a>
<a href="/author/add">Add Author</a>
</div>
{% endblock content%} {% endblock content%}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment