Commit a0de761a authored by Jan Ericsson Ong Ang's avatar Jan Ericsson Ong Ang

Editetd 4 new htmls

parent ec6eaa00
...@@ -7,15 +7,15 @@ ...@@ -7,15 +7,15 @@
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
<label>First Name: </label> <label>First Name: </label>
<input id="first_name" type="text" name="first_name" max length="50" required/> <input id="first_name" type="text" name="first_name" max length="50"/>
<label>Last Name: </label> <label>Last Name: </label>
<input id="last_name" type="text" name="last_name" max length="100" required/> <input id="last_name" type="text" name="last_name" max length="100"/>
<label>Age: </label> <label>Age: </label>
<input id="age" type="number" name="age" required/> <input id="age" type="number" name="age"/>
<label>Nationality: </label> <label>Nationality: </label>
<input id="nationality" type="text" name="nationality" required/> <input id="nationality" type="text" name="nationality"/>
<label>Bio: </label> <label>Bio: </label>
<input id="bio" type="text" name="bio" required/> <input id="bio" type="text" name="bio"/>
</form> </form>
<button type="button"> <button type="button">
......
...@@ -7,21 +7,21 @@ ...@@ -7,21 +7,21 @@
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
<label>Title: </label> <label>Title: </label>
<input id="title" type="text" name="title" max length="50" required/> <input id="title" type="text" name="title" max length="50"/>
<label>Author: </label> <label>Author: </label>
<input id="author" type="text" name="author" max length="100" required/> <input id="author" type="text" name="author" max length="100"/>
<label>Publisher: </label> <label>Publisher: </label>
<input id="publisher" type="text" name="publisher" required/> <input id="publisher" type="text" name="publisher"/>
<label>Year Published: </label> <label>Year Published: </label>
<input id="year_published" type="number" name="year_published" required/> <input id="year_published" type="number" name="year_published"/>
<label>ISBN: </label> <label>ISBN: </label>
<input id="ISBN" type="number" name="ISBN" required/> <input id="ISBN" type="number" name="ISBN"/>
<label>Blurb: </label> <label>Blurb: </label>
<input id="blurb" type="text" name="blurb" required/> <input id="blurb" type="text" name="blurb"/>
</form> </form>
<button type="button"> <button type="button">
<a href="/bookshelf/books/{{ book.id }}/details/"> <a href="/bookshelf/books/{{ books.id }}/details/">
Add Book Add Book
</a> </a>
</button><br> </button><br>
......
...@@ -4,17 +4,18 @@ ...@@ -4,17 +4,18 @@
{% block title %}Edit Author{% endblock %} {% block title %}Edit Author{% endblock %}
{% block content %} {% block content %}
<form> <form method="post">
{% csrf_token %}
<label>First Name: </label> <label>First Name: </label>
<input id="first_name" type="text" name="first_name" max length="50" required/> <input id="first_name" type="text" name="first_name" max length="50"/>
<label>Last Name: </label> <label>Last Name: </label>
<input id="last_name" type="text" name="last_name" max length="100" required/> <input id="last_name" type="text" name="last_name" max length="100"/>
<label>Age: </label> <label>Age: </label>
<input id="age" type="number" name="age" required/> <input id="age" type="number" name="age"/>
<label>Nationality: </label> <label>Nationality: </label>
<input id="nationality" type="text" name="nationality" required/> <input id="nationality" type="text" name="nationality"/>
<label>Bio: </label> <label>Bio: </label>
<input id="bio" type="text" name="bio" required/> <input id="bio" type="text" name="bio"/>
</form> </form>
<button type="button"> <button type="button">
......
...@@ -4,19 +4,20 @@ ...@@ -4,19 +4,20 @@
{% block title %}Edit Book{% endblock %} {% block title %}Edit Book{% endblock %}
{% block content %} {% block content %}
<form> <form method="post">
{% csrf_token %}
<label>Title: </label> <label>Title: </label>
<input id="title" type="text" name="title" max length="50" required/> <input id="title" type="text" name="title" max length="50"/>
<label>Author: </label> <label>Author: </label>
<input id="author" type="text" name="author" max length="100" required/> <input id="author" type="text" name="author" max length="100"/>
<label>Publisher: </label> <label>Publisher: </label>
<input id="publisher" type="text" name="publisher" required/> <input id="publisher" type="text" name="publisher"/>
<label>Year Published: </label> <label>Year Published: </label>
<input id="year_published" type="number" name="year_published" required/> <input id="year_published" type="number" name="year_published"/>
<label>ISBN: </label> <label>ISBN: </label>
<input id="ISBN" type="number" name="ISBN" required/> <input id="ISBN" type="number" name="ISBN"/>
<label>Blurb: </label> <label>Blurb: </label>
<input id="blurb" type="text" name="blurb" required/> <input id="blurb" type="text" name="blurb"/>
</form> </form>
<button type="button"> <button type="button">
......
...@@ -27,7 +27,7 @@ class AuthorView(ListView): ...@@ -27,7 +27,7 @@ class AuthorView(ListView):
if form.is_valid(): if form.is_valid():
return self.get(request, *args, **kwargs) return self.get(request, *args, **kwargs)
else: else:
return render(request, self.template_name, {'form': form}) return render(request, 'bookshelf/author_details.html', {'form': form})
class AuthorDetailView(DetailView): class AuthorDetailView(DetailView):
...@@ -52,7 +52,7 @@ class BooksView(ListView): ...@@ -52,7 +52,7 @@ class BooksView(ListView):
if form.is_valid(): if form.is_valid():
return self.get(request, *args, **kwargs) return self.get(request, *args, **kwargs)
else: else:
return render(request, self.template_name, {'form': form}) return render(request, 'bookshelf/book_details.html', {'form': form})
class BookDetailView(DetailView): class BookDetailView(DetailView):
pk_url_kwarg = 'id' pk_url_kwarg = 'id'
......
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