#86 Revocation rendering if needed
* renders revocation warning on the index view if a revocation exists
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user