Table improvements

* enhances visualization of editable column on tables
    * simplifies code
* enhances visualization of parcel_group column on tables
* WIP: Ordering on intervention table is odd. Same results are being displayed on page 2. Needs further analysis and fixing!
This commit is contained in:
2022-10-12 16:26:01 +02:00
parent 90da686de3
commit b57d52dc9f
9 changed files with 31 additions and 82 deletions

View File

@@ -111,22 +111,3 @@ class EmaTable(BaseTable, TableRenderMixin, TableOrderMixin):
icn_filled=recorded,
)
return format_html(html)
def render_e(self, value, record: Ema):
""" Renders the editable column for a EMA
Args:
value (str): The identifier value
record (Ema): The EMA record
Returns:
"""
html = ""
has_access = record.is_shared_with(self.user)
html += self.render_icn(
tooltip=_("Full access granted") if has_access else _("Access not granted"),
icn_class="fas fa-edit rlp-r-inv" if has_access else "far fa-edit",
)
return format_html(html)

View File

@@ -39,9 +39,8 @@ def index_view(request: HttpRequest):
template = "generic_index.html"
emas = Ema.objects.filter(
deleted=None,
).order_by(
"-modified"
)
table = EmaTable(
request,
queryset=emas