Sha256: 18167af9a69556f480f1c4d6430c300a6e0d198f4d66c0b6dfb40daec9d0a272

Contents?: true

Size: 610 Bytes

Versions: 15

Compression:

Stored size: 610 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: request.host, scope: 'locomotive.errors.no_site.message')
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
locomotivecms-3.3.0.rc2 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.1.2 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.2.1 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.3.0.rc1 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.2.0 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.2.0.rc2 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.2.0.rc1 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.1.1 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.1.0 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.1.0.rc3 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.1.0.rc2 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.1.0.rc1 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.0.1 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.0.0 app/helpers/locomotive/errors_helper.rb
locomotivecms-3.0.0.rc7 app/helpers/locomotive/errors_helper.rb