edit_location.rhtml 1.47 KB
<h1><%= _('Location') %></h1>
<div class="error">
  <%= flash[:error] %>
</div>

<% form_for :profile_data, :url => {:action => 'edit_location'}, :html => {:id => 'location-form'} do |f| %>

  <div id='location-fields'>
    <%= select_country _('Country'), 'profile_data', 'country', {:class => 'type-select'} %>
    <%= labelled_form_field _('State'), f.text_field(:state) %>
    <%= labelled_form_field _('City'), f.text_field(:city) %>
    <%= labelled_form_field _('ZIP code'), text_field(:profile_data, :zip_code) %>
    <%= labelled_form_field _('Address (street and number)'), text_field(:profile_data, :address) %>
    <% button_bar do %>
      <%= button_to_function :search, _('Locate in the map'), "addressToPoint()", :title => _("Locate the address informed above in the map below (note that you'll probably need to adjust the marker to get a precise position)")  %>
      <%= submit_button 'save', _('Save') %>
      <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
    <% end %>
  </div>

  <p><%= _('Drag the balloon to find the exact location.') %> </p>

  <div style='overflow: hidden'>
    <p><div id="location-map"></div></p>
  </div>

  <%= f.hidden_field :lat %>
  <%= f.hidden_field :lng %>

<% end %>

<%= content_tag('script', '', :src => "http://maps.googleapis.com/maps/api/js?sensor=false", :type => 'text/javascript') %>
<%= content_tag('script', '', :src => url_for(:controller => :maps, :action => :google_map), :type => 'text/javascript') %>