Sha256: 6a5ce15dc5d4becbc3314ad65d4bf110f43790c58558926c23e1291afd85de13

Contents?: true

Size: 744 Bytes

Versions: 22

Compression:

Stored size: 744 Bytes

Contents

module Spina::Admin
  module PagesHelper
    
    def asset_available?(path)
      if Rails.configuration.assets.compile
        Rails.application.precompiled_assets.include?(path)
      else
        Rails.application.assets_manifest.assets[path].present?
      end
    end

    def build_parts(partable, parts)
      I18n.with_locale(@locale) do
        parts.map do |part|
          part_attributes = current_theme.parts.find{|p|p[:name].to_s == part.to_s}
          partable.part(part_attributes)
        end
      end
    end

    def parts_partial_namespace(part_type)
      part_type.tableize.sub(/\Aspina\/parts\//, '')
    end

    def option_label(part, value)
      t(['options',part.name,value].compact.join('.'))
    end

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spina-2.1.1 app/helpers/spina/admin/pages_helper.rb
spina-2.1.0 app/helpers/spina/admin/pages_helper.rb