]> projects.mako.cc - selectricity-live/commitdiff
Front page header button can now log in and out.
author<jlsharps@mit.edu> <>
Fri, 31 Aug 2007 14:55:53 +0000 (10:55 -0400)
committer<jlsharps@mit.edu> <>
Fri, 31 Aug 2007 14:55:53 +0000 (10:55 -0400)
app/views/layouts/frontpage.rhtml

index 6531dc47bd9df4819177645ee3ac750d8f4ecb42..de173c280e7560b8229113d4500ac9a89ff87a2d 100644 (file)
 
     <div id="header">
       <div id="top-bar">
 
     <div id="header">
       <div id="top-bar">
-        <a href="/account/login">login</a>
-          &nbsp;&nbsp;&nbsp;<a href="/account/signup">sign up</a>
-          &nbsp;&nbsp;&nbsp;<a href="/site/about">help/about</a>
+       <% if session[:user]%>
+       <%= link_to User.find(session[:user]).login.capitalize,
+                  :controller => "account",
+                  :action => "summary", :id => session[:user][:id] %>
+       &nbsp;&nbsp;<%= link_to( 'Log out', :controller => 'account', 
+                       :action => 'logout' )%>
+       <% else %>
+      <%= link_to("login", :controller => "account", :action => "login")
+      %>
+      &nbsp;&nbsp;<%= link_to("sign up", :controller => "account", 
+                                :action => "signup")%>
+    <% end -%>
+      &nbsp;&nbsp;<%= link_to ("help/about", :controller => "site", 
+                               :action => 'about')%>
       </div>
          <a href="index.html"><h1>selectricity: voting machinery for the masses</h1></a>
     </div>
       </div>
          <a href="index.html"><h1>selectricity: voting machinery for the masses</h1></a>
     </div>

Benjamin Mako Hill || Want to submit a patch?