|
@@ -5,6 +5,7 @@ from django.contrib.auth import get_user_model
|
|
|
from django.utils.html import format_html
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
+from dbsynce.lib.dicts import *
|
|
|
|
|
|
class TransactionsWalletTable(tables.Table):
|
|
|
# id = tables.Column(order_by=True)
|
|
@@ -164,15 +165,17 @@ class OrdersTable(tables.Table):
|
|
|
"td": {"width": "5%"}
|
|
|
}
|
|
|
)
|
|
|
- title = tables.Column(
|
|
|
- #'sharix_admin:order_detail',
|
|
|
- #args=[tables.A('pk')],
|
|
|
+ title = tables.LinkColumn(
|
|
|
+ 'sharix_admin:order_detail',
|
|
|
+ args=[tables.A('pk')],
|
|
|
verbose_name=_('Title'),
|
|
|
attrs={
|
|
|
"td": {"width": "20%"}
|
|
|
}
|
|
|
)
|
|
|
status = tables.Column(
|
|
|
+ accessor='status',
|
|
|
+ #accessor='status_by_code(status)',
|
|
|
verbose_name=_('Status'),
|
|
|
attrs={
|
|
|
"td": {"width": "15%"}
|
|
@@ -221,7 +224,9 @@ class OrdersTable(tables.Table):
|
|
|
'company')
|
|
|
|
|
|
class ResourcesTable(tables.Table):
|
|
|
- id = tables.Column(
|
|
|
+ id = tables.LinkColumn(
|
|
|
+ 'sharix_admin:resource_detail',
|
|
|
+ args=[tables.A('pk')],
|
|
|
verbose_name=_('ID'),
|
|
|
attrs={
|
|
|
"td": {"width": "5%"}
|
|
@@ -243,11 +248,32 @@ class ResourcesTable(tables.Table):
|
|
|
"td": {"width": "20%"}
|
|
|
}
|
|
|
)
|
|
|
+
|
|
|
+ resource_type = tables.Column(
|
|
|
+ attrs={
|
|
|
+ 'th': {'scope': 'col'},
|
|
|
+ "td": {"width": "20%"}
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ edit = tables.LinkColumn(
|
|
|
+ 'sharix_admin:resource/edit/',
|
|
|
+ verbose_name='',
|
|
|
+ orderable=False,
|
|
|
+ text="E",
|
|
|
+ args=[tables.A('pk')],
|
|
|
+ attrs={
|
|
|
+ 'th': {'scope': 'col'},
|
|
|
+ "td": {"class": "edit_col"},
|
|
|
+ "td": {"width": "10%"}
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
check = tables.BooleanColumn(
|
|
|
verbose_name='',
|
|
|
attrs={
|
|
|
'th': {'scope': 'col'},
|
|
|
- "td": {"width": "40%"}
|
|
|
+ "td": {"width": "10%"}
|
|
|
}
|
|
|
)
|
|
|
|
|
@@ -259,7 +285,6 @@ class ResourcesTable(tables.Table):
|
|
|
}
|
|
|
exclude = (
|
|
|
'id_metaservice',
|
|
|
- 'resource_type',
|
|
|
'requirements',
|
|
|
'is_global',
|
|
|
'is_visible',
|
|
@@ -279,7 +304,9 @@ class ResourcesTable(tables.Table):
|
|
|
)
|
|
|
|
|
|
class ProvidersTable(tables.Table):
|
|
|
- id = tables.Column(
|
|
|
+ id = tables.LinkColumn(
|
|
|
+ 'sharix_admin:provider_detail',
|
|
|
+ args=[tables.A('pk')],
|
|
|
verbose_name=_('ID'),
|
|
|
attrs={
|
|
|
"td": {"width": "5%"}
|
|
@@ -294,12 +321,46 @@ class ProvidersTable(tables.Table):
|
|
|
}
|
|
|
)
|
|
|
status = tables.Column(
|
|
|
- verbose_name=_('Status'),
|
|
|
+ #verbose_name=_('Status'),
|
|
|
attrs={
|
|
|
'th': {'scope': 'col'},
|
|
|
"td": {"width": "20%"}
|
|
|
}
|
|
|
)
|
|
|
+ service = tables.LinkColumn(
|
|
|
+ 'sharix_admin:service_tariff_detail',
|
|
|
+ args=[tables.A('service.pk')],
|
|
|
+ accessor='service.caption',
|
|
|
+ verbose_name=_('Service'),
|
|
|
+ attrs={
|
|
|
+ 'th': {'scope': 'col'},
|
|
|
+ "td": {"width": "20%"}
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ resource = tables.LinkColumn(
|
|
|
+ 'sharix_admin:resource_detail',
|
|
|
+ args=[tables.A('resource.pk')],
|
|
|
+ accessor='resource.resource_type',
|
|
|
+ verbose_name=_('Resource'),
|
|
|
+ attrs={
|
|
|
+ 'th': {'scope': 'col'},
|
|
|
+ "td": {"width": "20%"}
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ #edit = tables.LinkColumn(
|
|
|
+ # 'sharix_admin:provider/edit/',
|
|
|
+ # verbose_name='',
|
|
|
+ # orderable=False,
|
|
|
+ # text="E",
|
|
|
+ # args=[tables.A('pk')],
|
|
|
+ # attrs={
|
|
|
+ # 'th': {'scope': 'col'},
|
|
|
+ # "td": {"class": "edit_col"}
|
|
|
+ # }
|
|
|
+ #)
|
|
|
+
|
|
|
check = tables.BooleanColumn(
|
|
|
verbose_name='',
|
|
|
attrs={
|
|
@@ -323,7 +384,8 @@ class ProvidersTable(tables.Table):
|
|
|
'location_type',
|
|
|
'default_location',
|
|
|
'is_global',
|
|
|
- 'is_visible'
|
|
|
+ 'is_visible',
|
|
|
+ 'ticket_status',
|
|
|
)
|
|
|
|
|
|
def render_check(self, value, record):
|
|
@@ -347,7 +409,7 @@ class ServiceTariffsTable(tables.Table):
|
|
|
}
|
|
|
)
|
|
|
codename = tables.LinkColumn(
|
|
|
- 'sharix_admin:service_tariff/edit/',
|
|
|
+ 'sharix_admin:service_tariff_detail',
|
|
|
verbose_name=_('Кодовое название'),
|
|
|
text=lambda record: record.caption,
|
|
|
args=[tables.A('pk')],
|
|
@@ -358,8 +420,8 @@ class ServiceTariffsTable(tables.Table):
|
|
|
)
|
|
|
#service_category = tables.Column(
|
|
|
service_category = tables.LinkColumn(
|
|
|
- 'sharix_admin:service_category/edit/',
|
|
|
- verbose_name=_('Название схемы услуги'),
|
|
|
+ 'sharix_admin:service_category_detail',
|
|
|
+ verbose_name=_('Название Типа услуги'),
|
|
|
text=lambda record: record.service_category.caption,
|
|
|
args=[tables.A('pk')],
|
|
|
attrs={
|
|
@@ -368,7 +430,7 @@ class ServiceTariffsTable(tables.Table):
|
|
|
}
|
|
|
)
|
|
|
resource_type = tables.Column(
|
|
|
- verbose_name=_('Тип ресурса'),
|
|
|
+ #verbose_name=_('Тип ресурса'),
|
|
|
attrs={
|
|
|
'th': {'scope': 'col'},
|
|
|
"td": {"width": "20%"}
|
|
@@ -376,13 +438,25 @@ class ServiceTariffsTable(tables.Table):
|
|
|
)
|
|
|
|
|
|
company_comission = tables.Column(
|
|
|
- verbose_name=_('Комиссия партнера'),
|
|
|
+ #verbose_name=_('Комиссия партнера'),
|
|
|
attrs={
|
|
|
'th': {'scope': 'col'},
|
|
|
"td": {"width": "20%"}
|
|
|
}
|
|
|
)
|
|
|
|
|
|
+ edit = tables.LinkColumn(
|
|
|
+ 'sharix_admin:service_tariff/edit/',
|
|
|
+ verbose_name='',
|
|
|
+ orderable=False,
|
|
|
+ text="E",
|
|
|
+ args=[tables.A('pk')],
|
|
|
+ attrs={
|
|
|
+ 'th': {'scope': 'col'},
|
|
|
+ "td": {"class": "edit_col"}
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
check = tables.BooleanColumn(
|
|
|
verbose_name=_('Activity'),
|
|
|
orderable=False,
|
|
@@ -422,10 +496,14 @@ class ServiceTariffsTable(tables.Table):
|
|
|
|
|
|
|
|
|
class ServiceCategoriesTable(tables.Table):
|
|
|
- id = tables.Column(attrs={"td": {"width": "50px"}})
|
|
|
+ id = tables.LinkColumn(
|
|
|
+ 'sharix_admin:service_category_detail',
|
|
|
+ args=[tables.A('pk')],
|
|
|
+ attrs={"td": {"width": "50px"}}
|
|
|
+ )
|
|
|
|
|
|
caption = tables.LinkColumn(
|
|
|
- 'sharix_admin:service_category/edit/',
|
|
|
+ 'sharix_admin:service_category_detail',
|
|
|
verbose_name='Услуга',
|
|
|
orderable=False,
|
|
|
text=lambda record: record.caption,
|
|
@@ -449,11 +527,11 @@ class ServiceCategoriesTable(tables.Table):
|
|
|
# "td": {"class": "name_col"}
|
|
|
# }
|
|
|
#)
|
|
|
- description = tables.LinkColumn(
|
|
|
- 'sharix_admin:service_category/edit/',
|
|
|
- orderable=False, verbose_name='Описание',
|
|
|
- text=lambda record: record.description,
|
|
|
- args=[tables.A('pk')],
|
|
|
+ description = tables.Column(
|
|
|
+ orderable=False,
|
|
|
+ #verbose_name='Описание',
|
|
|
+ #text=lambda record: record.description,
|
|
|
+ #args=[tables.A('pk')],
|
|
|
attrs={
|
|
|
"a": {"style": "pointer-events: none;"},
|
|
|
'th': {'scope': 'col'},
|
|
@@ -462,7 +540,7 @@ class ServiceCategoriesTable(tables.Table):
|
|
|
)
|
|
|
|
|
|
metaservice_comission = tables.Column(
|
|
|
- verbose_name=_('Комиссия Сервиса'),
|
|
|
+ #verbose_name=_('Комиссия Сервиса'),
|
|
|
attrs={
|
|
|
'th': {'scope': 'col'},
|
|
|
"td": {"width": "15%"}}
|