2020-04-21 14:09:21 +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-06-07 16:13:24 +00:00
{% load static %}
2021-02-28 18:00:36 +00:00
{% block title %}{% trans "Import Status" %}{% endblock %}
2021-03-05 14:41:21 +00:00
{% block content %}{% spaceless %}
2021-11-12 21:10:52 +00:00
< header class = "block" >
2021-11-13 19:15:58 +00:00
< h1 class = "title" >
{% block page_title %}
{% if job.retry %}
{% trans "Retry Status" %}
{% else %}
{% trans "Import Status" %}
{% endif %}
{% endblock %}
< / h1 >
< nav class = "breadcrumb subtitle" aria-label = "breadcrumbs" >
< ul >
< li > < a href = "{% url 'import' %}" > {% trans "Imports" %}< / a > < / li >
{% url 'import-status' job.id as path %}
< li { % if request . path in path % } class = "is-active" { % endif % } >
< a href = "{{ path }}" { % if request . path in path % } aria-current = "page" { % endif % } >
{% if job.retry %}
{% trans "Retry Status" %}
{% else %}
{% trans "Import Status" %}
{% endif %}
< / a >
< / li >
{% block breadcrumbs %}{% endblock %}
< / ul >
< / nav >
2020-04-21 14:09:21 +00:00
2021-11-12 21:10:52 +00:00
< div class = "block" >
< dl >
< dt class = "is-pulled-left mr-5" > {% trans "Import started:" %}< / dt >
< dd > {{ job.created_date | naturaltime }}< / dd >
< / dl >
< / div >
2021-11-14 18:20:14 +00:00
{% if not job.complete %}
2021-11-12 21:10:52 +00:00
< div class = "box is-processing" >
< div class = "block" >
< span class = "icon icon-spinner is-pulled-left" aria-hidden = "true" > < / span >
< span > {% trans "In progress" %}< / span >
< span class = "is-pulled-right" >
2021-11-14 19:31:47 +00:00
< a href = "#" class = "button is-small" > {% trans "Refresh" %}< / a >
2021-11-12 21:10:52 +00:00
< / span >
< / div >
< div class = "is-flex" >
2021-11-15 17:41:05 +00:00
< progress
class="progress is-success is-medium mr-2"
role="progressbar"
aria-min="0"
value="{{ complete_count }}"
aria-valuenow="{{ complete_count }}"
max="{{ item_count }}"
aria-valuemax="{{ item_count }}">
{{ percent }} %
< / progress >
2021-11-12 21:10:52 +00:00
< span > {{ percent }}%< / span >
< / div >
< / div >
2021-11-11 21:00:34 +00:00
{% endif %}
2021-11-12 22:36:28 +00:00
2021-11-14 18:58:46 +00:00
{% if manual_review_count and not legacy %}
2021-11-12 23:34:48 +00:00
< div class = "notification" >
{% blocktrans trimmed count counter=manual_review_count with display_counter=manual_review_count|intcomma %}
2021-11-13 01:10:47 +00:00
{{ display_counter }} item needs manual approval.
2021-11-12 23:34:48 +00:00
{% plural %}
2021-11-13 01:10:47 +00:00
{{ display_counter }} items need manual approval.
2021-11-12 23:34:48 +00:00
{% endblocktrans %}
2021-11-13 01:10:47 +00:00
< a href = "{% url 'import-review' job.id %}" > {% trans "Review items" %}< / a >
2021-11-12 23:34:48 +00:00
< / div >
{% endif %}
2021-11-14 18:58:46 +00:00
{% if job.complete and fail_count and not job.retry and not legacy %}
2021-11-12 22:36:28 +00:00
< div class = "notification is-warning" >
{% blocktrans trimmed count counter=fail_count with display_counter=fail_count|intcomma %}
{{ display_counter }} item failed to import.
{% plural %}
{{ display_counter }} items failed to import.
{% endblocktrans %}
< a href = "{% url 'import-troubleshoot' job.id %}" >
2021-11-13 01:10:47 +00:00
{% trans "View and troubleshoot failed items" %}
2021-11-12 22:36:28 +00:00
< / a >
< / div >
{% endif %}
2021-11-12 21:10:52 +00:00
< / header >
2020-11-12 21:52:57 +00:00
< div class = "block" >
2021-11-12 22:36:28 +00:00
{% block actions %}{% endblock %}
2021-11-13 17:43:52 +00:00
< div class = "table-container" >
< table class = "table is-striped" >
< tr >
< th >
{% trans "Row" %}
< / th >
< th >
{% trans "Title" %}
< / th >
< th >
{% trans "ISBN" %}
< / th >
< th >
{% trans "Author" %}
< / th >
< th >
{% trans "Shelf" %}
< / th >
< th >
{% trans "Review" %}
< / th >
{% block import_cols_headers %}
< th >
{% trans "Book" %}
< / th >
< th >
{% trans "Status" %}
< / th >
{% endblock %}
< / tr >
2021-11-14 18:58:46 +00:00
{% if legacy %}
< tr >
< td colspan = "8" >
< p >
< em > {% trans "Import preview unavailable." %}< / em >
< / p >
< / td >
< / tr >
{% else %}
2021-11-13 17:43:52 +00:00
{% for item in items %}
< tr >
{% block index_col %}
< td >
{{ item.index }}
< / td >
{% endblock %}
< td >
{{ item.normalized_data.title }}
< / td >
< td >
2021-11-13 20:24:16 +00:00
{{ item.isbn|default:'' }}
2021-11-13 17:43:52 +00:00
< / td >
< td >
{{ item.normalized_data.authors }}
< / td >
< td >
{{ item.normalized_data.shelf }}
< / td >
< td >
2021-11-13 19:52:08 +00:00
{% if item.rating %}
2021-11-13 17:43:52 +00:00
< p > {% include 'snippets/stars.html' with rating=item.rating %}< / p >
2021-11-13 19:52:08 +00:00
{% endif %}
{% if item.review %}
2021-11-13 17:43:52 +00:00
< p > {{ item.review|truncatechars:100 }}< / p >
2021-11-13 19:52:08 +00:00
{% endif %}
{% if item.linked_review %}
< a href = "{{ item.linked_review.remote_id }}" target = "_blank" > {% trans "View imported review" %}< / a >
{% endif %}
2021-11-13 17:43:52 +00:00
< / td >
{% block import_cols %}
< td >
{% if item.book %}
< a href = "{{ item.book.local_path }}" >
{% include 'snippets/book_cover.html' with book=item.book cover_class='is-h-s' size='small' %}
< / a >
{% endif %}
< / td >
< td >
{% if item.book %}
< span class = "icon icon-check" aria-hidden = "true" > < / span >
< span class = "is-sr-only-mobile" > {% trans "Imported" %}< / span >
2021-11-12 21:10:52 +00:00
2021-11-13 17:43:52 +00:00
{% elif item.fail_reason %}
< span class = "icon icon-x has-text-danger" aria-hidden = "true" > < / span >
< span class = "is-sr-only-mobile" >
{% if item.book_guess %}
{% trans "Needs manual review" %}
{% else %}
{{ item.fail_reason }}
{% endif %}
< / span >
{% else %}
2021-11-14 18:20:14 +00:00
< div class = "is-flex" >
< span class = "icon icon-dots-three" aria-hidden = "true" > < / span >
< span class = "is-sr-only-mobile" > {% trans "Pending" %}< / span >
{# retry option if an item appears to be hanging #}
2021-11-14 18:58:46 +00:00
{% if job.created_date != job.updated_date and inactive_time > 24 %}
2021-11-14 18:20:14 +00:00
< form class = "ml-2" method = "POST" action = "{% url 'import-item-retry' job.id item.id %}" name = "retry-{{ item.id }}" >
{% csrf_token %}
< button class = "button is-danger is-outlined is-small" > {% trans "Retry" %}< / button >
< / form >
{% endif %}
< / div >
2021-11-13 17:43:52 +00:00
{% endif %}
< / td >
{% endblock %}
< / tr >
{% block action_row %}{% endblock %}
{% endfor %}
2021-11-14 18:58:46 +00:00
{% endif %}
2021-11-13 17:43:52 +00:00
< / table >
< / div >
2021-11-14 18:58:46 +00:00
{% if legacy %}
< div class = "content" >
< form name = "update-import" method = "POST" action = "{% url 'import-status' job.id %}" >
{% csrf_token %}
< p >
{% trans "This import is in an old format that is no longer supported. If you would like to troubleshoot missing items from this import, click the button below to update the import format." %}
< / p >
< button class = "button" > {% trans "Update import" %}< / button >
< / form >
< / div >
{% endif %}
2020-09-30 19:11:53 +00:00
< / div >
2021-11-12 21:10:52 +00:00
2021-11-14 18:58:46 +00:00
{% if not legacy %}
2021-11-12 21:10:52 +00:00
< div >
{% include 'snippets/pagination.html' with page=items %}
< / div >
2021-11-14 18:58:46 +00:00
{% endif %}
2021-03-05 14:41:21 +00:00
{% endspaceless %}{% endblock %}
2021-03-19 17:51:45 +00:00
{% block scripts %}
2021-09-10 17:57:16 +00:00
< script src = "{% static " js / check_all . js " % } ? v = {{ js_cache } } " > < / script >
2021-03-19 17:51:45 +00:00
{% endblock %}