tables.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  1. import django_tables2 as tables
  2. from dbsynce.models import *
  3. from dbsynce.models import *
  4. from django.contrib.auth import get_user_model
  5. from django.utils.html import format_html
  6. from django.utils.translation import gettext_lazy as _
  7. class TransactionsWalletTable(tables.Table):
  8. # id = tables.Column(order_by=True)
  9. id = tables.Column(
  10. verbose_name='#',
  11. orderable=False,
  12. attrs={
  13. "td": {"width": "5%"}
  14. }
  15. )
  16. wallet = tables.Column(
  17. verbose_name=_('Owner'),
  18. orderable=False,
  19. attrs={
  20. "td": {"width": "15%"}
  21. }
  22. )
  23. name_operation = tables.Column(
  24. verbose_name=_('Service'),
  25. attrs={
  26. 'th': {'scope': 'col'},
  27. "td": {"width": "20%"}
  28. }
  29. )
  30. price = tables.Column(
  31. verbose_name=_('Points'),
  32. attrs={
  33. "class": "row",
  34. "td": {"width": "10%"}
  35. }
  36. )
  37. date_operation = tables.Column(
  38. verbose_name=_('Registration date'),
  39. attrs={
  40. "td": {"width": "30%"}
  41. }
  42. )
  43. is_carried_out = tables.BooleanColumn(
  44. verbose_name=_('Status'),
  45. orderable=False,
  46. yesno=_("Successful, not successful"),
  47. attrs={
  48. "td": {"width": "20%"}
  49. }
  50. )
  51. class Meta:
  52. # model = TransactionsWallets
  53. attrs = {
  54. "class": "table table-striped"
  55. }
  56. exclude = (
  57. "balance_before",
  58. "amount",
  59. "metaservice_id",
  60. "transaction_type",
  61. "doc_num",
  62. "service_id"
  63. )
  64. def render_name_operation(self, value, record):
  65. return format_html(
  66. "<a href='{}'>{}</a>",
  67. record.get_absolute_url(),
  68. value
  69. )
  70. class PartnersTable(tables.Table):
  71. id = tables.Column(
  72. verbose_name=_('ID'),
  73. attrs={
  74. "td": {"width": "5%"}
  75. }
  76. )
  77. legal_name = tables.Column(
  78. verbose_name=_('Legal entity'),
  79. attrs={
  80. 'th': {'scope': 'col'},
  81. "td": {"width": "20%"}
  82. }
  83. )
  84. repr = tables.Column(
  85. accessor='repr.full_name',
  86. order_by=('repr.first_name', 'repr.last_name'),
  87. verbose_name=_('Responsible'),
  88. attrs={
  89. "td": {"width": "15%"}
  90. }
  91. )
  92. status = tables.Column(
  93. verbose_name=_('Status'),
  94. attrs={
  95. 'th': {'scope': 'col'},
  96. "td": {"width": "20%"}
  97. }
  98. )
  99. check = tables.BooleanColumn(
  100. verbose_name='',
  101. attrs={
  102. 'th': {'scope': 'col'},
  103. "td": {"width": "20%"}
  104. }
  105. )
  106. # paginate_by = 10
  107. class Meta:
  108. model = Company
  109. attrs = {
  110. "class": "table table-layout-fixed"
  111. }
  112. exclude = (
  113. 'inn',
  114. 'kpp',
  115. 'ogrn',
  116. 'bank_name',
  117. 'bik',
  118. 'ks',
  119. 'rs',
  120. 'address',
  121. 'requirements',
  122. 'id_metaservice',
  123. 'is_global',
  124. 'is_visible',
  125. 'ticket_status'
  126. )
  127. def render_check(self, value, record):
  128. if record.status == 'active':
  129. return format_html(
  130. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-partners-id="{}">',
  131. record.id
  132. )
  133. else:
  134. return format_html(
  135. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-partners-id="{}">',
  136. record.id
  137. )
  138. class ResourcesTable(tables.Table):
  139. id = tables.Column(
  140. verbose_name=_('ID'),
  141. attrs={
  142. "td": {"width": "5%"}
  143. }
  144. )
  145. # В user ссылка LinkColumn на страницу Аси "Информация о партнере" страница partner_information_form
  146. user = tables.Column(
  147. accessor='user.get_full_name',
  148. order_by=('user.first_name', 'user.last_name'),
  149. verbose_name=_('Responsible'),
  150. attrs={
  151. "td": {"width": "15%"}
  152. }
  153. )
  154. status = tables.Column(
  155. verbose_name=_('Status'),
  156. attrs={
  157. 'th': {'scope': 'col'},
  158. "td": {"width": "20%"}
  159. }
  160. )
  161. check = tables.BooleanColumn(
  162. verbose_name='',
  163. attrs={
  164. 'th': {'scope': 'col'},
  165. "td": {"width": "40%"}
  166. }
  167. )
  168. # paginate_by = 10
  169. class Meta:
  170. model = Resource
  171. attrs = {
  172. "class": "table table-layout-fixed"
  173. }
  174. exclude = (
  175. 'id_metaservice',
  176. 'resource_type',
  177. 'requirements',
  178. 'is_global',
  179. 'is_visible',
  180. 'ticket_status'
  181. )
  182. def render_check(self, value, record):
  183. if record.status == 'active':
  184. return format_html(
  185. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  186. record.id
  187. )
  188. else:
  189. return format_html(
  190. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  191. record.id
  192. )
  193. # class ResourcesTable(tables.Table):
  194. # id = tables.Column(
  195. # verbose_name=_('ID'),
  196. # attrs={
  197. # "td": {"width": "5%"}
  198. # }
  199. # )
  200. # user = tables.Column(
  201. # accessor='user.get_full_name',
  202. # order_by=('user.first_name', 'user.last_name'),
  203. # verbose_name=_('Responsible'),
  204. # attrs={
  205. # "td": {"width": "15%"}
  206. # }
  207. # )
  208. # status = tables.Column(
  209. # verbose_name=_('Status'),
  210. # attrs={
  211. # 'th': {'scope': 'col'},
  212. # "td": {"width": "20%"}
  213. # }
  214. # )
  215. # activation = tables.Column(
  216. # verbose_name=_('Активация'),
  217. # attrs={
  218. # 'th': {'scope': 'col'},
  219. # "td": {"width": "40%"} # Увеличим ширину для размещения 4 кнопок
  220. # }
  221. # )
  222. # class Meta:
  223. # model = Resource
  224. # attrs = {
  225. # "class": "table table-layout-fixed custom-table" # Добавлен кастомный класс для стилей
  226. # }
  227. # exclude = (
  228. # 'id_metaservice',
  229. # 'resource_type',
  230. # 'requirements',
  231. # 'is_global',
  232. # 'is_visible',
  233. # 'ticket_status'
  234. # )
  235. # def render_activation(self, value, record):
  236. # # Чекбокс для текущего статуса
  237. # checkbox = format_html(
  238. # '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault_{}" data-resource-id="{}" {}>',
  239. # record.id, record.id, 'checked' if record.status == 'active' else ''
  240. # )
  241. # # 4 кнопки-картинки без href, полагаемся на AJAX
  242. # buttons = [
  243. # format_html(
  244. # '<a class="activation-btn" data-action="action1" data-resource-id="{}">'
  245. # '<img src="{}" alt="Action 1" style="width: 30px; height: 30px;"></a>',
  246. # record.id, self.get_image_url('logo.png')
  247. # ),
  248. # format_html(
  249. # '<a class="activation-btn" data-action="action2" data-resource-id="{}">'
  250. # '<img src="{}" alt="Action 2" style="width: 30px; height: 30px;"></a>',
  251. # record.id, self.get_image_url('logo.png')
  252. # ),
  253. # format_html(
  254. # '<a class="activation-btn" data-action="action3" data-resource-id="{}">'
  255. # '<img src="{}" alt="Action 3" style="width: 30px; height: 30px;"></a>',
  256. # record.id, self.get_image_url('logo.png')
  257. # ),
  258. # format_html(
  259. # '<a class="activation-btn" data-action="action4" data-resource-id="{}">'
  260. # '<img src="{}" alt="Action 4" style="width: 30px; height: 30px;"></a>',
  261. # record.id, self.get_image_url('logo.png')
  262. # )
  263. # ]
  264. # # Объединяем чекбокс и кнопки
  265. # return format_html('{} {}', checkbox, ' '.join(buttons))
  266. # def get_image_url(self, filename):
  267. # # Путь к изображениям
  268. # return f"{settings.STATIC_URL}sharix_admin/img/{filename}"
  269. class ProvidersTable(tables.Table):
  270. id = tables.Column(
  271. verbose_name=_('ID'),
  272. attrs={
  273. "td": {"width": "5%"}
  274. }
  275. )
  276. user = tables.Column(
  277. accessor='user.full_name',
  278. order_by=('user.first_name', 'user.last_name'),
  279. verbose_name=_('Full Name'),
  280. attrs={
  281. "td": {"width": "15%"}
  282. }
  283. )
  284. status = tables.Column(
  285. verbose_name=_('Status'),
  286. attrs={
  287. 'th': {'scope': 'col'},
  288. "td": {"width": "20%"}
  289. }
  290. )
  291. check = tables.BooleanColumn(
  292. verbose_name='',
  293. attrs={
  294. 'th': {'scope': 'col'},
  295. "td": {"width": "20%"}
  296. }
  297. )
  298. paginate_by = 10
  299. class Meta:
  300. model = Provider
  301. attrs = {
  302. "class": "table table-layout-fixed"
  303. }
  304. exclude = (
  305. 'id_metaservice',
  306. 'gap',
  307. 'requirements',
  308. 'status',
  309. 'service_status',
  310. 'location_type',
  311. 'default_location',
  312. 'is_global',
  313. 'is_visible'
  314. )
  315. def render_check(self, value, record):
  316. if record.status == 'active':
  317. return format_html(
  318. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  319. record.id
  320. )
  321. else:
  322. return format_html(
  323. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  324. record.id
  325. )
  326. class ServiceTariffsTable(tables.Table):
  327. id = tables.Column(
  328. verbose_name=_('ID'),
  329. attrs={
  330. "td": {"width": "5%"}
  331. }
  332. )
  333. codename = tables.LinkColumn(
  334. 'sharix_admin:service_tariff/edit/',
  335. verbose_name=_('Кодовое название'),
  336. text=lambda record: record.caption,
  337. args=[tables.A('pk')],
  338. attrs={
  339. 'th': {'scope': 'col'},
  340. "td": {"width": "15%"}
  341. }
  342. )
  343. #service_category = tables.Column(
  344. service_category = tables.LinkColumn(
  345. 'sharix_admin:service_category/edit/',
  346. verbose_name=_('Название схемы услуги'),
  347. text=lambda record: record.service_category.caption,
  348. args=[tables.A('pk')],
  349. attrs={
  350. 'th': {'scope': 'col'},
  351. "td": {"width": "15%"}
  352. }
  353. )
  354. resource_type = tables.Column(
  355. verbose_name=_('Тип ресурса'),
  356. attrs={
  357. 'th': {'scope': 'col'},
  358. "td": {"width": "20%"}
  359. }
  360. )
  361. company_comission = tables.Column(
  362. verbose_name=_('Комиссия партнера'),
  363. attrs={
  364. 'th': {'scope': 'col'},
  365. "td": {"width": "20%"}
  366. }
  367. )
  368. check = tables.BooleanColumn(
  369. verbose_name=_('Activity'),
  370. orderable=False,
  371. attrs={
  372. 'th': {'scope': 'col'},
  373. "td": {"width": "20%"}
  374. }
  375. )
  376. class Meta:
  377. model = Service
  378. attrs = {
  379. "class": "table table-layout-fixed"
  380. }
  381. exclude = (
  382. 'resource',
  383. 'company',
  384. 'caption',
  385. 'description',
  386. 'price_type',
  387. 'price_min',
  388. 'price_amount',
  389. 'id_metaservice',
  390. 'requirements',
  391. 'ticket_status',
  392. 'price_km',
  393. 'is_global',
  394. 'is_visible',
  395. 'status'
  396. )
  397. def render_check(self, value, record):
  398. if record.status == 'active':
  399. return format_html('<input class="form-check-input status-toggle" disabled checked type="checkbox"')
  400. else:
  401. return format_html('<input class="form-check-input status-toggle" disabled type="checkbox"')
  402. class ServiceCategoriesTable(tables.Table):
  403. id = tables.Column(attrs={"td": {"width": "50px"}})
  404. caption = tables.LinkColumn(
  405. 'sharix_admin:service_category/edit/',
  406. verbose_name='Услуга',
  407. orderable=False,
  408. text=lambda record: record.caption,
  409. args=[tables.A('pk')],
  410. attrs={
  411. "a": {"style": "pointer-events: none;"},
  412. 'th': {'scope': 'col'},
  413. "td": {"class": "name_col"}
  414. }
  415. )
  416. #codename = tables.LinkColumn(
  417. # 'sharix_admin:service_category/edit/',
  418. # verbose_name='Тех.название',
  419. # orderable=False,
  420. # text=lambda record: record.codename,
  421. # args=[tables.A('pk')],
  422. # attrs={
  423. # "a": {"style": "pointer-events: none;"},
  424. # 'th': {'scope': 'col'},
  425. # "td": {"class": "name_col"}
  426. # }
  427. #)
  428. description = tables.LinkColumn(
  429. 'sharix_admin:service_category/edit/',
  430. orderable=False, verbose_name='Описание',
  431. text=lambda record: record.description,
  432. args=[tables.A('pk')],
  433. attrs={
  434. "a": {"style": "pointer-events: none;"},
  435. 'th': {'scope': 'col'},
  436. "td": {"class": "description_col"}
  437. }
  438. )
  439. metaservice_comission = tables.Column(
  440. verbose_name=_('Комиссия Сервиса'),
  441. attrs={
  442. 'th': {'scope': 'col'},
  443. "td": {"width": "15%"}}
  444. )
  445. edit = tables.LinkColumn(
  446. 'sharix_admin:service_category/edit/',
  447. verbose_name='',
  448. orderable=False,
  449. text="E",
  450. args=[tables.A('pk')],
  451. attrs={
  452. 'th': {'scope': 'col'},
  453. "td": {"class": "edit_col"}
  454. }
  455. )
  456. check = tables.BooleanColumn(
  457. verbose_name=_('Activity'),
  458. orderable=False,
  459. attrs={
  460. 'th': {'scope': 'col'},
  461. "td": {"width": "5%"}
  462. }
  463. )
  464. #TODO change to 'change status!'
  465. #deletee = tables.LinkColumn(
  466. # 'sharix_admin:service_category/delete/',
  467. # verbose_name='',
  468. # orderable=False,
  469. # text="D",
  470. # args=[tables.A('pk')],
  471. # attrs={
  472. # 'th': {'scope': 'col'},
  473. # "td": {"class": "delete_col"}
  474. # }
  475. #)
  476. class Meta:
  477. model = ServiceCategory
  478. attrs = {
  479. "class": "table table-layout-fixed text-start"
  480. }
  481. exclude = (
  482. 'requirements',
  483. 'price_type',
  484. 'status',
  485. 'ticket_status',
  486. 'id_metaservice',
  487. 'link_agreement',
  488. 'is_global',
  489. 'is_visible',
  490. 'codename',
  491. )
  492. def render_check(self, value, record):
  493. if record.status == '0':
  494. #if record.status == 'active':
  495. return format_html(
  496. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service_category-id="{}">',
  497. record.id
  498. )
  499. #return format_html('<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service_category-id="{}">')
  500. #return format_html('<input class="form-check-input status-toggle" disabled checked type="checkbox"')
  501. else:
  502. return format_html(
  503. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-service_category-id="{}">',
  504. record.id
  505. )
  506. #return format_html('<input class="form-check-input status-toggle" disabled type="checkbox"')
  507. # def render_delete(self, value, record):
  508. # return format_html('<a href="/service_category/delete" class="btn btn-outline-danger">_(Delete)</a>')
  509. # def render_name_operation(self, value, record):
  510. # return format_html("<a href='{}'>{}</a>", record.get_absolute_url(), value)
  511. class ServiceTable(tables.Table):
  512. id = tables.Column(
  513. verbose_name=_('ID'),
  514. attrs={
  515. "td": {"width": "5%"}
  516. }
  517. )
  518. service_category = tables.Column(
  519. verbose_name=_('Description of the service'),
  520. accessor='service_category.caption',
  521. attrs={
  522. 'th': {'scope': 'col'},
  523. "td": {"width": "20%"}}
  524. )
  525. # description = tables.Column(verbose_name='Название тарифа', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  526. # description = tables.Column(verbose_name='Описание строки тарифов', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  527. # price_type = tables.Column(verbose_name='Тип тарифа', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  528. price_km = tables.Column(
  529. verbose_name=_('Cost km.'),
  530. attrs={
  531. 'th': {'scope': 'col'},
  532. "td": {"width": "20%"}
  533. }
  534. )
  535. price_min = tables.Column(
  536. verbose_name=_('Cost min.'),
  537. attrs={
  538. 'th': {'scope': 'col'},
  539. "td": {"width": "20%"}}
  540. )
  541. price_amount = tables.Column(
  542. verbose_name=_('Cost of service'),
  543. attrs={
  544. 'th': {'scope': 'col'},
  545. "td": {"width": "20%"}
  546. }
  547. )
  548. class Meta:
  549. model = Service
  550. attrs = {
  551. "class": "table table-layout-fixed"
  552. }
  553. exclude = (
  554. 'resource',
  555. 'requirements',
  556. 'id_metaservice',
  557. 'price_type',
  558. 'ticket_status',
  559. 'is_global',
  560. 'is_visible'
  561. )
  562. def render_check(self, value, record):
  563. if record.status == 'active':
  564. return format_html(
  565. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service-id="{}">',
  566. record.id
  567. )
  568. else:
  569. return format_html(
  570. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-service-id="{}">',
  571. record.id
  572. )
  573. class UserInfoTable(tables.Table):
  574. id = tables.Column(
  575. verbose_name=_('ID'),
  576. attrs={
  577. "td": {"width": "5%"}
  578. }
  579. )
  580. class Meta:
  581. model = get_user_model()
  582. attrs = {
  583. "class": "table table-layout-fixed"
  584. }
  585. exclude = (
  586. 'password',
  587. 'phone_number',
  588. 'last_login',
  589. 'is_staff',
  590. 'is_superuser',
  591. 'date_joined'
  592. )
  593. class PermissionsTable(tables.Table):
  594. id = tables.Column(
  595. verbose_name=_('ID'),
  596. attrs={
  597. "td": {"width": "5%"}
  598. }
  599. )
  600. user = tables.Column(
  601. accessor='user.full_name',
  602. order_by=('user.first_name', 'user.last_name'),
  603. verbose_name=_('User'),
  604. attrs={
  605. "td": {"width": "15%"}
  606. }
  607. )
  608. id_permissions = tables.Column(
  609. verbose_name=_('Permission'),
  610. attrs={
  611. "td": {"width": "15%"}
  612. }
  613. )
  614. status = tables.Column(
  615. verbose_name=_('Status'),
  616. attrs={
  617. 'th': {'scope': 'col'},
  618. "td": {"width": "20%"}
  619. }
  620. )
  621. check = tables.BooleanColumn(
  622. verbose_name='',
  623. attrs={
  624. 'th': {'scope': 'col'},
  625. "td": {"width": "20%"}
  626. }
  627. )
  628. # paginate_by = 10
  629. class Meta:
  630. model = Permissions
  631. attrs = {
  632. "class": "table table-layout-fixed"
  633. }
  634. exclude = (
  635. 'check_date',
  636. 'expire_date',
  637. 'check_level',
  638. 'checked_by',
  639. 'ticket_status'
  640. )
  641. def render_check(self, value, record):
  642. if record.status == 'active':
  643. return format_html(
  644. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  645. record.id
  646. )
  647. else:
  648. return format_html(
  649. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  650. record.id
  651. )
  652. class RelationshipTable(tables.Table):
  653. id = tables.Column(
  654. verbose_name=_('ID'),
  655. attrs={
  656. "td": {"width": "5%"}
  657. }
  658. )
  659. user_who = tables.Column(
  660. accessor='user_who.full_name',
  661. order_by=('user_who.first_name', 'user_who.last_name'),
  662. verbose_name=_('Initiator'),
  663. attrs={
  664. "td": {"width": "15%"}
  665. }
  666. )
  667. user_whom = tables.Column(
  668. accessor='user_whom.full_name',
  669. order_by=('user_whom.first_name', 'user_whom.last_name'),
  670. verbose_name=_('Goal'),
  671. attrs={
  672. "td": {"width": "15%"}
  673. }
  674. )
  675. neg_type = tables.Column(
  676. verbose_name=_('Neg Type'),
  677. attrs={
  678. 'th': {'scope': 'col'},
  679. "td": {"width": "20%"}
  680. }
  681. )
  682. status = tables.Column(
  683. verbose_name=_('Status'),
  684. attrs={
  685. 'th': {'scope': 'col'},
  686. "td": {"width": "20%"}
  687. }
  688. )
  689. check = tables.BooleanColumn(
  690. verbose_name='',
  691. attrs={
  692. 'th': {'scope': 'col'},
  693. "td": {"width": "20%"}
  694. }
  695. )
  696. paginate_by = 10
  697. class Meta:
  698. model = Relationship
  699. attrs = {
  700. "class": "table table-layout-fixed"
  701. }
  702. exclude = (
  703. 'ticket_status',
  704. )
  705. def render_check(self, value, record):
  706. if record.status == 'active':
  707. return format_html(
  708. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  709. record.id
  710. )
  711. else:
  712. return format_html(
  713. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  714. record.id
  715. )