mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 03:21:05 +00:00
Show import status in table
This commit is contained in:
parent
24e5ea3295
commit
59fe9e4d3b
3 changed files with 37 additions and 11 deletions
|
@ -25,7 +25,6 @@ class Migration(migrations.Migration):
|
|||
("complete", "Complete"),
|
||||
("stopped", "Stopped"),
|
||||
],
|
||||
default="pending",
|
||||
max_length=50,
|
||||
null=True,
|
||||
),
|
||||
|
|
18
bookwyrm/migrations/0161_alter_importjob_status.py
Normal file
18
bookwyrm/migrations/0161_alter_importjob_status.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.15 on 2022-11-05 20:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bookwyrm', '0160_auto_20221105_2030'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='importjob',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('pending', 'Pending'), ('active', 'Active'), ('complete', 'Complete'), ('stopped', 'Stopped')], default='pending', max_length=50, null=True),
|
||||
),
|
||||
]
|
|
@ -120,17 +120,26 @@
|
|||
<td>{{ job.updated_date }}</td>
|
||||
<td>{{ job.item_count|intcomma }}</td>
|
||||
<td>
|
||||
{% if job.complete %}
|
||||
<span class="tag is-success">
|
||||
{% trans "Completed" %}
|
||||
<span
|
||||
{% if job.status == "stopped" %}
|
||||
class="tag is-danger"
|
||||
{% elif job.status == "pending" %}
|
||||
class="tag is-warning"
|
||||
{% elif job.complete %}
|
||||
class="tag"
|
||||
{% else %}
|
||||
class="tag is-success"
|
||||
{% endif %}
|
||||
>
|
||||
{% if job.status %}
|
||||
{{ job.status }}
|
||||
{{ job.status_display }}
|
||||
{% elif job.complete %}
|
||||
{% trans "Complete" %}
|
||||
{% else %}
|
||||
{% trans "Active" %}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="tag is-warning">
|
||||
{% blocktrans trimmed with percent=job.percent_complete %}
|
||||
Active, {{ percent }}% complete
|
||||
{% endblocktrans %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue