]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/layouts/site.rhtml
edit page plus tabs working
[rails.git] / app / views / layouts / site.rhtml
index aaf4e0324298f56b1079e005e731db30eb8b0dec..75bac67ab97901e38545e862999f404229ca56e5 100644 (file)
 
   <span id="greeting">
     <% if @user %>
 
   <span id="greeting">
     <% if @user %>
-      Welcome, <%= @user.email %> / 
-      <%= link_to 'Logout', {:controller => 'user', :action => 'logout'}, {:id => 'loginanchor'}%>
+      Welcome, <%= @user.display_name %> |
+      <%= link_to 'logout', {:controller => 'user', :action => 'logout'}, {:id => 'loginanchor'}%>
     <% else %>
     <% else %>
-      <%= link_to 'Login', {:controller => 'user', :action => 'login'}, {:id => 'loginanchor'}%> /
-      <%= link_to 'Sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %>
+      <%= link_to 'log in', {:controller => 'user', :action => 'login'}, {:id => 'loginanchor'}%> |
+      <%= link_to 'sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %>
     <% end %>
   </span>
   
   <div>
     <ul id="tabnav">
     <% end %>
   </span>
   
   <div>
     <ul id="tabnav">
-      <!-- FIXME, these links need help -->
-      <% if @user %>
-        <li><%= link_to 'View', {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => 'view maps' } %></li>
-        <li><%= link_to 'Edit', {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => 'edit maps' } %></li>
-        <li><%= link_to 'GPS traces', {:controller => 'trace', :action => 'index'}, {:id => 'traceanchor', :title => 'manage traces' } %></li>
-      <% else %>
-        <li><a id="viewanchor" href="/index.html" title="view maps">View</a></li>
-        <li><a style="font-style:italic" href="/login.html" title="edit maps">Edit</a></li>
-        <li><a href="/traces" title="manage traces">GPS traces</a></li>
-      <% end %>
+        <% viewclass = ''
+           editclass = ''
+           traceclass = ''
+           viewclass = 'active' if params['controller'] == 'site' and params['action'] == 'index' 
+           editclass = 'active' if params['controller'] == 'site' and params['action'] == 'edit' 
+           traceclass = 'active' if params['controller'] == 'trace'
+           %>
+         <li><%= link_to 'View', {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => 'view maps', :class => viewclass  } %></li>
+         <li><%= link_to 'Edit', {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => 'edit maps', :class => editclass } %></li>
+         <li><%= link_to 'GPS traces', {:controller => 'trace', :action => 'list'}, {:id => 'traceanchor', :title => 'manage traces', :class => traceclass } %></li>
     </ul>
   </div>
 
     </ul>
   </div>
 
     <div id="logo">
       <center>
         <h1>OpenStreetMap</h1>
     <div id="logo">
       <center>
         <h1>OpenStreetMap</h1>
-
         <img src="/images/osm_logo.png" width="120" height="120"/><br/>
         <nobr><h2>The Free Wiki World Map</h2></nobr>
       </center>
     </div>
         <img src="/images/osm_logo.png" width="120" height="120"/><br/>
         <nobr><h2>The Free Wiki World Map</h2></nobr>
       </center>
     </div>
-
+    <% unless @user %>
     <div id="intro">
       OpenStreetMap is a free editable map of the whole world. It is made by people like you.
       <p/>
       OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth.
       <p/>
       OpenStreetMap's hosting is kindly supported by the <a href="http://www.vr.ucl.ac.uk">UCL VR Centre</a> and <a href="http://www.bytemark.co.uk">bytemark</a>.
     <div id="intro">
       OpenStreetMap is a free editable map of the whole world. It is made by people like you.
       <p/>
       OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth.
       <p/>
       OpenStreetMap's hosting is kindly supported by the <a href="http://www.vr.ucl.ac.uk">UCL VR Centre</a> and <a href="http://www.bytemark.co.uk">bytemark</a>.
-
     </div>
     </div>
+    <% end %>
 
     <div id="left_menu">
       <a href="http://wiki.openstreetmap.org">Help & Wiki</a><br />
 
     <div id="left_menu">
       <a href="http://wiki.openstreetmap.org">Help & Wiki</a><br />