2020-12-21 22:30:38 +00:00
|
|
|
{% extends "generic_template.html" %}
|
|
|
|
|
|
|
|
{% block content %}
|
2021-01-13 22:52:23 +00:00
|
|
|
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
2021-02-23 21:25:40 +00:00
|
|
|
<h1 class="title">{{bookshelf}}</h1>
|
|
|
|
<h2 class="subheading">Bookshelf</h2>
|
2020-12-21 22:30:38 +00:00
|
|
|
|
2021-02-23 21:25:40 +00:00
|
|
|
<strong class="heading-info">Number of Books in Bookshelf:</strong> <p>{{ total }}</p>
|
2020-12-21 22:30:38 +00:00
|
|
|
|
2021-03-05 18:23:36 +00:00
|
|
|
{% if user.is_authenticated %}
|
|
|
|
<form class="add-form" action="/bookshelves/{{bookshelfId}}" method="post">
|
2021-01-13 22:52:23 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
{{ form }}
|
|
|
|
<input type="submit" value="Add Book">
|
|
|
|
</form>
|
2021-02-23 21:25:40 +00:00
|
|
|
<p class="form-help">Or search for a book to add <a href="/bookshelves/{{bookshelfId}}/search">here</a></p>
|
2021-03-05 18:23:36 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2021-01-13 22:52:23 +00:00
|
|
|
|
2021-02-23 21:25:40 +00:00
|
|
|
<h1 class="secondary-heading">Book List</h1>
|
2020-12-21 22:30:38 +00:00
|
|
|
{% if books %}
|
|
|
|
<ul>
|
|
|
|
{% for book in books %}
|
2021-02-23 21:25:40 +00:00
|
|
|
<li class="bookshelf" id="book-{{ book.id }}">
|
2020-12-21 22:30:38 +00:00
|
|
|
<a href="https://www.gutenberg.org/ebooks/{{ book.id }}">{{ book.title }}</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% else %}
|
|
|
|
<p>There are no books in the bookshelf.</p>
|
|
|
|
{% endif %}
|
2021-01-13 22:52:23 +00:00
|
|
|
{% load static %}
|
|
|
|
<script src="{% static 'booklist.js' %}"></script>
|
|
|
|
<link rel="stylesheet" href="{% static 'style.css' %}"></script>
|
2020-12-21 22:30:38 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|