Sha256: 6bebcc86d00b612396d4e9764b3adf4f234b171e033bd44fd0d733d76487adfa

Contents?: true

Size: 990 Bytes

Versions: 2

Compression:

Stored size: 990 Bytes

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.page.page_type.main?
          content_for?(:application_name) && yield(:application_name).present? ? yield(:application_name) : @application.public_name
        else
          block.page.title
        end
      end

      def block_tagline(block)
        if block.page.page_type.main?
          content_for?(:application_tagline) && yield(:application_tagline).present? ? yield(:application_tagline) : @application.tagline
        else
          raw block.page.body
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tramway-landing-3.1.1 app/helpers/tramway/landing/application_helper.rb
tramway-landing-3.1.0.6 app/helpers/tramway/landing/application_helper.rb