Finished chapter 11
[depot.git] / app / views / layouts / store.html.erb
index e55726c75cec4041ac9d9eb0a20a9578cea51abc..e4845d76207dea4ff6b78016578a527a2bbefaf8 100644 (file)
     </div>
     <div id="columns">
       <div id="side">
-        <% hidden_div_if(@cart.items.empty?, :id => "cart") do %>
-            <%= render(:partial => "cart" , :object => @cart) %>
-        <% end %>
-        <a href="http://www....">Home</a><br />
+        <% if @cart %>
+          <% hidden_div_if(@cart.items.empty?, :id => "cart") do %>
+              <%= render(:partial => "cart" , :object => @cart) %>
+          <% end %>
+        <% end  %>
+        <a href="/">Home</a><br />
         <a href="http://www..../faq">Questions</a><br />
         <a href="http://www..../news">News</a><br />
         <a href="http://www..../contact">Contact</a><br />
+
+        <% if session[:user_id] %>
+          <br />
+          <%= link_to 'Orders',   :controller => 'orders' %><br />
+          <%= link_to 'Products', :controller => 'products' %><br />
+          <%= link_to 'Users',    :controller => 'users' %><br />
+          <br />
+          <%= link_to 'Logout', :controller => 'admin', :action => 'logout' %>
+        <% end %>
+
       </div>
       <div id="main">
         <% if flash[:notice] -%>
             <div id="notice"><%= flash[:notice] %></div>
         <% end -%>
-        
-        <%= yield :layout %>
+        <div id="main_panel">
+          <%= yield :layout %>
+        </div>
       </div>
     </div>
   </body>