Sha256: ce6964b650362a81a81efff5c13678e0ae813c3bd71b4fad9ee15c6a47cdbcec

Contents?: true

Size: 1.33 KB

Versions: 32

Compression:

Stored size: 1.33 KB

Contents

require 'active_admin/component'

module ActiveAdmin
  module BatchActions

    # Creates the toggle checkbox used to toggle the collection selection on/off
    class ResourceSelectionToggleCell < ActiveAdmin::Component
      builder_method :resource_selection_toggle_cell

      def build
        input type: "checkbox", id: "collection_selection_toggle_all", name: "collection_selection_toggle_all", class: "toggle_all"
      end
    end

    # Creates the checkbox used to select a resource in the collection selection
    class ResourceSelectionCell < ActiveAdmin::Component
      builder_method :resource_selection_cell

      def build(resource)
        input type: "checkbox", id: "batch_action_item_#{resource.id}", value: resource.id, class: "collection_selection", name: "collection_selection[]"
      end
    end

    # Creates a wrapper panel for all index pages, except for the table, as the table has the checkbox in the thead
    class ResourceSelectionTogglePanel < ActiveAdmin::Component
      builder_method :resource_selection_toggle_panel

      def build
        super(id: "collection_selection_toggle_panel")
        resource_selection_toggle_cell
        div(id: "collection_selection_toggle_explaination" ) { I18n.t('active_admin.batch_actions.selection_toggle_explanation', default: "(Toggle Selection)") }
      end

    end

  end
end

Version data entries

32 entries across 32 versions & 6 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.17.pre lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.16.pre lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.15.pre lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin-1.0.0 lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin-1.0.0.pre5 lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin-orac-1.0.0.pre4 lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin-orac-1.0.0 lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin-orac-1.0.0.pre.orac lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.14.pre lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.13.pre lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.12.pre lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.11.pre lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.10.pre lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.9.pre lib/active_admin/batch_actions/views/selection_cells.rb
yousty-activeadmin-1.0.8.pre lib/active_admin/batch_actions/views/selection_cells.rb