Module: Decidim::IconHelper

Included in:
ParticipatoryProcessStatsPresenter
Defined in:
decidim-core/app/helpers/decidim/icon_helper.rb

Overview

Helpers related to icons

Instance Method Summary collapse

Instance Method Details

#feature_icon(feature) ⇒ Object

Public: Returns an icon given an instance of a Feature. It defaults to a question mark when no icon is found.

feature - The feature to generate the icon for.

Returns an HTML tag with the icon.



12
13
14
# File 'decidim-core/app/helpers/decidim/icon_helper.rb', line 12

def feature_icon(feature)
  feature_manifest_icon(feature.manifest)
end

#feature_manifest_icon(feature_manifest) ⇒ Object

Public: Returns an icon given an instance of a Feature Manifest. It defaults to a question mark when no icon is found.

feature_manifest - The feature manifest to generate the icon for.

Returns an HTML tag with the icon.



22
23
24
25
26
27
28
# File 'decidim-core/app/helpers/decidim/icon_helper.rb', line 22

def feature_manifest_icon(feature_manifest)
  if feature_manifest.icon
    external_icon feature_manifest.icon
  else
    icon "question-mark"
  end
end