-
Notifications
You must be signed in to change notification settings - Fork 944
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand tutorial to allow create/delete/update through UI
- Loading branch information
1 parent
0304530
commit b5606da
Showing
18 changed files
with
449 additions
and
44 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
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
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
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
14 changes: 14 additions & 0 deletions
14
catalog/templates/catalog/bookinstance_confirm_delete.html
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,14 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
|
||
<h1>Delete Book Copy: {{ bookinstance }}</h1> | ||
|
||
<p>Are you sure you want to delete this copy of the book?</p> | ||
|
||
<form action="" method="POST"> | ||
{% csrf_token %} | ||
<input type="submit" action="" value="Yes, delete."> | ||
</form> | ||
|
||
{% endblock %} |
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,32 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
|
||
<h1>BookInstance: {{ bookinstance.book.title }}</h1> | ||
|
||
<p><strong>Author:</strong> <a href="{{ bookinstance.book.author.get_absolute_url }}">{{ bookinstance.book.author }}</a></p> | ||
|
||
<p><strong>Imprint:</strong> {{ bookinstance.imprint }}</p> | ||
<p><strong>Status:</strong> {{ bookinstance.get_status_display }} {% if bookinstance.status != 'a' %} (Due: {{bookinstance.due_back}}){% endif %}</p> | ||
|
||
<hr> | ||
<ul> | ||
<li> | ||
<a href="{{ bookinstance.book.get_absolute_url }}">All copies</a></p> | ||
</li> | ||
</ul> | ||
{% endblock %} | ||
|
||
|
||
{% block sidebar %} | ||
{{ block.super }} | ||
|
||
{% if perms.catalog.can_mark_returned %} | ||
<hr> | ||
<ul class="sidebar-nav"> | ||
<li><a href="{% url 'bookinstance-update' bookinstance.id %}">Update BookInstance</a></li> | ||
<li><a href="{% url 'bookinstance-delete' bookinstance.id %}">Delete BookInstance</a></li> | ||
</ul> | ||
{% endif %} | ||
|
||
{% endblock %} |
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,13 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
|
||
<form action="" method="post"> | ||
{% csrf_token %} | ||
<table> | ||
{{ form.as_table }} | ||
</table> | ||
<input type="submit" value="Submit"> | ||
|
||
</form> | ||
{% endblock %} |
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,16 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
<h1>Book Copies in Library</h1> | ||
|
||
<ul> | ||
{% for bookinst in bookinstance_list %} | ||
<li class="{% if bookinst.is_overdue %}text-danger{% endif %}"> | ||
<a href="{% url 'bookinstance-detail' bookinst.pk %}">{{bookinst.book.title}}</a> ({{ bookinst.due_back }}) {% if user.is_staff %}- {{ bookinst.borrower }}{% endif %} {% if perms.catalog.can_mark_returned %}- <a href="{% url 'renew-book-librarian' bookinst.id %}">Renew</a> {% endif %} | ||
</li> | ||
{% empty %} | ||
<li>There are no book copies available.</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
{% endblock %} |
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,14 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
|
||
<h1>Delete Genre: {{ genre }}</h1> | ||
|
||
<p>Are you sure you want to delete the genre?</p> | ||
|
||
<form action="" method="POST"> | ||
{% csrf_token %} | ||
<input type="submit" action="" value="Yes, delete."> | ||
</form> | ||
|
||
{% endblock %} |
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,41 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
|
||
<h1>Genre: {{ genre.name }}</h1> | ||
|
||
<div style="margin-left:20px;margin-top:20px"> | ||
<h4>Books in genre</h4> | ||
|
||
<ul> | ||
{% for copy in genre.book_set.all %} | ||
<li> | ||
<a href="{{ copy.get_absolute_url }}">{{ copy.title }}</a> ({{copy.author}}) | ||
</li> | ||
{% empty %} | ||
<li>There are no books in this genre.</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
{% endblock %} | ||
|
||
|
||
{% block sidebar %} | ||
{{ block.super }} | ||
|
||
{% if perms.catalog.can_mark_returned %} | ||
<hr> | ||
<ul class="sidebar-nav"> | ||
<li><a href="{% url 'genre-update' genre.id %}">Update Genre</a></li> | ||
{% if not genre.book_set.all %} | ||
<li><a href="{% url 'genre-delete' genre.id %}">Delete Genre</a></li> | ||
{% endif %} | ||
</ul> | ||
{% endif %} | ||
|
||
{% endblock %} | ||
|
||
|
||
|
||
|
||
|
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,13 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
|
||
<form action="" method="post"> | ||
{% csrf_token %} | ||
<table> | ||
{{ form.as_table }} | ||
</table> | ||
<input type="submit" value="Submit"> | ||
|
||
</form> | ||
{% endblock %} |
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,25 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
|
||
<h1>Genre List</h1> | ||
|
||
{% if genre_list %} | ||
<ul> | ||
|
||
{% for genre in genre_list %} | ||
<li> | ||
<a href="{{ genre.get_absolute_url }}"> | ||
{{ genre }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
|
||
</ul> | ||
{% else %} | ||
<p>There are no genres available.</p> | ||
{% endif %} | ||
|
||
|
||
{% endblock %} | ||
|
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,14 @@ | ||
{% extends "base_generic.html" %} | ||
|
||
{% block content %} | ||
|
||
<h1>Delete Language: {{ language }}</h1> | ||
|
||
<p>Are you sure you want to delete the language?</p> | ||
|
||
<form action="" method="POST"> | ||
{% csrf_token %} | ||
<input type="submit" action="" value="Yes, delete."> | ||
</form> | ||
|
||
{% endblock %} |
Oops, something went wrong.