2022-11-02 01:59:04 +00:00
|
|
|
{% extends 'settings/layout.html' %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% load utilities %}
|
2022-11-03 18:30:43 +00:00
|
|
|
{% load humanize %}
|
2022-11-02 01:59:04 +00:00
|
|
|
|
|
|
|
{% block title %}{% trans "Imports" %}{% endblock %}
|
|
|
|
|
|
|
|
{% block header %}
|
|
|
|
{% trans "Imports" %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block panel %}
|
|
|
|
|
|
|
|
<div class="block">
|
|
|
|
<div class="tabs">
|
|
|
|
<ul>
|
|
|
|
{% url 'settings-imports' as url %}
|
|
|
|
<li {% if request.path in url %}class="is-active" aria-current="page"{% endif %}>
|
|
|
|
<a href="{{ url }}">{% trans "Active" %}</a>
|
|
|
|
</li>
|
|
|
|
{% url 'settings-imports' status="complete" as url %}
|
|
|
|
<li {% if url in request.path %}class="is-active" aria-current="page"{% endif %}>
|
|
|
|
<a href="{{ url }}">{% trans "Completed" %}</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="table-container block content">
|
|
|
|
<table class="table is-striped is-fullwidth">
|
|
|
|
<tr>
|
2022-11-07 19:32:45 +00:00
|
|
|
{% url 'settings-imports' status as url %}
|
2022-11-02 01:59:04 +00:00
|
|
|
<th>
|
|
|
|
{% trans "ID" %}
|
|
|
|
</th>
|
|
|
|
<th>
|
2022-11-07 19:32:45 +00:00
|
|
|
{% trans "User" as text %}
|
|
|
|
{% include 'snippets/table-sort-header.html' with field="user" sort=sort text=text %}
|
2022-11-02 01:59:04 +00:00
|
|
|
</th>
|
|
|
|
<th>
|
2022-11-07 19:32:45 +00:00
|
|
|
{% trans "Date Created" as text %}
|
|
|
|
{% include 'snippets/table-sort-header.html' with field="created_date" sort=sort text=text %}
|
2022-11-02 01:59:04 +00:00
|
|
|
</th>
|
2022-11-03 17:54:59 +00:00
|
|
|
{% if status != "active" %}
|
|
|
|
<th>
|
|
|
|
{% trans "Date Updated" %}
|
|
|
|
</th>
|
|
|
|
{% endif %}
|
2022-11-02 01:59:04 +00:00
|
|
|
<th>
|
|
|
|
{% trans "Items" %}
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
{% trans "Pending items" %}
|
|
|
|
</th>
|
2022-11-03 18:30:43 +00:00
|
|
|
<th>
|
|
|
|
{% trans "Successful items" %}
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
{% trans "Failed items" %}
|
|
|
|
</th>
|
2022-11-02 02:26:23 +00:00
|
|
|
{% if status == "active" %}
|
2022-11-02 01:59:04 +00:00
|
|
|
<th>{% trans "Actions" %}</th>
|
2022-11-02 02:26:23 +00:00
|
|
|
{% endif %}
|
2022-11-02 01:59:04 +00:00
|
|
|
</tr>
|
|
|
|
{% for import in imports %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ import.id }}</td>
|
|
|
|
<td class="overflow-wrap-anywhere">
|
2022-11-03 17:54:59 +00:00
|
|
|
<a href="{% url 'settings-user' import.user.id %}">{{ import.user|username }}</a>
|
2022-11-02 01:59:04 +00:00
|
|
|
</td>
|
|
|
|
<td>{{ import.created_date }}</td>
|
2022-11-03 17:54:59 +00:00
|
|
|
{% if status != "active" %}
|
|
|
|
<td>{{ import.updated_date }}</td>
|
|
|
|
{% endif %}
|
2022-11-03 18:30:43 +00:00
|
|
|
<td>{{ import.item_count|intcomma }}</td>
|
|
|
|
<td>{{ import.pending_item_count|intcomma }}</td>
|
|
|
|
<td>{{ import.successful_item_count|intcomma }}</td>
|
|
|
|
<td>{{ import.failed_item_count|intcomma }}</td>
|
2022-11-02 02:26:23 +00:00
|
|
|
{% if status == "active" %}
|
2022-11-02 01:59:04 +00:00
|
|
|
<td>
|
2022-11-02 02:26:23 +00:00
|
|
|
{% join "complete" import.id as modal_id %}
|
2022-11-05 22:44:00 +00:00
|
|
|
<button type="button" data-modal-open="{{ modal_id }}" class="button is-danger">{% trans "Stop import" %}</button>
|
2022-11-02 02:26:23 +00:00
|
|
|
{% include "settings/imports/complete_import_modal.html" with id=modal_id %}
|
2022-11-02 01:59:04 +00:00
|
|
|
</td>
|
2022-11-02 02:26:23 +00:00
|
|
|
{% endif %}
|
2022-11-02 01:59:04 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2022-11-02 02:26:23 +00:00
|
|
|
{% if not imports %}
|
|
|
|
<tr>
|
|
|
|
<td colspan="6">
|
2022-11-06 01:16:59 +00:00
|
|
|
<em>{% trans "No matching imports found." %} </em>
|
2022-11-02 02:26:23 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
2022-11-02 01:59:04 +00:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
2022-11-03 17:54:59 +00:00
|
|
|
{% include 'snippets/pagination.html' with page=imports path=request.path %}
|
2022-11-02 01:59:04 +00:00
|
|
|
{% endblock %}
|
|
|
|
|