Sha256: fad850df3e7a710514076a84b6a0199d10954e78f78b1cad5f0f407817813db4

Contents?: true

Size: 710 Bytes

Versions: 26

Compression:

Stored size: 710 Bytes

Contents

module Spina
  module PagesHelper

    def content(part_name = nil)
      Current.page.content(part_name)
    end

    def has_content?(part_name)
      Current.page.has_content?(part_name)
    end

    def repeater(part)
      part = Current.page.find_part(part)&.content unless part.is_a? Array
      part&.each do |repeater_content|
        repeater_content.view_context = self
        yield(repeater_content)
      end
    end

    def images(part)
      part = Current.page.find_part(part)&.content unless part.is_a? Array
      part&.each do |image|
        yield(image)
      end
    end

    def current_page
      Current.page
    end

    def current_account
      Current.account
    end

  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
spina-2.11.0 app/helpers/spina/pages_helper.rb
spina-2.10.0 app/helpers/spina/pages_helper.rb
spina-2.9.1 app/helpers/spina/pages_helper.rb
spina-2.9.0 app/helpers/spina/pages_helper.rb
spina-2.8.1 app/helpers/spina/pages_helper.rb
spina-2.8.0 app/helpers/spina/pages_helper.rb
spina-2.7.0 app/helpers/spina/pages_helper.rb
spina-2.6.2 app/helpers/spina/pages_helper.rb
spina-2.6.1 app/helpers/spina/pages_helper.rb
spina-2.6.0 app/helpers/spina/pages_helper.rb
spina-2.5.0 app/helpers/spina/pages_helper.rb
spina-2.4.0 app/helpers/spina/pages_helper.rb
spina-2.3.5 app/helpers/spina/pages_helper.rb
spina-2.3.4 app/helpers/spina/pages_helper.rb
spina-2.3.3 app/helpers/spina/pages_helper.rb
spina-2.3.2 app/helpers/spina/pages_helper.rb
spina-2.3.1 app/helpers/spina/pages_helper.rb
spina-2.3.0 app/helpers/spina/pages_helper.rb
spina-2.2.0 app/helpers/spina/pages_helper.rb
spina-2.1.1 app/helpers/spina/pages_helper.rb