<div id='site_bar'>
  <div id='site_bar_content' class='clearfix'>
    <div id='editor_switch'>
      <% if admin? %>
        <%= link_to "Switch to live view", "/" %>
      <% else %>
        <%= link_to "Switch to editor view", admin_root_url %>
      <% end %>
    </div>
    <div id='site_bar_branding'>
      <%= RefinerySetting[:site_name] %>
      <%= link_to image_tag("#{"http://refinerycms.com/images/" unless local_request?}refinery/logo-tiny.png",
                    :alt => "Refinery (tm) Content Manager"), "http://refinerycms.com",
                    :target => "_blank" %>
    </div>
  </div>
</div>
<%= stylesheet_link_tag('refinery/site_bar') %>
<div id='site_bar'>
  <div id='site_bar_content' class='clearfix'>
    <div id='editor_switch'>
      <% if admin? %>
        <%= 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", (request.request_uri.to_s == "/") ? admin_root_url : "/admin" + request.request_uri.to_s + "/edit" %>
      <% end %>
    </div>
    <div id='site_bar_branding'>
      <%= RefinerySetting[:site_name] %>
      <%= link_to image_tag("#{"http://refinerycms.com/images/" unless local_request?}refinery/logo-tiny.png",
                    :alt => "Refinery (tm) Content Manager"), "http://refinerycms.com",
                    :target => "_blank" %>
    </div>
  </div>
</div>
<%= stylesheet_link_tag('refinery/site_bar') %>

Switch back and forth on same page (not thoroughly tested)
Switch back and forth on same page (not thoroughly tested)
