Sha256: 2ed0dbb89be90c9a782f47cfca24cdb6fedb5bb3e7675340c7caeafae4453019

Contents?: true

Size: 810 Bytes

Versions: 3

Compression:

Stored size: 810 Bytes

Contents

module Workarea
  module Admin::ChangesetsHelper
    def changeset_icon(changeset, options = {})
      type = changeset.root.model_name.element
      inline_svg(
        releasable_icon_path(type),
        options.reverse_merge(fallback: default_releasable_icon_path)
      )
    end

    def releaseable_icon(model, options = {})
      type = model.model_name.element
      inline_svg(
        releasable_icon_path(type),
        options.reverse_merge(fallback: default_releasable_icon_path)
      )
    end

    def releasable_icon_path(type)
      return default_releasable_icon_path unless type.present?

      Workarea.config.releasable_icons[type.to_sym] ||
      "workarea/admin/icons/#{type}.svg"
    end

    def default_releasable_icon_path
      'workarea/admin/icons/release.svg'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 app/helpers/workarea/admin/changesets_helper.rb
workarea-admin-3.5.26 app/helpers/workarea/admin/changesets_helper.rb
workarea-admin-3.5.25 app/helpers/workarea/admin/changesets_helper.rb