]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/user/account.rhtml
Improve handling of login/logout some more to improve the chances of
[rails.git] / app / views / user / account.rhtml
index f4af984e92c99bccd01c2e1f3e46dde137d22ce3..eafa2d5f4aab47116652e80357d7bdde19d8810b 100644 (file)
@@ -1,6 +1,6 @@
 <h2>User details</h2>
 <%= error_messages_for 'user' %>
-<%= start_form_tag :controller => 'user', :action => 'edit', :display_name => @user.display_name %>
+<% form_tag :controller => 'user', :action => 'edit', :display_name => @user.display_name do %>
 <table style="width : 100%">
   <tr><td>Name</td><td><%= @user.email %></td></tr>
   <tr><td>Mapper since</td><td><%= @user.creation_time %> (<%= time_ago_in_words(@user.creation_time) %> ago)</td></tr>
@@ -18,7 +18,7 @@
   <tr><td valign="top">Description</td><td><%= text_area :user, :description, :value => @user.description, :class => "editDescription" %></td></tr>
 </table>
 <%= submit_tag 'Save Changes' %>
-<%= end_form_tag %>
+<% end %>
 
 <% nearest_str = "" %>
 <% if @user.home_lat and @user.home_lon %>
@@ -35,7 +35,7 @@
     <th>Contact</th>
     </tr>
     <% @user.nearby(1,1).each do |nearby| %>
-    <% nearest_str = "nearest.push( { 'display_name' : '#{nearby.display_name}', 'home_lat' : #{nearby.home_lat}, 'home_lon' : #{nearby.home_lon} } )" %>
+    <% nearest_str += "nearest.push( { 'display_name' : '#{nearby.display_name}', 'home_lat' : #{nearby.home_lat}, 'home_lon' : #{nearby.home_lon} } );\n" %>
 
     <tr>
     <td><%= link_to nearby.display_name, :controller => 'user', :action => 'view',  :display_name => nearby.display_name %></td>
@@ -99,7 +99,6 @@
   <!--
   var map, layer, markers, marker, popup;
 
-
   function mercator2lonlat( merc ) {
     var lon_deg = (merc.lon / 20037508.34) * 180;
     var lat_deg = (merc.lat / 20037508.34) * 180;
     near_icon.url = OpenLayers.Util.getImagesLocation() + "marker-green.png";;
     var i = nearest.length;
     while( i-- ) {
-        var nearmarker = new OpenLayers.Marker( lonlat2mercator( new OpenLayers.LonLat( nearest[i].home_lon, nearest[i].home_lat ) ), near_icon );
+        var nearmarker = new OpenLayers.Marker( lonlat2mercator( new OpenLayers.LonLat( nearest[i].home_lon, nearest[i].home_lat ) ), near_icon.clone() );
         markers.addMarker( nearmarker );
         nearmarker.events.register("click", "nearmarker", makeMarkerFunction( i ) );
     }
@@ -214,7 +213,7 @@ window.onload = init;
 <% else %>
   Currently your edits are anonymous and people can't find out where you are located. To show what you edited and allow people to contact you through the website, click the button below. This action cannot be reversed.
   <br /><br />
-  <%= start_form_tag :controller => 'user', :action => 'go_public'%>
+  <% form_tag :controller => 'user', :action => 'go_public' do %>
   <%= submit_tag 'Make all my edits public, forever' %>
-  <%= end_form_tag %>
+  <% end %>
 <% end %>