1
0
Fork 0

Mark imports as complete

This will let the user debug the import, and should only be used when
the import is in a bad state (marked as incomplete but with no pending
tasks)
This commit is contained in:
Mouse Reeve 2022-11-01 19:26:23 -07:00
parent 6eab1fdd6d
commit a8424f61f2
5 changed files with 54 additions and 2 deletions

View file

@ -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 %}
<form name="complete-import-{{ import.id }}" action="{% url 'settings-imports-complete' import.id %}" method="POST" class="is-flex-grow-1">
{% csrf_token %}
<input type="hidden" name="id" value="{{ list.id }}">
<div class="buttons is-right is-flex-grow-1">
<button type="button" class="button" data-modal-close>
{% trans "Cancel" %}
</button>
<button class="button is-danger" type="submit">
{% trans "Confirm" %}
</button>
</div>
</form>
{% endblock %}

View file

@ -26,9 +26,11 @@
</div>
<div class="table-container block content">
{% if status == "active" %}
<div class="notification is-warning">
<p>{% trans "Marking an import as complete will <em>not</em> stop it." %}</p>
</div>
{% endif %}
<table class="table is-striped is-fullwidth">
<tr>
{% url 'settings-imports' as url %}
@ -47,7 +49,9 @@
<th>
{% trans "Pending items" %}
</th>
{% if status == "active" %}
<th>{% trans "Actions" %}</th>
{% endif %}
</tr>
{% for import in imports %}
<tr>
@ -58,11 +62,22 @@
<td>{{ import.created_date }}</td>
<td>{{ import.item_count }}</td>
<td>{{ import.pending_item_count }}</td>
{% if status == "active" %}
<td>
<button class="button is-danger">{% trans "Mark as complete" %}</button>
{% join "complete" import.id as modal_id %}
<button type="button" data-modal-open="{{ modal_id }}" class="button is-danger">{% trans "Mark as complete" %}</button>
{% include "settings/imports/complete_import_modal.html" with id=modal_id %}
</td>
{% endif %}
</tr>
{% endfor %}
{% if not imports %}
<tr>
<td colspan="6">
<em>{% trans "No matching imports founds." %} </em>
</td>
</tr>
{% endif %}
</table>
</div>