Sha256: bb0ca787f99fd59df114a588de3b2547a862468574d7bd865ebd19734b55ef44

Contents?: true

Size: 613 Bytes

Versions: 17

Compression:

Stored size: 613 Bytes

Contents

module Locomotive
  module ErrorsHelper

    def error_title
      @title || t(:title, scope: "locomotive.errors.#{action_name.gsub('error_', '')}")
    end

    def no_site_message_and_link
      options = Locomotive.config.host ? { host: Locomotive.config.host } : { only_path: true }

      if current_locomotive_account
        [no_site_message(:add_domain), sites_url(options)]
      else
        [no_site_message(:sign_in), sign_in_url(options)]
      end
    end

    def no_site_message(error_type)
      t(error_type, host: h(request.host), scope: 'locomotive.errors.no_site.message')
    end

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.2.0.alpha1 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.1.1 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.1.0 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.1.0.rc1 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.0.3 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.0.2 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.0.1 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.0.0 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.0.0.rc0 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.0.0.alpha3 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.4.1 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.0.0.alpha2 app/helpers/locomotive/errors_helper.rb
locomotivecms-4.0.0.alpha1 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.4.0 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.3.0 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.3.0.rc3 app/helpers/locomotive/errors_helper.rb