Sha256: c8b6fc70daf1e98109b73ce6a2e552e8b12161f8f2bb3d697213fd2d9ca03a69

Contents?: true

Size: 677 Bytes

Versions: 17

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true

module Katalyst
  module Content
    module Editor
      class ItemComponent < BaseComponent
        include KpopHelper

        def edit_item_link
          if item.persisted?
            helpers.katalyst_content.edit_item_path(item)
          else
            helpers.katalyst_content.new_item_path(
              item: item.attributes.slice("type", "container_id", "container_type").compact,
            )
          end
        end

        def default_html_attributes
          {
            id:   dom_id(item),
            data: {
              controller: ITEM_CONTROLLER,
            },
          }
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
katalyst-content-2.7.0 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.6.2 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.6.1 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.6.0 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.5.1 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.5.0 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.4.2 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.4.1 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.3.2 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.3.1 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.3.0 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.2.0 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.1.4 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.1.3 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.1.2 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.1.1 app/components/katalyst/content/editor/item_component.rb
katalyst-content-2.1.0 app/components/katalyst/content/editor/item_component.rb