From 2607bf43d0b7f5aab32560e8eec3ab33217e00e4 Mon Sep 17 00:00:00 2001
From: jacobtoppm <55137073+jacobtoppm@users.noreply.github.com>
Date: Thu, 18 Jun 2020 16:07:02 +0100
Subject: [PATCH] Add failure icon, and use for rejected task states when
displaying workflow status (#6148)
---
wagtail/admin/templates/wagtailadmin/icons/failure.svg | 3 +++
wagtail/admin/templates/wagtailadmin/reports/workflow.html | 7 ++++---
.../templates/wagtailadmin/shared/workflow_status.html | 5 +++--
wagtail/admin/wagtail_hooks.py | 1 +
4 files changed, 11 insertions(+), 5 deletions(-)
create mode 100644 wagtail/admin/templates/wagtailadmin/icons/failure.svg
diff --git a/wagtail/admin/templates/wagtailadmin/icons/failure.svg b/wagtail/admin/templates/wagtailadmin/icons/failure.svg
new file mode 100644
index 0000000000..29521aafe4
--- /dev/null
+++ b/wagtail/admin/templates/wagtailadmin/icons/failure.svg
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/wagtail/admin/templates/wagtailadmin/reports/workflow.html b/wagtail/admin/templates/wagtailadmin/reports/workflow.html
index e00ce83ab4..a943822b05 100644
--- a/wagtail/admin/templates/wagtailadmin/reports/workflow.html
+++ b/wagtail/admin/templates/wagtailadmin/reports/workflow.html
@@ -51,14 +51,15 @@
{{ workflow_name }}
- {% trans 'Approved task' as approved_title %}
{% trans 'Incomplete task' as incomplete_title %}
{% for task in workflow_state.all_tasks_with_status %}
{% if task.status == 'approved' %}
- {% icon "success" title=approved_title class_name="uniform" %}
+ {% icon "success" title=task.status_display class_name="icon uniform" %}
+ {% elif task.status == 'rejected' %}
+ {% icon "failure" title=task.status_display class_name="icon uniform" %}
{% else %}
- {% icon "radio-empty" title=incomplete_title class_name="uniform" %}
+ {% icon "radio-empty" title=incomplete_title class_name="icon uniform" %}
{% endif %}
{% endfor %}
diff --git a/wagtail/admin/templates/wagtailadmin/shared/workflow_status.html b/wagtail/admin/templates/wagtailadmin/shared/workflow_status.html
index 649f3db751..9f13d1b239 100644
--- a/wagtail/admin/templates/wagtailadmin/shared/workflow_status.html
+++ b/wagtail/admin/templates/wagtailadmin/shared/workflow_status.html
@@ -21,12 +21,13 @@
{% endif %}
- {% trans 'Approved task' as approved_title %}
{% trans 'Incomplete task' as incomplete_title %}
{% for task in workflow_tasks %}
{% if task.status == 'approved' %}
- {% icon "success" title=approved_title class_name="icon uniform" %}
+ {% icon "success" title=task.status_display class_name="icon uniform" %}
+ {% elif task.status == 'rejected' %}
+ {% icon "failure" title=task.status_display class_name="icon uniform" %}
{% else %}
{% icon "radio-empty" title=incomplete_title class_name="icon uniform" %}
{% endif %}
diff --git a/wagtail/admin/wagtail_hooks.py b/wagtail/admin/wagtail_hooks.py
index 7bde728bd8..e9fba9330e 100644
--- a/wagtail/admin/wagtail_hooks.py
+++ b/wagtail/admin/wagtail_hooks.py
@@ -704,6 +704,7 @@ def register_icons(icons):
'download.svg',
'duplicate.svg',
'edit.svg',
+ 'failure.svg',
'folder-inverse.svg',
'folder-open-1.svg',
'folder-open-inverse.svg',
|