diff --git a/intervention/tables.py b/intervention/tables.py
index 223cd8a4..fd39ddcf 100644
--- a/intervention/tables.py
+++ b/intervention/tables.py
@@ -84,14 +84,17 @@ class InterventionTable(BaseTable, TableRenderMixin):
Returns:
"""
- html = ""
- html += self.render_link(
- tooltip=_("Open {}").format(_("Intervention")),
- href=reverse("intervention:detail", args=(record.id,)),
- txt=value,
- new_tab=False,
+ context = {
+ "tooltip": _("Open {}").format(_("Intervention")),
+ "content": value,
+ "url": reverse("intervention:detail", args=(record.id,)),
+ "has_revocations": record.legal.revocations.exists()
+ }
+ html = render_to_string(
+ "table/revocation_warning_col.html",
+ context
)
- return format_html(html)
+ return html
def render_c(self, value, record: Intervention):
""" Renders the checked column for an intervention
@@ -127,7 +130,7 @@ class InterventionTable(BaseTable, TableRenderMixin):
Returns:
"""
- parcels = value.parcels.all().values_list(
+ parcels = value.parcels.values_list(
"gmrkng",
flat=True
).distinct()
@@ -139,7 +142,6 @@ class InterventionTable(BaseTable, TableRenderMixin):
)
return html
-
def render_r(self, value, record: Intervention):
""" Renders the recorded column for an intervention
diff --git a/templates/table/revocation_warning_col.html b/templates/table/revocation_warning_col.html
new file mode 100644
index 00000000..2ed0922a
--- /dev/null
+++ b/templates/table/revocation_warning_col.html
@@ -0,0 +1,14 @@
+{% load i18n fontawesome_5 %}
+
+{% if has_revocations %}
+
+
+ {% fa5_icon 'ban' %}
+ {{content}}
+
+
+{% else %}
+
+ {{content}}
+
+{% endif %}
\ No newline at end of file