Module: Decidim::Proposals::CollaborativeDraftCellsHelper

Includes:
ApplicationHelper, CardHelper, LayoutHelper, ApplicationHelper, ResourceReferenceHelper, TranslatableAttributes, TranslationsHelper
Included in:
CollaborativeDraftCell, CollaborativeDraftMCell
Defined in:
decidim-proposals/app/helpers/decidim/proposals/collaborative_draft_cells_helper.rb

Overview

Custom helpers, scoped to the proposals engine.

Instance Method Summary collapse

Methods included from CardHelper

#card_for

Methods included from TranslatableAttributes

#default_locale?

Methods included from TranslationsHelper

empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?

Instance Method Details

#badge_nameObject


39
40
41
# File 'decidim-proposals/app/helpers/decidim/proposals/collaborative_draft_cells_helper.rb', line 39

def badge_name
  humanize_collaborative_draft_state state
end

#component_settingsObject


27
28
29
# File 'decidim-proposals/app/helpers/decidim/proposals/collaborative_draft_cells_helper.rb', line 27

def component_settings
  model.component.settings
end

#current_componentObject


31
32
33
# File 'decidim-proposals/app/helpers/decidim/proposals/collaborative_draft_cells_helper.rb', line 31

def current_component
  model.component
end

#current_settingsObject


23
24
25
# File 'decidim-proposals/app/helpers/decidim/proposals/collaborative_draft_cells_helper.rb', line 23

def current_settings
  model.component.current_settings
end

#from_contextObject


35
36
37
# File 'decidim-proposals/app/helpers/decidim/proposals/collaborative_draft_cells_helper.rb', line 35

def from_context
  @options[:from]
end

#has_actions?Boolean

Returns:

  • (Boolean)

19
20
21
# File 'decidim-proposals/app/helpers/decidim/proposals/collaborative_draft_cells_helper.rb', line 19

def has_actions?
  false
end

#state_classesObject


43
44
45
# File 'decidim-proposals/app/helpers/decidim/proposals/collaborative_draft_cells_helper.rb', line 43

def state_classes
  [collaborative_draft_state_badge_css_class(state).to_s]
end