Sha256: 085776ce9effa637f6ce236a93643cab74f594bb5bb46d65f38292255c0a8b9a

Contents?: true

Size: 826 Bytes

Versions: 5

Compression:

Stored size: 826 Bytes

Contents

module Refinery
  module Helpers
    module SiteBarHelper

      # Generates the link to determine where the site bar switch button returns to.
      def site_bar_switch_link
        link_to_if(admin?, t('.switch_to_your_website'),
                  (if session.keys.include?(:website_return_to) and session[:website_return_to].present?
                    session[:website_return_to]
                   else
                    root_path
                   end)) do
          link_to t('.switch_to_your_website_editor'),
                  (if session.keys.include?(:refinery_return_to) and session[:refinery_return_to].present?
                    session[:refinery_return_to]
                   else
                    admin_root_path
                   end rescue admin_root_path)
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
refinerycms-core-0.9.9.4 lib/refinery/helpers/site_bar_helper.rb
refinerycms-core-0.9.9.3 lib/refinery/helpers/site_bar_helper.rb
refinerycms-core-0.9.9.2 lib/refinery/helpers/site_bar_helper.rb
refinerycms-core-0.9.9.1 lib/refinery/helpers/site_bar_helper.rb
refinerycms-0.9.9 core/lib/refinery/helpers/site_bar_helper.rb