Module: Decidim::DecidimAwesome
- Includes:
- ActiveSupport::Configurable
- Defined in:
- lib/decidim/decidim_awesome/version.rb,
lib/decidim/decidim_awesome/admin.rb,
lib/decidim/decidim_awesome/config.rb,
lib/decidim/decidim_awesome/engine.rb,
lib/decidim/decidim_awesome/awesome.rb,
lib/decidim/decidim_awesome/menu_hacker.rb,
lib/decidim/decidim_awesome/admin_engine.rb,
lib/decidim/decidim_awesome/custom_fields.rb,
lib/decidim/decidim_awesome/system_checker.rb,
lib/decidim/decidim_awesome/awesome_helpers.rb,
lib/decidim/decidim_awesome/context_analyzers.rb,
app/helpers/decidim/decidim_awesome/map_helper.rb,
app/models/decidim/decidim_awesome/editor_image.rb,
app/models/decidim/decidim_awesome/user_override.rb,
lib/decidim/decidim_awesome/map_component/engine.rb,
app/forms/decidim/decidim_awesome/admin/menu_form.rb,
app/models/decidim/decidim_awesome/awesome_config.rb,
app/forms/decidim/decidim_awesome/admin/config_form.rb,
app/forms/decidim/decidim_awesome/editor_image_form.rb,
app/permissions/decidim/decidim_awesome/permissions.rb,
lib/decidim/decidim_awesome/iframe_component/engine.rb,
app/models/decidim/decidim_awesome/config_constraint.rb,
app/uploaders/decidim/decidim_awesome/image_uploader.rb,
app/middleware/decidim/decidim_awesome/current_config.rb,
app/models/decidim/decidim_awesome/application_record.rb,
app/forms/decidim/decidim_awesome/admin/intergram_form.rb,
lib/decidim/decidim_awesome/map_component/admin_engine.rb,
app/forms/decidim/decidim_awesome/admin/constraint_form.rb,
app/commands/decidim/decidim_awesome/admin/update_config.rb,
app/commands/decidim/decidim_awesome/create_editor_image.rb,
app/cells/decidim/decidim_awesome/content_blocks/map_cell.rb,
app/permissions/decidim/decidim_awesome/admin/permissions.rb,
lib/decidim/decidim_awesome/iframe_component/admin_engine.rb,
app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb,
app/commands/decidim/decidim_awesome/admin/create_menu_hack.rb,
app/commands/decidim/decidim_awesome/admin/update_menu_hack.rb,
app/commands/decidim/decidim_awesome/admin/create_constraint.rb,
app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb,
app/commands/decidim/decidim_awesome/admin/update_constraint.rb,
app/forms/decidim/decidim_awesome/admin/custom_redirect_form.rb,
app/commands/decidim/decidim_awesome/admin/destroy_constraint.rb,
app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb,
app/cells/decidim/decidim_awesome/content_blocks/map_form_cell.rb,
app/commands/decidim/decidim_awesome/admin/create_scoped_admin.rb,
app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb,
app/controllers/decidim/decidim_awesome/application_controller.rb,
app/helpers/decidim/decidim_awesome/amendments_helper_override.rb,
app/presenters/decidim/decidim_awesome/menu_presenter_override.rb,
lib/decidim/decidim_awesome/context_analyzers/request_analyzer.rb,
app/commands/decidim/decidim_awesome/admin/destroy_scoped_admin.rb,
app/commands/decidim/decidim_awesome/admin/destroy_scoped_style.rb,
app/controllers/decidim/decidim_awesome/admin/checks_controller.rb,
app/controllers/decidim/decidim_awesome/admin/config_controller.rb,
app/controllers/decidim/decidim_awesome/editor_images_controller.rb,
app/helpers/decidim/decidim_awesome/admin/system_checker_helpers.rb,
lib/decidim/decidim_awesome/content_parsers/editor_images_parser.rb,
lib/decidim/decidim_awesome/context_analyzers/component_analyzer.rb,
app/commands/decidim/decidim_awesome/admin/create_custom_redirect.rb,
app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb,
app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb,
app/controllers/decidim/decidim_awesome/blank_component_controller.rb,
app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb,
app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb,
app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb,
app/controllers/decidim/decidim_awesome/admin/application_controller.rb,
app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb,
app/controllers/decidim/decidim_awesome/map_component/map_controller.rb,
app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb,
app/controllers/concerns/decidim/decidim_awesome/needs_awesome_config.rb,
app/controllers/decidim/decidim_awesome/admin/scoped_admins_controller.rb,
app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb,
app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb,
app/commands/decidim/decidim_awesome/admin/destroy_proposal_custom_field.rb,
app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb,
app/helpers/decidim/decidim_awesome/proposals/application_helper_override.rb,
app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb,
lib/decidim/decidim_awesome/context_analyzers/participatory_space_analyzer.rb,
app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb,
app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb,
app/forms/decidim/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb
Overview
add a global helper with awesome configuration
Defined Under Namespace
Modules: Admin, AmendmentsHelperOverride, AwesomeHelpers, ContentBlocks, ContentParsers, ContextAnalyzers, IframeComponent, MapComponent, MapHelper, MenuItemPresenterOverride, MenuPresenterOverride, NeedsAwesomeConfig, NotFoundRedirect, Proposals, SystemChecker, UserOverride Classes: AdminEngine, ApplicationController, ApplicationRecord, AwesomeConfig, BlankComponentController, Config, ConfigConstraint, CreateEditorImage, CurrentConfig, CustomFields, EditorImage, EditorImageForm, EditorImagesController, Engine, ImageUploader, MenuHacker, MigrateLegacyImagesJob, Permissions
Constant Summary collapse
- VERSION =
"0.8.1"- COMPAT_DECIDIM_VERSION =
[">= 0.25.0", "< 0.27"].freeze
Class Method Summary collapse
-
.enabled?(config_vars) ⇒ Boolean
HELPERS.
-
.register_component(manifest, &block) ⇒ Object
Wrapp component registering to register component later, after initializer so we can honor disabled_components config.
- .registered_components ⇒ Object
Class Method Details
.enabled?(config_vars) ⇒ Boolean
HELPERS
pass a single config var or an array of them any non disabled match will return as true
194 195 196 197 198 199 200 201 202 |
# File 'lib/decidim/decidim_awesome/awesome.rb', line 194 def self.enabled?(config_vars) config_vars = [config_vars] unless config_vars.respond_to?(:detect) config_vars.detect do |item| next unless config.has_key?(item.to_sym) config.send(item) != :disabled end end |
.register_component(manifest, &block) ⇒ Object
Wrapp component registering to register component later, after initializer so we can honor disabled_components config
210 211 212 |
# File 'lib/decidim/decidim_awesome/awesome.rb', line 210 def self.register_component(manifest, &block) registered_components << [manifest, block] end |
.registered_components ⇒ Object
204 205 206 |
# File 'lib/decidim/decidim_awesome/awesome.rb', line 204 def self.registered_components @registered_components ||= [] end |