.admin-table-index .table-top p.table-top__total-count = "#{@ar_object.pagy.count} #{@model.ar_model.table_name} found" // .table-top__column-action // button.secondary-btn.column-btn data-bs-target="#columnActionModal" data-bs-toggle="modal" // span // i.fa.fa-columns.bolder // span // i.fa.fa-angle-down .new-admin-table.scrollable table.cm-table thead.cm-table__header tr.header-row th.check-box-space span input.cm-checkbox type="checkbox" - @model.available_fields[:index].each do |column| th = column.header tbody.cm-table__body - @ar_object.data.each do |ar_object| tr.body-row td.check-box-space span input.cm-checkbox type="checkbox" - @model.available_fields[:index].each_with_index do |column, index| td.text-ellipsis span class="#{column.field_type.to_s} #{column.cm_css_class} " - if index == 0 = link_to ar_object.send(column.field_name), "/cm_admin/#{ar_object.model_name.collection}/#{ar_object.id}" - else = show_field_value(ar_object, column) - if column.field_type == :drawer = render partial: column.drawer_partial, locals: { ar_object: ar_object} - edit_action = @model.available_actions.select{|act| act if act.action_type.eql?(:default) && act.name.eql?('edit')} - custom_actions = @model.available_actions.select{|act| act if act.route_type == 'member' && [:button, :modal].include?(act.display_type)} - if custom_actions.any? || edit_action.any? td.row-action-cell .row-action-tool button.secondary-btn.tool-btn type="button" span i.fa.fa-bars.bolder span i.fa.fa-angle-down .popup-card.table-export-popup.hidden - if edit_action.any? && policy([:cm_admin, @model.name.classify.constantize]).edit? = link_to "#{page_url('edit', ar_object)}" do .popup-option Edit - custom_actions.each do |custom_action| - if custom_action.name.present? && has_valid_policy(@model.name, custom_action.name) - if custom_action.display_if.call(ar_object) = link_to custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb do .popup-option = custom_action.name.titleize .cm-pagination .cm-pagination__lhs Showing #{@ar_object.pagy.from} to #{@ar_object.pagy.to} out of #{@ar_object.pagy.count} .cm-pagination__rhs == render partial: 'cm_admin/main/cm_pagy_nav', locals: { pagy: @ar_object.pagy }