2020-03-23 16:40:09 +00:00
{% extends 'layout.html' %}
2021-02-28 02:48:10 +00:00
{% load i18n %}
2020-04-21 14:09:21 +00:00
{% load humanize %}
2021-02-28 18:00:36 +00:00
{% block title %}{% trans "Import Books" %}{% endblock %}
2020-03-23 16:40:09 +00:00
{% block content %}
2020-09-30 04:45:59 +00:00
< div class = "block" >
2021-02-27 22:22:39 +00:00
< h1 class = "title" > {% trans "Import Books" %}< / h1 >
2021-03-30 16:30:25 +00:00
< form class = "box" name = "import" action = "/import" method = "post" enctype = "multipart/form-data" >
2020-03-23 16:40:09 +00:00
{% csrf_token %}
2021-02-20 16:02:36 +00:00
2021-03-30 16:30:25 +00:00
< div class = "columns" >
< div class = "column is-half" >
2021-09-08 15:19:54 +00:00
< div class = "field" >
2022-03-21 19:24:47 +00:00
< label class = "label" for = "source" >
2021-09-08 15:19:54 +00:00
{% trans "Data source:" %}
< / label >
2022-03-21 19:24:47 +00:00
< div class = "select" >
< select name = "source" id = "source" aria-describedby = "desc_source" >
< option value = "Goodreads" { % if current = = ' Goodreads ' % } selected { % endif % } >
Goodreads (CSV)
< / option >
< option value = "Storygraph" { % if current = = ' Storygraph ' % } selected { % endif % } >
Storygraph (CSV)
< / option >
< option value = "LibraryThing" { % if current = = ' LibraryThing ' % } selected { % endif % } >
LibraryThing (TSV)
< / option >
< option value = "OpenLibrary" { % if current = = ' OpenLibrary ' % } selected { % endif % } >
OpenLibrary (CSV)
< / option >
< / select >
< / div >
< p class = "help" id = "desc_source" >
{% trans 'You can download your Goodreads data from the < a href = "https://www.goodreads.com/review/import" target = "_blank" rel = "noopener noreferrer" > Import/Export page< / a > of your Goodreads account.' %}
< / p >
2021-03-30 16:30:25 +00:00
< / div >
2022-03-21 19:24:47 +00:00
2021-03-30 16:30:25 +00:00
< div class = "field" >
2021-04-12 21:23:51 +00:00
< label class = "label" for = "id_csv_file" > {% trans "Data file:" %}< / label >
2021-03-30 16:30:25 +00:00
{{ import_form.csv_file }}
< / div >
2021-02-20 16:02:36 +00:00
< / div >
2021-03-30 16:30:25 +00:00
< div class = "column is-half" >
< div class = "field" >
< label class = "label" >
< input type = "checkbox" name = "include_reviews" checked > {% trans "Include reviews" %}
< / label >
< / div >
< div class = "field" >
2021-11-11 20:53:48 +00:00
< label class = "label" for = "privacy_import" >
{% trans "Privacy setting for imported reviews:" %}
2021-03-30 16:30:25 +00:00
< / label >
2021-11-11 20:53:48 +00:00
{% include 'snippets/privacy_select.html' with no_label=True privacy_uuid="import" %}
2021-03-30 16:30:25 +00:00
< / div >
2020-10-30 18:21:02 +00:00
< / div >
< / div >
2021-02-27 22:22:39 +00:00
< button class = "button is-primary" type = "submit" > {% trans "Import" %}< / button >
2020-03-23 16:40:09 +00:00
< / form >
2020-09-30 04:45:59 +00:00
< / div >
2020-04-21 14:09:21 +00:00
2020-09-30 04:45:59 +00:00
< div class = "content block" >
2021-02-27 22:22:39 +00:00
< h2 class = "title" > {% trans "Recent Imports" %}< / h2 >
2020-09-30 04:45:59 +00:00
{% if not jobs %}
2022-03-21 19:26:07 +00:00
< p > < em > {% trans "No recent imports" %}< / em > < / p >
2020-09-30 04:45:59 +00:00
{% endif %}
2020-04-21 14:09:21 +00:00
< ul >
{% for job in jobs %}
2021-05-04 16:34:16 +00:00
< li > < a href = "{% url 'import-status' job.id %}" > {{ job.created_date | naturaltime }}< / a > < / li >
2020-04-21 14:09:21 +00:00
{% endfor %}
< / ul >
2020-03-23 16:40:09 +00:00
< / div >
{% endblock %}