|
@@ -49,6 +49,28 @@ class PartnersTable(tables.Table):
|
|
|
else:
|
|
|
return format_html('<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-partners-id="{}">', record.id)
|
|
|
|
|
|
+class TaskTable(tables.Table):
|
|
|
+ id = tables.Column(verbose_name=_('ID'), attrs={"td":{"width":"5%"}})
|
|
|
+ legal_name = tables.Column(verbose_name=_('Legal entity'), attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
|
|
|
+ repr_id = tables.Column(accessor='repr_id.full_name', order_by=('repr_id.first_name', 'repr_id.last_name'), verbose_name=_('Responsible'), attrs={"td":{"width":"15%"}})
|
|
|
+
|
|
|
+ status = tables.Column(verbose_name=_('Status'), attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
|
|
|
+ check = tables.BooleanColumn(verbose_name='', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
|
|
|
+ # paginate_by = 10
|
|
|
+ class Meta:
|
|
|
+ model = Company
|
|
|
+ attrs = {"class": "table table-layout-fixed"}
|
|
|
+ exclude = ('inn','kpp','ogrn', 'bank_name',
|
|
|
+ 'bik', 'ks', 'rs',
|
|
|
+ 'address', 'requirements',
|
|
|
+ 'id_metaservice', 'is_global', 'is_visible', 'ticket_status')
|
|
|
+
|
|
|
+ def render_check(self, value, record):
|
|
|
+ if record.status == 'active':
|
|
|
+ return format_html('<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-partners-id="{}">', record.id)
|
|
|
+ else:
|
|
|
+ return format_html('<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-partners-id="{}">', record.id)
|
|
|
+
|
|
|
class ResourceTable(tables.Table):
|
|
|
|
|
|
id = tables.Column(verbose_name=_('ID'), attrs={"td":{"width":"5%"}})
|
|
@@ -140,6 +162,27 @@ class ServiceTypeTable(tables.Table):
|
|
|
# def render_name_operation(self, value, record):
|
|
|
# return format_html("<a href='{}'>{}</a>", record.get_absolute_url(), value)
|
|
|
|
|
|
+class CommentsTable(tables.Table):
|
|
|
+
|
|
|
+ id = tables.Column( attrs={"td":{"width":"50px"}})
|
|
|
+ codename = tables.LinkColumn('service_type/edit/', verbose_name='Услуга', orderable=False, text = lambda record: record.codename,
|
|
|
+ args=[tables.A('pk')], attrs= {"a": {"style": "pointer-events: none;"}, 'th':{'scope':'col'}, "td":{"class":"name_col"}})
|
|
|
+ description = tables.LinkColumn('service_type/edit/', orderable=False, verbose_name='Описание', text = lambda record: record.description,
|
|
|
+ args=[tables.A('pk')], attrs= {"a": {"style": "pointer-events: none;"}, 'th':{'scope':'col'}, "td":{"class":"description_col"}})
|
|
|
+ edit = tables.LinkColumn('service_type/edit/', verbose_name='', orderable=False, text = "E",
|
|
|
+ args=[tables.A('pk')], attrs={'th':{'scope':'col'}, "td":{"class":"edit_col"}})
|
|
|
+ deletee = tables.LinkColumn('service_type/delete/', verbose_name='', orderable=False, text = "D",
|
|
|
+ args=[tables.A('pk')], attrs={'th':{'scope':'col'}, "td":{"class":"delete_col"}})
|
|
|
+
|
|
|
+
|
|
|
+ class Meta:
|
|
|
+ model = ServiceType
|
|
|
+ attrs = {"class": "table table-layout-fixed text-start"}
|
|
|
+ exclude = ('requirements',
|
|
|
+ 'price_type','status','ticket_status',
|
|
|
+ 'id_metaservice', 'link_agreement',
|
|
|
+ 'is_global', 'is_visible', 'caption')
|
|
|
+
|
|
|
class ServiceTable(tables.Table):
|
|
|
|
|
|
id = tables.Column(verbose_name=_('ID'), attrs={"td":{"width":"5%"}})
|