Class: Decidim::NavigationMaps::ContentBlocks::NavigationMapCell

Inherits:
ViewModel
  • Object
show all
Includes:
NavigationMapCellHelpers, SanitizeHelper
Defined in:
app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb

Direct Known Subclasses

GroupsNavigationMapCell

Instance Method Summary collapse

Methods included from NavigationMapCellHelpers

#blueprints, #valid_blueprints, #valid_blueprints?

Instance Method Details

#class_tag(class_string) ⇒ Object



40
41
42
43
44
# File 'app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb', line 40

def class_tag(class_string)
  return if class_string.blank?

  " class=\"#{class_string}\""
end

#image_path(image, options = {}) ⇒ Object



46
47
48
49
# File 'app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb', line 46

def image_path(image, options = {})
  options.merge!({ only_path: true })
  Rails.application.routes.url_helpers.rails_blob_url(image, options)
end

#row_classesObject



36
37
38
# File 'app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb', line 36

def row_classes
  "row column text-center"
end

#section_classesObject



28
29
30
# File 'app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb', line 28

def section_classes
  "extended home-section"
end

#showObject



14
15
16
# File 'app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb', line 14

def show
  render if valid_blueprints?
end

#tabsObject



18
19
20
21
22
# File 'app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb', line 18

def tabs
  return if model.settings.autohide_tabs? && valid_blueprints.count < 2

  render partial: "tabs", locals: { tabs: valid_blueprints }
end

#translated_titleObject



24
25
26
# File 'app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb', line 24

def translated_title
  translated_attribute(model.settings.title)
end

#wrapper_classesObject



32
33
34
# File 'app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb', line 32

def wrapper_classes
  "wrapper-home"
end