Sha256: b28de8c0d87cbdcb2fa6873a99904487e6154326c6a50c300e49a181c77f43cd
Contents?: true
Size: 1.43 KB
Versions: 7
Compression:
Stored size: 1.43 KB
Contents
# frozen_string_literal: true module Decidim module Plans # Custom helpers, scoped to the plans engine. # module PlanCellsHelper include Decidim::Plans::ApplicationHelper include Decidim::Plans::Engine.routes.url_helpers include Decidim::LayoutHelper include Decidim::ApplicationHelper include Decidim::TranslationsHelper include Decidim::ResourceReferenceHelper include Decidim::TranslatableAttributes include Decidim::CardHelper delegate :title, :state, :closed?, :answered?, :withdrawn?, to: :model def has_actions? false end def plans_controller? context[:controller].class.to_s == "Decidim::Plans::PlansController" end def index_action? context[:controller].action_name == "index" end def current_settings model.component.current_settings end def component_settings model.component.settings end def current_component model.component end def from_context @options[:from] end def badge_name humanize_plan_state state end def state_classes case state when "accepted" ["success"] when "rejected" ["alert"] when "evaluating" ["warning"] when "withdrawn" ["alert"] else ["muted"] end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems