moviewyrm/bookwyrm/templates/import_status.html

123 lines
3.5 KiB
HTML

{% extends 'layout.html' %}
{% load bookwyrm_tags %}
{% load humanize %}
{% block content %}
<div class="block">
<h1 class="title">{% trans "Import Status" %}</h1>
<p>
{% trans "Import started: " %}{{ job.created_date | naturaltime }}
</p>
{% if job.complete %}
<p>
{% trans "Import completed: " %}{{ task.date_done | naturaltime }}
</p>
{% elif task.failed %}
<div class="notification is-danger">{% trans "TASK FAILED" %}</div>
{% endif %}
</div>
<div class="block">
{% if not job.complete %}
{% trans "Import still in progress." %}
<p>
{% trans "(Hit reload to update!)" %}
</p>
{% endif %}
</div>
{% if failed_items %}
<div class="block">
<h2 class="title is-4">{% trans "Failed to load" %}</h2>
{% if not job.retry %}
<form name="retry" action="/import/{{ job.id }}" method="post">
{% csrf_token %}
<ul>
<fieldset>
{% for item in failed_items %}
<li class="pb-1">
<input class="checkbox" type="checkbox" name="import_item" value="{{ item.id }}" id="import-item-{{ item.id }}">
<label for="import-item-{{ item.id }}">
Line {{ item.index }}:
<strong>{{ item.data|dict_key:'Title' }}</strong> by
{{ item.data|dict_key:'Author' }}
</label>
<p>
{{ item.fail_reason }}.
</p>
</li>
{% endfor %}
</fieldset>
</ul>
<div class="block pt-1 select-all">
<label class="label">
<input type="checkbox" class="checkbox">
{% trans "Select all" %}
</label>
</div>
<button class="button" type="submit">{% trans "Retry items" %}</button>
{% else %}
<ul>
{% for item in failed_items %}
<li class="pb-1">
<p>
Line {{ item.index }}:
<strong>{{ item.data|dict_key:'Title' }}</strong> by
{{ item.data|dict_key:'Author' }}
</p>
<p>
{{ item.fail_reason }}.
</p>
</li>
{% endfor %}
</ul>
{% endif %}
</form>
</div>
{% endif %}
<div class="block">
<h2 class="title is-4">{% trans "Successfully imported" %}</h2>
<table class="table">
<tr>
<th>
{% trans "Book" %}
</th>
<th>
{% trans "Title" %}
</th>
<th>
{% trans "Author" %}
</th>
<th>
</th>
</tr>
{% for item in items %}
<tr>
<td>
{% if item.book %}
<a href="/book/{{ item.book.id }}">
{% include 'snippets/book_cover.html' with book=item.book size='small' %}
</a>
{% endif %}
</td>
<td>
{{ item.data|dict_key:'Title' }}
</td>
<td>
{{ item.data|dict_key:'Author' }}
</td>
<td>
{% if item.book %}
<span class="icon icon-check">
<span class="is-sr-only">{% trans "Imported" %}</span>
</span>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}