Sha256: d664b2f1deefdf7b1329d06cf02049d8d8cacbc26f700a4037f8d5c0b33c36f5

Contents?: true

Size: 1.37 KB

Versions: 50

Compression:

Stored size: 1.37 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

50 entries across 50 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.94 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.92 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.90 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.84 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.80 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.79 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.78 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.77 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.74 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.73 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.72 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.71 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.66 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.65 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
activeadmin-0.6.0 lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.64 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.63 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.62 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.61 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb
lalala-4.0.0.dev.60 vendor/deps/active_admin/lib/active_admin/batch_actions/views/selection_cells.rb