Sha256: 87d673566b37eb0bfa2836c85afbb076c728c9ccfc5295203615521477c2b2ed

Contents?: true

Size: 1.33 KB

Versions: 7

Compression:

Stored size: 1.33 KB

Contents

# frozen_string_literal: true

module Katalyst
  module Navigation
    module EditorHelper
      def navigation_editor_new_items(menu)
        [
          Link.new(menu: menu),
          Button.new(menu: menu),
        ]
      end

      def navigation_editor_menu(menu:, **options, &block)
        Editor::Menu.new(self, menu).build(options, &block)
      end

      def navigation_editor_list(menu:, items: menu.draft_items, **options)
        Editor::List.new(self, menu).build(options) do |list|
          list.items(*items) if items.present?
        end
      end

      # Generate items without their list wrapper, similar to form_with/fields
      def navigation_editor_items(item:, menu: item.menu)
        Editor::List.new(self, menu).items(item)
      end

      # Gene
      def navigation_editor_new_item(item:, menu: item.menu, **options, &block)
        Editor::NewItem.new(self, menu).build(item, **options, &block)
      end

      def navigation_editor_item(item:, menu: item.menu, **options, &block)
        Editor::Item.new(self, menu).build(item, **options, &block)
      end

      def navigation_editor_item_fields(item:, menu: item.menu)
        Editor::Item.new(self, menu).fields(item)
      end

      def navigation_editor_status_bar(menu:, **options)
        Editor::StatusBar.new(self, menu).build(**options)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katalyst-navigation-1.1.2 app/helpers/katalyst/navigation/editor_helper.rb
katalyst-navigation-1.1.1 app/helpers/katalyst/navigation/editor_helper.rb
katalyst-navigation-1.1.0 app/helpers/katalyst/navigation/editor_helper.rb
katalyst-navigation-1.0.3 app/helpers/katalyst/navigation/editor_helper.rb
katalyst-navigation-1.0.2 app/helpers/katalyst/navigation/editor_helper.rb
katalyst-navigation-1.0.1 app/helpers/katalyst/navigation/editor_helper.rb
katalyst-navigation-1.0.0 app/helpers/katalyst/navigation/editor_helper.rb