.table-top p.table-top__total-count = "#{humanized_ar_collection_count(@ar_object.pagy.count, @model.ar_model.table_name)}" .table-top__column-action - if @current_action.view_type == :card_view .btn-group[role="group" aria-label="Card Toggle"] a.btn.btn-ghost href="#{cm_admin.send("#{@model.name.underscore}_index_path")}?page=#{params[:page] || 1}" i.fa.fa-table a.btn.btn-ghost href="#{cm_admin.send("#{@model.name.underscore}_index_path")}?page=#{params[:page] || 1}&view_type=card" i.fa.fa-table-cells / 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 - if flash[:alert].present? .alert.alert-danger.me-4 role="alert" = flash[:alert].html_safe - elsif flash[:notice].present? .alert.alert-success.me-4 = flash[:notice].html_safe - bulk_actions = actions_filter(@model, @ar_object, :bulk_action) - if bulk_actions.present? .table-top.hidden data-section="bulk-action" - bulk_actions.each do |action| = custom_action_items(action, 'index') .table-wrapper table.index-table data-bulk-actions=(bulk_actions.present? && "present") thead tr - if bulk_actions.present? th.check-box-space input.form-check-input type="checkbox" data-behaviour="bulk-action-select-all" - @model.available_fields[:index].each do |column| - if column.display_if.call(Current.user) && column.viewable th data-field-type="#{column.field_type}" = column.header th data-field-type='action-cell-th' tbody - @ar_object.data.each do |ar_object| tr.body-row - if bulk_actions.present? td.check-box-space input.form-check-input type="checkbox" data-behaviour="bulk-action-checkbox" data-ar-object-id="#{ar_object.id}" - @model.available_fields[:index].each_with_index do |column, index| - if column.display_if.call(Current.user) && column.viewable td.text-ellipsis data-field-type="#{column.field_type || 'string'}" - if index == 0 && is_show_action_available(@model, ar_object) && !([:link, :custom, :attachment, :drawer, :image].include?(column.field_type)) = link_to ar_object.send(column.field_name), cm_admin.send("#{ar_object.model_name.singular}_show_path", ar_object) - else = show_field_value(ar_object, column) - if column.field_type == :drawer = render partial: column.drawer_partial, locals: { ar_object: ar_object } - if @model == render partial: 'cm_admin/main/actions_dropdown', locals: { cm_model: @model, ar_object: ar_object } .pagination-bar p.count-text.m-0 Showing #{@ar_object.pagy.from} to #{@ar_object.pagy.to} out of #{@ar_object.pagy.count} == render partial: 'cm_admin/main/cm_pagy_nav', locals: { pagy: @ar_object.pagy } / = render partial: 'cm_admin/main/member_custom_action_modal', locals: { cm_model: @model, ar_collection: @ar_object }