Class: Decidim::ParticipatoryProcessGroups::ContentBlocks::TitleCell

Inherits:
ViewModel
  • Object
show all
Includes:
IconHelper, SanitizeHelper
Defined in:
app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb

Instance Method Summary collapse

Instance Method Details

#decidim_participatory_processesObject



40
41
42
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 40

def decidim_participatory_processes
  Decidim::ParticipatoryProcesses::Engine.routes.url_helpers
end

#group_url_textObject



36
37
38
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 36

def group_url_text
  group_uri.host + group_uri.path
end

#has_group_url?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 24

def has_group_url?
  group_url.present?
end

#has_hashtag?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 20

def has_hashtag?
  hashtag_text.present?
end

#has_meta_scope?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 32

def has_meta_scope?
  meta_scope.present?
end

#hashtag_textObject



16
17
18
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 16

def hashtag_text
  @hashtag_text ||= decidim_html_escape(participatory_process_group.hashtag || "")
end

#meta_scopeObject



28
29
30
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 28

def meta_scope
  @meta_scope ||= translated_attribute(participatory_process_group.meta_scope)
end

#participatory_process_groupObject



12
13
14
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 12

def participatory_process_group
  @participatory_process_group ||= Decidim::ParticipatoryProcessGroup.find(model.scoped_resource_id)
end

#participatory_processes_countObject



44
45
46
# File 'app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb', line 44

def participatory_processes_count
  @participatory_processes_count ||= participatory_process_group.participatory_processes.count
end