Sha256: c4811c0885f3b6fb46a95a0da4568169c28ceceed947567e085095eb95513608

Contents?: true

Size: 865 Bytes

Versions: 5

Compression:

Stored size: 865 Bytes

Contents

require 'active_admin/views/components/action_list_popover'

module ActiveAdmin
  module BatchActions
    # Build an BatchActionPopover
    class BatchActionPopover < ActiveAdmin::Views::ActionListPopover
      builder_method :batch_action_popover

      def build(options = {}, &block)
        options[:id] ||= "batch_actions_popover"
        super(options)
      end

      def action(batch_action, options = {})
        options[:class] ||= []
        options[:class] += %w(batch_action)
        options.merge! "data-action" => batch_action.sym,
                       "data-confirm" => batch_action.confirm

        title = I18n.t("active_admin.batch_actions.labels.#{batch_action.sym}", default: batch_action.title)
        label = I18n.t("active_admin.batch_actions.action_label", title: title)

        super(label, "#", options)
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
active_administration-0.0.3 lib/active_admin/batch_actions/views/batch_action_popover.rb
activeadministration-0.0.2 lib/active_admin/batch_actions/views/batch_action_popover.rb
active_administration-0.0.2 lib/active_admin/batch_actions/views/batch_action_popover.rb
activeadministration-0.0.1 lib/active_admin/batch_actions/views/batch_action_popover.rb
active_administration-0.0.1 lib/active_admin/batch_actions/views/batch_action_popover.rb