Sha256: 5d4ae71d6c96bfa1710577de9b3b3f31899e72ba86eb58ef2541a6b1956e48cc

Contents?: true

Size: 497 Bytes

Versions: 5

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Helpers related to icons
  module IconHelper
    # 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.
    def feature_icon(feature)
      if feature.manifest.icon
        external_icon feature.manifest.icon
      else
        icon "question-mark"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-core-0.4.4 app/helpers/decidim/icon_helper.rb
decidim-core-0.4.2 app/helpers/decidim/icon_helper.rb
decidim-core-0.4.1 app/helpers/decidim/icon_helper.rb
decidim-core-0.4.3 app/helpers/decidim/icon_helper.rb
decidim-core-0.4.0 app/helpers/decidim/icon_helper.rb