diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 556f133f9..18aad6d88 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -48,6 +48,16 @@ class ImportJob(models.Model): """items that haven't been processed yet""" return self.items.filter(fail_reason__isnull=True, book__isnull=True) + @property + def item_count(self): + """How many books do you want to import???""" + return self.items.count() + + @property + def pending_item_count(self): + """And how many pending items??""" + return self.pending_items.count() + class ImportItem(models.Model): """a single line of a csv being imported""" diff --git a/bookwyrm/templates/settings/imports/complete_import_modal.html b/bookwyrm/templates/settings/imports/complete_import_modal.html new file mode 100644 index 000000000..64d571764 --- /dev/null +++ b/bookwyrm/templates/settings/imports/complete_import_modal.html @@ -0,0 +1,23 @@ +{% extends 'components/modal.html' %} +{% load i18n %} + +{% block modal-title %}{% trans "Mark import as complete?" %}{% endblock %} + +{% block modal-body %} +{% trans "This action cannot be un-done" %} +{% endblock %} + +{% block modal-footer %} +
+{% endblock %} diff --git a/bookwyrm/templates/settings/imports/imports.html b/bookwyrm/templates/settings/imports/imports.html new file mode 100644 index 000000000..f99e35209 --- /dev/null +++ b/bookwyrm/templates/settings/imports/imports.html @@ -0,0 +1,86 @@ +{% extends 'settings/layout.html' %} +{% load i18n %} +{% load utilities %} + +{% block title %}{% trans "Imports" %}{% endblock %} + +{% block header %} +{% trans "Imports" %} +{% endblock %} + +{% block panel %} + +{% trans "Marking an import as complete will not stop it." %}
++ {% trans "ID" %} + | ++ {% trans "User" %} + | ++ {% trans "Date Created" %} + | ++ {% trans "Items" %} + | ++ {% trans "Pending items" %} + | + {% if status == "active" %} +{% trans "Actions" %} | + {% endif %} +
---|---|---|---|---|---|
{{ import.id }} | ++ {{ import.user|username }} + | +{{ import.created_date }} | +{{ import.item_count }} | +{{ import.pending_item_count }} | + {% if status == "active" %} ++ {% join "complete" import.id as modal_id %} + + {% include "settings/imports/complete_import_modal.html" with id=modal_id %} + | + {% endif %} +
+ {% trans "No matching imports founds." %} + | +