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-12 22:38:41 +00:00
|
|
|
{% if job.retry %}
|
|
|
|
<h1 class="title">{% trans "Retry Status" %}</h1>
|
|
|
|
{% else %}
|
2021-02-27 22:22:39 +00:00
|
|
|
<h1 class="title">{% trans "Import Status" %}</h1>
|
2021-11-12 22:38:41 +00:00
|
|
|
{% endif %}
|
2021-06-14 18:59:44 +00:00
|
|
|
<a href="{% url 'import' %}" class="has-text-weight-normal help subtitle is-link">{% trans "Back to imports" %}</a>
|
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>
|
|
|
|
|
|
|
|
{% if not complete %}
|
|
|
|
<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">
|
|
|
|
<a href="" class="button is-small">{% trans "Refresh" %}</a>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="is-flex">
|
|
|
|
<progress class="progress is-success is-medium mr-2" value="{{ percent }}" max="100">{{ percent }}%</progress>
|
|
|
|
<span>{{ percent }}%</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-11 21:00:34 +00:00
|
|
|
{% endif %}
|
2021-11-12 22:36:28 +00:00
|
|
|
|
2021-11-12 23:34:48 +00:00
|
|
|
{% if manual_review_count %}
|
|
|
|
<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-12 22:38:41 +00:00
|
|
|
{% if complete and fail_count and not job.retry %}
|
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 21:10:52 +00:00
|
|
|
<h2 class="title is-4">
|
2021-11-12 22:36:28 +00:00
|
|
|
{% block page_title %}
|
2021-11-12 21:10:52 +00:00
|
|
|
{% trans "Your Import" %}
|
2021-11-12 22:36:28 +00:00
|
|
|
{% endblock %}
|
2021-11-12 21:10:52 +00:00
|
|
|
</h2>
|
2021-11-12 22:36:28 +00:00
|
|
|
{% block actions %}{% endblock %}
|
2020-09-30 19:11:53 +00:00
|
|
|
<table class="table">
|
|
|
|
<tr>
|
|
|
|
<th>
|
2021-11-12 21:10:52 +00:00
|
|
|
{% trans "Row" %}
|
2020-09-30 19:11:53 +00:00
|
|
|
</th>
|
|
|
|
<th>
|
2021-02-27 22:22:39 +00:00
|
|
|
{% trans "Title" %}
|
2020-09-30 19:11:53 +00:00
|
|
|
</th>
|
2021-11-12 22:54:20 +00:00
|
|
|
<th>
|
|
|
|
{% trans "ISBN" %}
|
|
|
|
</th>
|
2020-09-30 19:11:53 +00:00
|
|
|
<th>
|
2021-02-27 22:22:39 +00:00
|
|
|
{% trans "Author" %}
|
2020-09-30 19:11:53 +00:00
|
|
|
</th>
|
2021-11-13 17:34:10 +00:00
|
|
|
<th>
|
|
|
|
{% trans "Shelf" %}
|
|
|
|
</th>
|
2021-11-13 17:22:35 +00:00
|
|
|
<th>
|
|
|
|
{% trans "Review" %}
|
|
|
|
</th>
|
2021-11-13 17:34:10 +00:00
|
|
|
{% block import_cols_headers %}
|
2020-09-30 19:11:53 +00:00
|
|
|
<th>
|
2021-11-12 21:10:52 +00:00
|
|
|
{% trans "Book" %}
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
{% trans "Status" %}
|
2020-09-30 19:11:53 +00:00
|
|
|
</th>
|
2021-11-13 17:34:10 +00:00
|
|
|
{% endblock %}
|
2020-09-30 19:11:53 +00:00
|
|
|
</tr>
|
|
|
|
{% for item in items %}
|
|
|
|
<tr>
|
2021-11-13 17:34:10 +00:00
|
|
|
{% block index_col %}
|
2020-09-30 19:11:53 +00:00
|
|
|
<td>
|
2021-11-12 21:10:52 +00:00
|
|
|
{{ item.index }}
|
2020-09-30 19:11:53 +00:00
|
|
|
</td>
|
2021-11-13 17:34:10 +00:00
|
|
|
{% endblock %}
|
2020-09-30 19:11:53 +00:00
|
|
|
<td>
|
2021-11-12 22:54:20 +00:00
|
|
|
{{ item.normalized_data.title }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ item.isbn }}
|
2020-09-30 19:11:53 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2021-11-12 22:54:20 +00:00
|
|
|
{{ item.normalized_data.authors }}
|
2020-09-30 19:11:53 +00:00
|
|
|
</td>
|
2021-11-13 17:34:10 +00:00
|
|
|
<td>
|
|
|
|
{{ item.normalized_data.shelf }}
|
|
|
|
</td>
|
2021-11-13 17:22:35 +00:00
|
|
|
<td>
|
|
|
|
<p>{% include 'snippets/stars.html' with rating=item.rating %}</p>
|
|
|
|
<p>{{ item.review|truncatechars:100 }}</p>
|
|
|
|
</td>
|
2021-11-13 17:34:10 +00:00
|
|
|
{% block import_cols %}
|
2020-09-30 19:11:53 +00:00
|
|
|
<td>
|
2020-11-12 21:52:57 +00:00
|
|
|
{% if item.book %}
|
2021-11-12 21:10:52 +00:00
|
|
|
<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 has-text-success" aria-hidden="true"></span>
|
|
|
|
<span class="is-sr-only-mobile">{% trans "Imported" %}</span>
|
|
|
|
|
|
|
|
{% elif item.fail_reason %}
|
|
|
|
<span class="icon icon-x has-text-danger" aria-hidden="true"></span>
|
|
|
|
<span class="is-sr-only-mobile">
|
|
|
|
{{ item.fail_reason }}
|
2020-11-12 21:52:57 +00:00
|
|
|
</span>
|
2021-11-12 21:10:52 +00:00
|
|
|
{% else %}
|
|
|
|
<span class="icon icon-dots-three" aria-hidden="true"></span>
|
|
|
|
<span class="is-sr-only-mobile">{% trans "Pending" %}</span>
|
2020-09-30 19:11:53 +00:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
2021-11-13 17:34:10 +00:00
|
|
|
{% endblock %}
|
2020-09-30 19:11:53 +00:00
|
|
|
</tr>
|
2021-11-13 17:34:10 +00:00
|
|
|
{% block action_row %}{% endblock %}
|
2020-09-30 19:11:53 +00:00
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
</div>
|
2021-11-12 21:10:52 +00:00
|
|
|
|
|
|
|
<div>
|
|
|
|
{% include 'snippets/pagination.html' with page=items %}
|
|
|
|
</div>
|
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 %}
|