Only put the 'home' link in the top left on the map and edit pages, and

make it update position in place rather than reloading the page.
This commit is contained in:
Tom Hughes 2007-08-24 17:43:15 +00:00
parent 034982a12f
commit 6cd8db7bff
3 changed files with 11 additions and 3 deletions

View file

@ -21,9 +21,7 @@
<% 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 %>
<% if !@user.home_lon.nil? and !@user.home_lat.nil? %>
<%= link_to 'home', {:controller => 'site', :action => 'index', :lon => @user.home_lon, :lat => @user.home_lat, :zoom => '10'} %> |
<% end %>
<%= 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'}%>
<% else %>

View file

@ -3,6 +3,12 @@
essential database maintenance work is carried out.
</p>
<% else %>
<% content_for :greeting do %>
<% if !@user.home_lon.nil? and !@user.home_lat.nil? %>
<%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> |
<% end %>
<% end %>
<%= render :partial => 'search', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
<% session[:token] = @user.tokens.create.token unless session[:token] %>

View file

@ -1,3 +1,7 @@
<% content_for :greeting do %>
<%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> |
<% end %>
<% content_for :left_menu do %>
<%= link_to "Map key", "http://wiki.openstreetmap.org/index.php/Map_Key" %>
<% end %>