Skip to content

Commit

Permalink
Switch back and forth on same page (not thoroughly tested)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Heidel committed May 10, 2010
1 parent d6a644a commit bc8a42f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vendor/plugins/refinery/app/views/shared/_site_bar.html.erb
Expand Up @@ -2,9 +2,9 @@
<div id='site_bar_content' class='clearfix'>
<div id='editor_switch'>
<% if admin? %>
<%= link_to "Switch to live view", "/" %>
<%= link_to "Switch to live view", begin request.request_uri.to_s.match(/\/admin(.*)\/edit/)[1] rescue "/" end %>
<% else %>
<%= link_to "Switch to editor view", admin_root_url %>
<%= link_to "Switch to editor view", (request.request_uri.to_s == "/") ? admin_root_url : "/admin" + request.request_uri.to_s + "/edit" %>
<% end %>
</div>
<div id='site_bar_branding'>
Expand All @@ -15,4 +15,4 @@
</div>
</div>
</div>
<%= stylesheet_link_tag('refinery/site_bar') %>
<%= stylesheet_link_tag('refinery/site_bar') %>

0 comments on commit bc8a42f

Please sign in to comment.