Sha256: 54edd44c435361aaeb07c4e6a1ad04c010f7dae3ab3d8919278434c13ccd217f

Contents?: true

Size: 1.37 KB

Versions: 44

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

require "decidim/components/namer"

Decidim.register_component(:<%= component_name %>) do |component|
  component.engine = Decidim::<%= component_module_name %>::Engine
  component.admin_engine = Decidim::<%= component_module_name %>::AdminEngine
  component.icon = "decidim/<%= component_name %>/icon.svg"

  # component.on(:before_destroy) do |instance|
  #   # Code executed before removing the component
  # end

  # These actions permissions can be configured in the admin panel
  # component.actions = %w()

  # component.settings(:global) do |settings|
  #   # Add your global settings
  #   # Available types: :integer, :boolean
  #   # settings.attribute :vote_limit, type: :integer, default: 0
  # end

  # component.settings(:step) do |settings|
  #   # Add your settings per step
  # end

  # component.register_resource(:some_resource) do |resource|
  #   # Register a optional resource that can be references from other resources.
  #   resource.model_class_name = "Decidim::<%= component_module_name %>::SomeResource"
  #   resource.template = "decidim/<%= component_name %>/some_resources/linked_some_resources"
  # end

  # component.register_stat :some_stat do |context, start_at, end_at|
  #   # Register some stat number to the application
  # end

  # component.seeds do |participatory_space|
  #   # Add some seeds for this component
  # end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
decidim-generators-0.29.1 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.28.4 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.27.9 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.29.0 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.28.3 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.27.8 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.29.0.rc4 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.29.0.rc3 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.29.0.rc2 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.29.0.rc1 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.28.2 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.27.7 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.28.1 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.27.6 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.26.10 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.26.9 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.28.0 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.27.5 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.28.0.rc5 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.28.0.rc4 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb