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