From 613f71837b83d11a8ae2dbfa89368995e88d5c5e Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Wed, 1 Jun 2022 22:08:33 +0700 Subject: [PATCH] Add StatusTagColumn component --- .../templates/wagtailadmin/tables/status_tag_cell.html | 3 +++ wagtail/admin/ui/tables.py | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 wagtail/admin/templates/wagtailadmin/tables/status_tag_cell.html diff --git a/wagtail/admin/templates/wagtailadmin/tables/status_tag_cell.html b/wagtail/admin/templates/wagtailadmin/tables/status_tag_cell.html new file mode 100644 index 0000000000..fa7d8b9973 --- /dev/null +++ b/wagtail/admin/templates/wagtailadmin/tables/status_tag_cell.html @@ -0,0 +1,3 @@ + +
{{ value }}
+ diff --git a/wagtail/admin/ui/tables.py b/wagtail/admin/ui/tables.py index 4afb75c9c2..959ee272e8 100644 --- a/wagtail/admin/ui/tables.py +++ b/wagtail/admin/ui/tables.py @@ -177,6 +177,12 @@ class StatusFlagColumn(Column): self.false_label = false_label +class StatusTagColumn(Column): + """Represents a status tag""" + + cell_template_name = "wagtailadmin/tables/status_tag_cell.html" + + class DateColumn(Column): """Outputs a date in human-readable format"""