Sha256: d303e39cd36ba66d1a033cdda85bb92420b964d40e6eee893069dc397e89b945

Contents?: true

Size: 1.36 KB

Versions: 3

Compression:

Stored size: 1.36 KB

Contents

# frozen_string_literal: true

require_dependency "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 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

3 entries across 3 versions & 1 rubygems

Version Path
decidim-generators-0.11.2 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.11.1 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb
decidim-generators-0.11.0.pre1 lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb