Ticket #1872: tidy_diary_coordinates.2.patch

File tidy_diary_coordinates.2.patch, 2.8 KB (added by Dan Karran, 11 years ago)
  • edit.rhtml

     
    1616      <td class="fieldName">Location:</td>
    1717      <td>
    1818        <div id="map" style="border: 1px solid black; position: relative; width : 90%; height : 400px; display: none;"></div>
    19         <span class="location">Latitude: <%= f.text_field :latitude, :size => 20, :id => "latitude" %> Longitude: <%= f.text_field :longitude, :size => 20, :id => "longitude" %></span>
     19        <span class="location">Latitude: <%= f.text_field :latitude, :size => 8, :id => "latitude" %> Longitude: <%= f.text_field :longitude, :size => 8, :id => "longitude" %></span>
    2020        <a href="javascript:openMap()" id="usemap">use map</a>
    2121        <br/><br/>
    2222      </td>
     
    6565
    6666    var lonlat = getEventPosition(e);
    6767
    68     document.getElementById('latitude').value = lonlat.lat;
    69     document.getElementById('longitude').value = lonlat.lon;
     68    document.getElementById('latitude').value = lonlat.lat.toFixed(5);
     69    document.getElementById('longitude').value = lonlat.lon.toFixed(5);
    7070
    7171    if (marker) {
    7272      removeMarkerFromMap(marker);
  • _diary_entry.rhtml

     
    11<b><%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %></b><br />
    22<%= htmlize(diary_entry.body) %>
    33<% if diary_entry.latitude and diary_entry.longitude %>
    4 Coordinates: <div class="geo" style="display: inline"><span class="latitude"><%= diary_entry.latitude %></span>; <span class="longitude"><%= diary_entry.longitude %></span></div> (<%=link_to 'map', :controller => 'site', :action => 'index', :lat => diary_entry.latitude, :lon => diary_entry.longitude, :zoom => 14 %> / <%=link_to 'edit', :controller => 'site', :action => 'edit', :lat => diary_entry.latitude, :lon => diary_entry.longitude, :zoom => 14 %>)<br/>
     4Coordinates: <div class="geo" style="display: inline"><span class="latitude"><%= number_with_precision(diary_entry.latitude, 4) %></span>; <span class="longitude"><%= number_with_precision(diary_entry.longitude, 4) %></span></div> (<%=link_to 'map', :controller => 'site', :action => 'index', :lat => diary_entry.latitude, :lon => diary_entry.longitude, :zoom => 14 %> / <%=link_to 'edit', :controller => 'site', :action => 'edit', :lat => diary_entry.latitude, :lon => diary_entry.longitude, :zoom => 14 %>)<br/>
    55<% end %>
    66Posted by <b><%= link_to h(diary_entry.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name %></b> at <%= diary_entry.created_at %>
    77<% if params[:action] == 'list' %>