diff --git a/compensation/tables/compensation.py b/compensation/tables/compensation.py index 02fe00e0..fe3efe00 100644 --- a/compensation/tables/compensation.py +++ b/compensation/tables/compensation.py @@ -148,20 +148,3 @@ class CompensationTable(BaseTable, TableRenderMixin, TableOrderMixin): ) return format_html(html) - def render_e(self, value, record: Compensation): - """ Renders the editable column for a compensation - - Args: - value (str): The identifier value - record (Compensation): The compensation record - - Returns: - - """ - 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) diff --git a/compensation/tables/eco_account.py b/compensation/tables/eco_account.py index 65489b5c..da1444ea 100644 --- a/compensation/tables/eco_account.py +++ b/compensation/tables/eco_account.py @@ -134,23 +134,3 @@ class EcoAccountTable(BaseTable, TableRenderMixin, TableOrderMixin): icn_filled=checked, ) return format_html(html) - - def render_e(self, value, record: EcoAccount): - """ Renders the editable column for an eco account - - Args: - value (str): The identifier value - record (EcoAccount): The eco account record - - Returns: - - """ - html = "" - # Do not use value in here, since value does use unprefetched 'users' manager, where record has already - # prefetched users data - 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) diff --git a/ema/tables.py b/ema/tables.py index 928b3e2b..aa043c2c 100644 --- a/ema/tables.py +++ b/ema/tables.py @@ -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) diff --git a/ema/views/ema.py b/ema/views/ema.py index b298959f..b4ad6fd0 100644 --- a/ema/views/ema.py +++ b/ema/views/ema.py @@ -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 diff --git a/intervention/tables.py b/intervention/tables.py index bdcdc075..39cae2a9 100644 --- a/intervention/tables.py +++ b/intervention/tables.py @@ -146,22 +146,3 @@ class InterventionTable(BaseTable, TableRenderMixin, TableOrderMixin): ) return format_html(html) - def render_e(self, value, record: Intervention): - """ Renders the editable column for an intervention - - Args: - value (str): The identifier value - record (Intervention): The intervention 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) - diff --git a/konova/templates/konova/includes/parcels/parcel_table_frame.html b/konova/templates/konova/includes/parcels/parcel_table_frame.html index 21b75b76..8adc2e80 100644 --- a/konova/templates/konova/includes/parcels/parcel_table_frame.html +++ b/konova/templates/konova/includes/parcels/parcel_table_frame.html @@ -1,7 +1,8 @@ -{% load i18n l10n %} +{% load i18n l10n fontawesome_5 %}