edit_location.rhtml 1.48 KB
<h1><%= _('Location') %></h1>

<% form_for :profile_data, :url => {:action => 'edit_location'} do |f| %>

  <div id='location-fields'>
    <%= optional_field(profile, 'country', select_country(_('Country'), 'profile_data', 'country', {:class => 'type-select'})) %>
    <%= optional_field(profile, 'state', labelled_form_field(_('State'), f.text_field(:state))) %>
    <%= optional_field(profile, 'city', labelled_form_field(_('City'), f.text_field(:city))) %>
    <%= optional_field(profile, 'zip_code', labelled_form_field(_('ZIP code'), text_field(:profile_data, :zip_code))) %>
    <%= optional_field(profile, 'address', labelled_form_field(_('Address (street and number)'), text_field(:profile_data, :address))) %>
    <% button_bar do %>
      <%= button_to_function :search, _('Locate in the map'), "getAddress(null, getAddressData())", :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>


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

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



  <% button_bar do %>
    <%= submit_button 'save', _('Save') %>
    <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
  <% end %>

<% end %>

<%= render :partial => 'google_map'%>