Subject: |
<%= f.text_field :title, :size => 60 %> |
Body: |
<%= f.text_area :body, :cols => 80 %> |
Language: |
<%= f.collection_select :language, Language.find(:all), :code, :name %> |
Location: |
Latitude: <%= f.text_field :latitude, :size => 20, :id => "latitude" %> Longitude: <%= f.text_field :longitude, :size => 20, :id => "longitude" %>
use map
|
|
<%= submit_tag 'Save' %>
<%# TODO: button should say 'publish' or 'save changes' depending on new/edit state %>
|
<% end %>
<% if @user.home_lat.nil? or @user.home_lon.nil? %>
<% lon = h(params['lon'] || '-0.1') %>
<% lat = h(params['lat'] || '51.5') %>
<% zoom = h(params['zoom'] || '4') %>
<% else %>
<% lon = @user.home_lon %>
<% lat = @user.home_lat %>
<% zoom = '12' %>
<% end %>
<%= javascript_include_tag '/openlayers/OpenLayers.js' %>
<%= javascript_include_tag '/openlayers/OpenStreetMap.js' %>
<%= javascript_include_tag 'map.js' %>