Created
March 8, 2012 06:08
-
-
Save robyurkowski/1999090 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generates the link to determine where the site bar switch button returns to. | |
def site_bar_switch_link | |
if admin? ? admin_switch_link : frontend_switch_link | |
end | |
def admin_switch_link | |
link_url = session[:website_return_to].present? ? session[:website_return_to] : | |
refinery.root_path(:locale => (Refinery::I18n.default_frontend_locale if Refinery.i18n_enabled?)) | |
link_to t('.switch_to_your_website', site_bar_translate_locale_args), link_url, {:class => 'btn btn-primary'} | |
end | |
def frontend_switch_link | |
link_url = (session[:refinery_return_to].present? ? session[:refinery_return_to] ? refinery.admin_root_path) rescue refinery.admin_root_path | |
link_to t('.switch_to_your_website_editor', site_bar_translate_locale_args), link_url, {:class => 'btn btn-primary'} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment