Allow import retry
This commit is contained in:
@ -29,16 +29,47 @@
|
||||
{% if failed_items %}
|
||||
<div class="block">
|
||||
<h2 class="title is-4">Failed to load</h2>
|
||||
<ul>
|
||||
{% for item in failed_items %}
|
||||
<li>
|
||||
Line {{ item.index }}:
|
||||
<strong>{{ item.data|dict_key:'Title' }}</strong> by
|
||||
{{ item.data|dict_key:'Author' }}
|
||||
({{ item.fail_reason }})
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if not job.retry %}
|
||||
<form name="retry" action="/retry-import/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="import_job" value="{{ job.id }}">
|
||||
<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 }}.
|
||||
<a href="/create-book/{{ item.id }}">Manually add book</a>
|
||||
</p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
</ul>
|
||||
<button class="button" type="submit">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 }}.
|
||||
<a href="/create-book/{{ item.id }}">Manually add book</a>
|
||||
</p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
Reference in New Issue
Block a user