- <span id="greeting">
- <% if @user %>
- Welcome, <%= @user.email %> /
- <%= link_to 'Logout', {:controller => 'user', :action => 'logout'}, {:id => 'loginanchor'}%>
- <% else %>
- <%= link_to 'Login', {:controller => 'user', :action => 'login'}, {:id => 'loginanchor'}%> /
- <%= link_to 'Sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %>
- <% 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>
+ <span id="greeting">
+ <% if @user and @user.id %>
+ Welcome, <%= link_to @user.display_name, {:controller => 'user', :action => 'view', :display_name => @user.display_name}%> |
+ <% @inbox_weight = 'bold' if @user.new_messages.size > 0 %>
+ <%= yield :greeting %>
+ <%= link_to "inbox (#{@user.new_messages.size})", {:controller => 'message', :action => 'inbox', :display_name => @user.display_name}, {:style => "font-weight: #{@inbox_weight};" } %> |
+ <%= link_to 'logout', {:controller => 'user', :action => 'logout', :referer => request.request_uri}, {:id => 'logoutanchor'}%>