Sha256: f500b0cbf922c99adb0944295282d0bb1f6b80ec6bed21a39bb3c03417bd90e5

Contents?: true

Size: 1.21 KB

Versions: 7

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

module Tramway
  module Landing
    module ApplicationHelper
      include Tramway::Admin::RussianCasesHelper
      include Tramway::Profiles::LinksHelper if defined?(::Tramway::Profiles)

      def actual_forms(forms)
        forms = forms.reject { |f| f.form_name == 'user_sign_up' } if @signed_in
        forms = forms.reject { |f| f.form_name == 'user_sign_in' } if @signed_in
        forms
      end

      def block_title(block)
        if block.is_a? Array
          block.each do |current_block|
            current_block.page.title
          end
        else
          if block.page.page_type.main?
            content_for?(:application_name) && content_for(:application_name).present? ? content_for(:application_name) : @application.public_name
          end
        end
      end

      def block_tagline(block)
        unless block.is_a? Array
          if block.page.page_type.main?
            content_for?(:application_tagline) && content_for(:application_tagline).present? ? content_for(:application_tagline) : @application.tagline
          else
            block.each do |_current_block|
              raw block.page.body
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tramway-landing-3.1.1.10 app/helpers/tramway/landing/application_helper.rb
tramway-landing-3.1.1.9 app/helpers/tramway/landing/application_helper.rb
tramway-landing-3.1.1.8 app/helpers/tramway/landing/application_helper.rb
tramway-landing-3.1.1.7 app/helpers/tramway/landing/application_helper.rb
tramway-landing-3.1.1.6 app/helpers/tramway/landing/application_helper.rb
tramway-landing-3.1.1.5 app/helpers/tramway/landing/application_helper.rb
tramway-landing-3.1.1.4 app/helpers/tramway/landing/application_helper.rb