Merge pull request #96 from cthulahoops/goodreads_import

Goodreads import
This commit is contained in:
Mouse Reeve
2020-03-27 09:10:00 -07:00
committed by GitHub
13 changed files with 181 additions and 4 deletions

View File

@ -0,0 +1,10 @@
{% extends 'layout.html' %}
{% block content %}
<div id="content">
<form name="import" action="/import_data/" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ import_form.as_p }}
<button type="submit">Import</button>
</form>
</div>
{% endblock %}

View File

@ -0,0 +1,18 @@
{% extends 'layout.html' %}
{% block content %}
<div id="content">
<div>
<h1>The following books could not be imported: </h1>
<ul>
{% for item in failures %}
<li>
{{ item }}
</li>
{% endfor %}
</ul>
<p>{{ success_count }} books imported successfully</p>
</div>
</div>
{% endblock %}

View File

@ -31,6 +31,7 @@
{% endif %}
<li><a href="/#feed">Updates</a></li>
<li><a href="/books">Discover Books</a></li>
<li><a href="/import">Import Books</a><li>
</ul>
<div id="actions">

View File

@ -21,13 +21,15 @@
</h2>
{% if not hide_book and status.mention_books.count %}
{% for book in status.mention_books.all|slice:"0:3" %}
<div class="book-preview">
{% if status.status_type == 'Review' %}
{% include 'snippets/book.html' with book=status.mention_books.first %}
{% include 'snippets/book.html' with book=book %}
{% else %}
{% include 'snippets/book.html' with book=status.mention_books.first description=True %}
{% include 'snippets/book.html' with book=book description=True %}
{% endif %}
</div>
{% endfor %}
{% endif %}
{% if not hide_book and status.book%}
<div class="book-preview">