download_xml: "Download XML"
view_history: "view history"
edit: "edit"
+ bug:
+ open_title: "Unresolved issue: {{bug_name}}"
+ closed_title: "Resolved issue: {{bug_name}}"
+ created_at: "Created at:"
+ edited_at: "Edited at:"
+ closed_at: "Closed at:"
+ opened_by: "Opened by:"
+ description: "Description:"
+ comment_by: "Comment by: "
+ comment: "Comment:"
+ date: "Date:"
changeset:
changeset_paging_nav:
showing_page: "Showing page {{page}}"
no_auto_account_create: "Unfortunately we are not currently able to create an account for you automatically."
contact_webmaster: 'Please contact the <a href="mailto:webmaster@openstreetmap.org">webmaster</a> to arrange for an account to be created - we will try and deal with the request as quickly as possible.'
fill_form: "Fill in the form and we will send you a quick email to activate your account."
- license_agreement: 'By creating an account, you agree that all data you submit to the Openstreetmap project is to be (non-exclusively) licensed under <a href="http://creativecommons.org/licenses/by-sa/2.0/">this Creative Commons license (by-sa)</a>.'
+ license_agreement: 'When you confirm your account you will need to agree to the <a href="http://www.osmfoundation.org/wiki/License/Contributor_Terms">contributor terms</a>.'
email address: "Email Address:"
confirm email address: "Confirm Email Address:"
not displayed publicly: 'Not displayed publicly (see <a href="http://wiki.openstreetmap.org/wiki/Privacy_Policy" title="wiki privacy policy including section on email addresses">privacy policy</a>)'
display name description: "Your publicly displayed username. You can change this later in the preferences."
password: "Password:"
confirm password: "Confirm Password:"
- signup: Signup
+ continue: Continue
flash create success message: "User was successfully created. Check your email for a confirmation note, and you will be mapping in no time :-)<br /><br />Please note that you will not be able to login until you've received and confirmed your email address.<br /><br />If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests."
+ terms:
+ heading: "Contributor terms"
+ press accept button: "Please read the agreement below and press the agree button to create your account."
+ consider_pd: "I consider my contributions to be in the Public Domain"
+ consider_pd_why: "what's this?"
+ consider_pd_why_url: http://wiki.openstreetmap.org/wiki/Why_would_I_want_my_contributions_to_be_public_domain
+ agree: Agree
+ declined: "http://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined"
+ decline: "Decline"
+ legale_select: "Please select your country of residence:"
+ legale_button: "Go"
+ legale_names:
+ france: "France"
+ italy: "Italy"
+ rest_of_world: "Rest of the world"
no_such_user:
title: "No such user"
heading: "The user {{user}} does not exist"
back: "View all blocks"
revoker: "Revoker:"
needs_view: "The user needs to log in before this block will be cleared."
+ bugs:
+ rss:
+ description_area: "A list of bugs, reported, commented on or closed in your area [({{min_lat}}|{{min_lon}}) -- ({{max_lat}}|{{max_lon}})]"
+ description_item: "An rss feed for bug {{id}}"
+ closed: "closed bug (near {{place}})"
+ new: "new bug (near {{place}})"
+ comment: "new comment (near {{place}})"
+ user:
+ title_user: "Bugs submitted or commented on by {{user}}"
+ heading_user: "{{user}}'s bugs"
+ description_user: "Bugs submitted or commented on by {{user}}"
+ id: "Id"
+ last_changed: "Last changed"
+
javascripts:
map:
base:
map.connect "api/#{API_VERSION}/amf/read", :controller =>'amf', :action =>'amf_read'
map.connect "api/#{API_VERSION}/amf/write", :controller =>'amf', :action =>'amf_write'
map.connect "api/#{API_VERSION}/swf/trackpoints", :controller =>'swf', :action =>'trackpoints'
+
+ # Map Bugs API
+ map.connect "api/#{API_VERSION}/bugs/getBugs", :controller =>'map_bugs', :action =>'get_bugs'
+ map.connect "api/#{API_VERSION}/bugs/addPOIexec", :controller =>'map_bugs', :action =>'add_bug'
+ map.connect "api/#{API_VERSION}/bugs/closePOIexec", :controller =>'map_bugs', :action =>'close_bug'
+ map.connect "api/#{API_VERSION}/bugs/editPOIexec", :controller =>'map_bugs', :action =>'edit_bug'
+ map.connect "api/#{API_VERSION}/bugs/getGPX", :controller =>'map_bugs', :action =>'gpx_bugs'
+ map.connect "api/#{API_VERSION}/bugs/getRSSfeed", :controller =>'map_bugs', :action =>'rss'
+
+ map.connect "api/#{API_VERSION}/bugs", :controller => 'map_bugs', :action => 'get_bugs'
+ map.connect "api/#{API_VERSION}/bugs/search", :controller => 'map_bugs', :action => 'search'
+ map.connect "api/#{API_VERSION}/bugs/rss", :controller =>'map_bugs', :action =>'rss'
+ map.connect "api/#{API_VERSION}/bug/create", :controller => 'map_bugs', :action => 'add_bug'
+ map.connect "api/#{API_VERSION}/bug/:id/comment", :controller => 'map_bugs', :action => 'edit_bug', :id => /\d+/
+ map.connect "api/#{API_VERSION}/bug/:id/close", :controller => 'map_bugs', :action => 'close_bug', :id => /\d+/
+ map.connect "api/#{API_VERSION}/bug/:id", :controller => 'map_bugs', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
+ map.connect "api/#{API_VERSION}/bug/:id", :controller => 'map_bugs', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
+
+ map.connect '/user/:display_name/bugs', :controller => 'map_bugs', :action => 'my_bugs'
+
+
# Data browsing
map.connect '/browse', :controller => 'changeset', :action => 'list'
map.changeset '/browse/changeset/:id', :controller => 'browse', :action => 'changeset', :id => /\d+/
map.connect '/browse/changesets', :controller => 'changeset', :action => 'list'
map.connect '/browse/changesets/feed', :controller => 'changeset', :action => 'list', :format => :atom
+ map.connect '/browse/bug/:id', :controller => 'browse', :action => 'bug', :id => /\d+/
# web site
map.root :controller => 'site', :action => 'index'
map.connect '/offline', :controller => 'site', :action => 'offline'
map.connect '/key', :controller => 'site', :action => 'key'
map.connect '/user/new', :controller => 'user', :action => 'new'
+ map.connect '/user/terms', :controller => 'user', :action => 'terms'
map.connect '/user/save', :controller => 'user', :action => 'save'
map.connect '/user/confirm', :controller => 'user', :action => 'confirm'
map.connect '/user/confirm-email', :controller => 'user', :action => 'confirm_email'
--- /dev/null
+require 'lib/migrate'
+
+class AddMapBugTables < ActiveRecord::Migration
+ def self.up
+
+ create_enumeration :map_bug_status_enum, ["open", "closed","hidden"]
+
+ create_table :map_bugs do |t|
+ t.column :id, :bigint, :null => false
+ t.integer :latitude, :null => false
+ t.integer :longitude, :null => false
+ t.column :tile, :bigint, :null => false
+ t.datetime :last_changed, :null => false
+ t.datetime :date_created, :null => false
+ t.string :nearby_place
+ t.string :text
+ t.column :status, :map_bug_status_enum, :null => false
+
+ end
+
+ add_index :map_bugs, [:tile,:status], :name => "map_bugs_tile_idx"
+ add_index :map_bugs, [:last_changed], :name => "map_bugs_changed_idx"
+ add_index :map_bugs, [:date_created], :name => "map_bugs_created_idx"
+ end
+
+ def self.down
+ remove_index :map_bugs, :name => "map_bugs_tile_idx"
+ remove_index :map_bugs, :name => "map_bugs_changed_idx"
+ remove_index :map_bugs, :name => "map_bugs_created_idx"
+ drop_table :map_bugs
+ drop_enumeration :map_bug_status_enum
+ end
+end
--- /dev/null
+require 'lib/migrate'
+
+class RefactorMapBugTables < ActiveRecord::Migration
+ def self.up
+
+
+ create_table :map_bug_comment do |t|
+ t.column :id, :bigint, :null => false
+ t.column :bug_id, :bigint, :null => false
+ t.boolean :visible, :null => false
+ t.datetime :date_created, :null => false
+ t.string :commenter_name
+ t.string :commenter_ip
+ t.column :commenter_id, :bigint
+ t.string :comment
+ end
+
+ remove_column :map_bugs, :text
+
+ add_index :map_bug_comment, [:bug_id], :name => "map_bug_comment_id_idx"
+ add_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id]
+ add_foreign_key :map_bug_comment, [:commenter_id], :users, [:id]
+
+ end
+
+ def self.down
+
+ add_column :map_bugs, :text, :string
+
+ remove_index :map_bugs, :name => "map_bug_comment_id_idx"
+ remove_foreign_key :map_bug_comment, [:bug_id]
+ remove_foreign_key :map_bug_comment, [:commenter_id]
+
+ drop_table :map_bugs_comment
+ end
+end
--- /dev/null
+require 'lib/migrate'
+
+class ChangeMapBugCommentType < ActiveRecord::Migration
+ def self.up
+ change_column :map_bug_comment, :comment, :text
+ end
+
+ def self.down
+ change_column :map_bug_comment, :comment, :string
+ end
+end
--- /dev/null
+require 'lib/migrate'
+
+class AddDateClosed < ActiveRecord::Migration
+ def self.up
+
+ add_column :map_bugs, :date_closed, :timestamp
+ end
+
+ def self.down
+
+ remove_column :map_bugs, :date_closed
+ end
+end
--- /dev/null
+require 'lib/migrate'
+
+class AddMapBugCommentEvent < ActiveRecord::Migration
+ def self.up
+ create_enumeration :map_bug_event_enum, ["opened", "closed","reopened","commented","hidden"]
+ add_column :map_bug_comment, :event, :map_bug_event_enum
+ end
+
+ def self.down
+
+ remove_column :map_bug_comment, :event
+ drop_enumeration :map_bug_event_enum
+ end
+end
end
end
- def self.IPLocation(ip_address)
+ def self.IPToCountry(ip_address)
Timeout::timeout(4) do
ipinfo = Quova::IpInfo.new(ip_address)
country = "GB" if country == "UK"
end
end
+
+ return country.upcase
+ end
- country = Country.find_by_code(country.upcase)
+ return nil
+ rescue Exception
+ return nil
+ end
+
+ def self.IPLocation(ip_address)
+ code = OSM.IPToCountry(ip_address)
+
+ unless code.nil?
+ country = Country.find_by_code(code)
return { :minlon => country.min_lon, :minlat => country.min_lat, :maxlon => country.max_lon, :maxlat => country.max_lat }
end
- return nil
- rescue Exception
return nil
end
# Return an SQL fragment to select a given area of the globe
def self.sql_for_area(minlat, minlon, maxlat, maxlon, prefix = nil)
- tilesql = QuadTile.sql_for_area(minlat, minlon, maxlat, maxlon, prefix)
+ tilesql = QuadTile.sql_for_area(minlat, minlon, maxlat, maxlon, prefix)
minlat = (minlat * 10000000).round
minlon = (minlon * 10000000).round
maxlat = (maxlat * 10000000).round
return "#{tilesql} AND #{prefix}latitude BETWEEN #{minlat} AND #{maxlat} AND #{prefix}longitude BETWEEN #{minlon} AND #{maxlon}"
end
+ # Return an SQL fragment to select a given area of the globe without using the quadtile index
+ def self.sql_for_area_no_quadtile(minlat, minlon, maxlat, maxlon, prefix = nil, without_quadtile = :false)
+ minlat = (minlat * 10000000).round
+ minlon = (minlon * 10000000).round
+ maxlat = (maxlat * 10000000).round
+ maxlon = (maxlon * 10000000).round
+
+ return "#{prefix}latitude BETWEEN #{minlat} AND #{maxlat} AND #{prefix}longitude BETWEEN #{minlon} AND #{maxlon}"
+ end
+
# Return a spam score for a chunk of text
def self.spam_score(text)
link_count = 0
return [link_proportion - 0.2, 0.0].max * 200 + link_count * 20
end
+
+ def self.legal_text_for_country(country_code)
+ file_name = File.join(RAILS_ROOT, "config", "legales", country_code.to_s + ".yml")
+ file_name = File.join(RAILS_ROOT, "config", "legales", APP_CONFIG['default_legale'] + ".yml") unless File.exist? file_name
+ YAML::load_file(file_name)
+ end
end