.table-top p.table-top__total-count = "#{humanized_ar_collection_count(@ar_object.pagy.count, @model.formatted_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("cm_index_#{@model.name.underscore}_path")}?page=#{params[:page] || 1}" i.fa.fa-table a.btn.btn-ghost href="#{cm_admin.send("cm_index_#{@model.name.underscore}_path")}?page=#{params[:page] || 1}&view_type=card" i.fa.fa-table-cells - if @model.sort_columns.present? = render 'cm_admin/main/sort', model: @model, ar_object: @ar_object - if flash[:bulk_action_success].present? .alert.alert-success.me-4 role="success" = flash[:bulk_action_success].html_safe - if flash[:bulk_action_error].present? .alert.alert-danger.me-4 role="alert" = flash[:bulk_action_error].html_safe - bulk_actions = actions_filter(@model, @ar_object, :bulk_action) - if bulk_actions.present? .table-top.hidden data-section="bulk-action" = bulk_action_items(bulk_actions, '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("cm_show_#{ar_object.model_name.singular}_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 } = column_pop_up(@model) = manage_column_pop_up(@model)