Improves import table ui

adds table container, plays with display a bit
This commit is contained in:
Mouse Reeve 2021-11-13 09:43:52 -08:00
parent 60fb1ac2e6
commit 659d0f19eb
2 changed files with 103 additions and 102 deletions

View File

@ -69,7 +69,8 @@
{% endblock %} {% endblock %}
</h2> </h2>
{% block actions %}{% endblock %} {% block actions %}{% endblock %}
<table class="table"> <div class="table-container">
<table class="table is-striped">
<tr> <tr>
<th> <th>
{% trans "Row" %} {% trans "Row" %}
@ -131,13 +132,17 @@
</td> </td>
<td> <td>
{% if item.book %} {% if item.book %}
<span class="icon icon-check has-text-success" aria-hidden="true"></span> <span class="icon icon-check" aria-hidden="true"></span>
<span class="is-sr-only-mobile">{% trans "Imported" %}</span> <span class="is-sr-only-mobile">{% trans "Imported" %}</span>
{% elif item.fail_reason %} {% elif item.fail_reason %}
<span class="icon icon-x has-text-danger" aria-hidden="true"></span> <span class="icon icon-x has-text-danger" aria-hidden="true"></span>
<span class="is-sr-only-mobile"> <span class="is-sr-only-mobile">
{% if item.book_guess %}
{% trans "Needs manual review" %}
{% else %}
{{ item.fail_reason }} {{ item.fail_reason }}
{% endif %}
</span> </span>
{% else %} {% else %}
<span class="icon icon-dots-three" aria-hidden="true"></span> <span class="icon icon-dots-three" aria-hidden="true"></span>
@ -149,6 +154,7 @@
{% block action_row %}{% endblock %} {% block action_row %}{% endblock %}
{% endfor %} {% endfor %}
</table> </table>
</div>
</div> </div>
<div> <div>

View File

@ -19,9 +19,6 @@
{% endblock %} {% endblock %}
{% block import_cols_headers %} {% block import_cols_headers %}
<th>
{% trans "Actions" %}
</th>
{% endblock %} {% endblock %}
{% block index_col %} {% block index_col %}
@ -31,30 +28,11 @@
{% endblock %} {% endblock %}
{% block import_cols %} {% block import_cols %}
<td>
<div class="content is-flex">
<form class="pr-2" name="approve-{{ item.id }}" method="POST" action="{% url 'import-approve' job.id item.id %}">
{% csrf_token %}
<button type="submit" class="button is-success">
<span class="icon icon-check" aria-hidden="true"></span>
<span class="is-sr-only-mobile">{% trans "Approve" %}</span>
</button>
</form>
<form name="delete-{{ item.id }}" method="POST" action="{% url 'import-delete' job.id item.id %}">
{% csrf_token %}
<button type="submit" class="button is-danger is-light is-outlined">
<span class="icon icon-x" aria-hidden="true"></span>
<span class="is-sr-only-mobile">{% trans "Delete" %}</span>
</button>
</form>
</div>
</td>
{% endblock %} {% endblock %}
{% block action_row %} {% block action_row %}
<tr> <tr>
<td colspan="6"> <td colspan="5">
<div class="columns is-mobile"> <div class="columns is-mobile">
{% with guess=item.book_guess %} {% with guess=item.book_guess %}
<div class="column is-narrow"> <div class="column is-narrow">
@ -64,6 +42,23 @@
</div> </div>
<div class="column"> <div class="column">
{% include 'snippets/book_titleby.html' with book=guess %} {% include 'snippets/book_titleby.html' with book=guess %}
<div class="content is-flex">
<form class="pr-2" name="approve-{{ item.id }}" method="POST" action="{% url 'import-approve' job.id item.id %}">
{% csrf_token %}
<button type="submit" class="button is-success">
<span class="icon icon-check m-0-mobile" aria-hidden="true"></span>
<span class="is-sr-only-mobile">{% trans "Approve" %}</span>
</button>
</form>
<form name="delete-{{ item.id }}" method="POST" action="{% url 'import-delete' job.id item.id %}">
{% csrf_token %}
<button type="submit" class="button is-danger is-light is-outlined">
<span class="icon icon-x m-0-mobile" aria-hidden="true"></span>
<span class="is-sr-only-mobile">{% trans "Delete" %}</span>
</button>
</form>
</div>
</div> </div>
{% endwith %} {% endwith %}
</div> </div>