# within the specified bounding box, and in the specified page.
def trackpoints
#retrieve the page number
- page = params['page'].to_i
- unless page
- page = 0;
- end
+ page = params['page'].to_s.to_i
unless page >= 0
report_error("Page number must be greater than or equal to 0")
end
# get all the points
- points = Tracepoint.find_by_area(min_lat, min_lon, max_lat, max_lon, :offset => offset, :limit => APP_CONFIG['tracepoints_per_page'], :order => "timestamp DESC" )
+ points = Tracepoint.find_by_area(min_lat, min_lon, max_lat, max_lon, :offset => offset, :limit => APP_CONFIG['tracepoints_per_page'], :order => "gpx_id DESC, trackid ASC, timestamp ASC" )
doc = XML::Document.new
doc.encoding = XML::Encoding::UTF_8
doc.root = root
- track = XML::Node.new 'trk'
- doc.root << track
-
- trkseg = XML::Node.new 'trkseg'
- track << trkseg
+ # initialise these variables outside of the loop so that they
+ # stay in scope and don't get free'd up by the GC during the
+ # loop.
+ gpx_id = -1
+ trackid = -1
+ track = nil
+ trkseg = nil
+ anon_track = nil
+ anon_trkseg = nil
+ gpx_file = nil
+ timestamps = false
points.each do |point|
- trkseg << point.to_xml_node()
+ if gpx_id != point.gpx_id
+ gpx_id = point.gpx_id
+ trackid = -1
+ gpx_file = Trace.find(gpx_id)
+
+ if gpx_file.trackable?
+ track = XML::Node.new 'trk'
+ doc.root << track
+ timestamps = true
+
+ if gpx_file.identifiable?
+ track << (XML::Node.new("name") << gpx_file.name)
+ track << (XML::Node.new("desc") << gpx_file.description)
+ track << (XML::Node.new("url") << url_for(:controller => 'trace', :action => 'view', :id => gpx_file.id))
+ end
+ else
+ # use the anonymous track segment if the user hasn't allowed
+ # their GPX points to be tracked.
+ timestamps = false
+ if anon_track.nil?
+ anon_track = XML::Node.new 'trk'
+ doc.root << anon_track
+ end
+ track = anon_track
+ end
+ end
+
+ if trackid != point.trackid
+ if gpx_file.trackable?
+ trkseg = XML::Node.new 'trkseg'
+ track << trkseg
+ trackid = point.trackid
+ else
+ if anon_trkseg.nil?
+ anon_trkseg = XML::Node.new 'trkseg'
+ anon_track << anon_trkseg
+ end
+ trkseg = anon_trkseg
+ end
+ end
+
+ trkseg << point.to_xml_node(timestamps)
end
response.headers["Content-Disposition"] = "attachment; filename=\"map.osm\""
if user
@entries = DiaryEntry.find(:all, :conditions => ['user_id = ?', user.id], :order => 'created_at DESC', :limit => 20)
- @title = "OpenStreetMap diary entries for #{user.display_name}"
- @description = "Recent OpenStreetmap diary entries from #{user.display_name}"
+ @title = I18n.t('diary_entry.feed.user.title', :user => user.display_name, :locale => I18n.locale)
+ @description = I18n.t('diary_entry.feed.user.description', :user => user.display_name)
@link = "http://#{SERVER_URL}/user/#{user.display_name}/diary"
else
render :nothing => true, :status => :not_found
@entries = DiaryEntry.find(:all, :include => :user,
:conditions => ["users.visible = ? AND diary_entries.language_code = ?", true, params[:language]],
:order => 'created_at DESC', :limit => 20)
- @title = "OpenStreetMap diary entries in #{Language.find(params[:language]).english_name}"
- @description = "Recent diary entries from users of OpenStreetMap in #{Language.find(params[:language]).english_name}"
+ @title = I18n.t('diary_entry.feed.language.title', Language.find(params[:language]).english_name)
+ @description = I18n.t('diary_entry.feed.language.description', Language.find(params[:language]).english_name)
@link = "http://#{SERVER_URL}/diary/#{params[:language]}"
else
@entries = DiaryEntry.find(:all, :include => :user,
:conditions => ["users.visible = ?", true],
:order => 'created_at DESC', :limit => 20)
- @title = "OpenStreetMap diary entries"
- @description = "Recent diary entries from users of OpenStreetMap"
+ @title = I18n.t('diary_entry.feed.all.title')
+ @description = I18n.t('diary_entry.feed.all.description')
@link = "http://#{SERVER_URL}/diary"
end
end
before_filter :authorize_web
before_filter :set_locale
- before_filter :require_user, :only => [:mine, :create, :edit, :delete, :make_public]
+ before_filter :require_user, :only => [:mine, :create, :edit, :delete]
before_filter :authorize, :only => [:api_details, :api_data, :api_create]
before_filter :check_database_readable, :except => [:api_details, :api_data, :api_create]
- before_filter :check_database_writable, :only => [:create, :edit, :delete, :make_public]
+ before_filter :check_database_writable, :only => [:create, :edit, :delete]
before_filter :check_api_readable, :only => [:api_details, :api_data]
before_filter :check_api_writable, :only => [:api_create]
before_filter :require_allow_read_gpx, :only => [:api_details, :api_data]
# 4 - user's traces, not logged in as that user = all user's public traces
if target_user.nil? # all traces
if @user
- conditions = ["(gpx_files.public = ? OR gpx_files.user_id = ?)", true, @user.id] #1
+ conditions = ["(gpx_files.visibility <> 'private' OR gpx_files.user_id = ?)", @user.id] #1
else
- conditions = ["gpx_files.public = ?", true] #2
+ conditions = ["gpx_files.visibility <> 'private'"] #2
end
else
if @user and @user == target_user
conditions = ["gpx_files.user_id = ?", @user.id] #3 (check vs user id, so no join + can't pick up non-public traces by changing name)
else
- conditions = ["gpx_files.public = ? AND gpx_files.user_id = ?", true, target_user.id] #4
+ conditions = ["gpx_files.public <> 'private' AND gpx_files.user_id = ?", target_user.id] #4
end
end
def mine
# Load the preference of whether the user set the trace public the last time
@trace = Trace.new
- if @user.preferences.find(:first, :conditions => {:k => "gps.trace.public", :v => "default"}).nil?
- @trace.public = false
+ visibility = @user.preferences.find(:first, :conditions => {:k => "gps.trace.visibility"})
+ if visibility
+ @trace.visibility = visibility.v
+ elsif @user.preferences.find(:first, :conditions => {:k => "gps.trace.public", :v => "default"}).nil?
+ @trace.visibility = "private"
else
- @trace.public = true
+ @trace.visibility = "public"
end
list(@user, "mine")
end
logger.info(params[:trace][:gpx_file].class.name)
if params[:trace][:gpx_file].respond_to?(:read)
do_create(params[:trace][:gpx_file], params[:trace][:tagstring],
- params[:trace][:description], params[:trace][:public])
+ params[:trace][:description], params[:trace][:visibility])
if @trace.id
logger.info("id is #{@trace.id}")
@trace = Trace.new({:name => "Dummy",
:tagstring => params[:trace][:tagstring],
:description => params[:trace][:description],
- :public => params[:trace][:public],
+ :visibility => params[:trace][:visibility],
:inserted => false, :user => @user,
:timestamp => Time.now.getutc})
@trace.valid?
if params[:trace]
@trace.description = params[:trace][:description]
@trace.tagstring = params[:trace][:tagstring]
+ @trace.visibility = params[:trace][:visibility]
if @trace.save
redirect_to :action => 'view'
end
render :nothing => true, :status => :not_found
end
- def make_public
- trace = Trace.find(params[:id])
-
- if @user and trace.user == @user
- if request.post? and !trace.public?
- trace.public = true
- trace.save
- flash[:notice] = t 'trace.make_public.made_public'
- redirect_to :controller => 'trace', :action => 'view', :id => params[:id]
- else
- render :nothing => true, :status => :bad_request
- end
- else
- render :nothing => true, :status => :forbidden
- end
- rescue ActiveRecord::RecordNotFound
- render :nothing => true, :status => :not_found
- end
-
def georss
- conditions = ["gpx_files.public = ?", true]
+ conditions = ["gpx_files.visibility <> 'private'"]
if params[:display_name]
conditions[0] += " AND users.display_name = ?"
if trace.inserted?
if trace.public? or (@user and @user == trace.user)
- expires_in 7.days, :private => !trace.public, :public => trace.public
+ expires_in 7.days, :private => !trace.public?, :public => trace.public?
send_file(trace.large_picture_name, :filename => "#{trace.id}.gif", :type => 'image/gif', :disposition => 'inline')
else
render :nothing => true, :status => :forbidden
if trace.inserted?
if trace.public? or (@user and @user == trace.user)
- expires_in 7.days, :private => !trace.public, :public => trace.public
+ expires_in 7.days, :private => !trace.public?, :public => trace.public?
send_file(trace.icon_picture_name, :filename => "#{trace.id}_icon.gif", :type => 'image/gif', :disposition => 'inline')
else
render :nothing => true, :status => :forbidden
if request.post?
tags = params[:tags] || ""
description = params[:description] || ""
- pub = params[:public] || false
+ visibility = params[:visibility] || false
+
+ if params[:public] && !visibility
+ visibility = "public"
+ end
if params[:file].respond_to?(:read)
- do_create(params[:file], tags, description, pub)
+ do_create(params[:file], tags, description, visibility)
if @trace.id
render :text => @trace.id.to_s, :content_type => "text/plain"
private
- def do_create(file, tags, description, public)
+ def do_create(file, tags, description, visibility)
# Sanitise the user's filename
name = file.original_filename.gsub(/[^a-zA-Z0-9.]/, '_')
:name => name,
:tagstring => tags,
:description => description,
- :public => public,
+ :visibility => visibility,
:inserted => true,
:user => @user,
:timestamp => Time.now.getutc
FileUtils.rm_f(filename)
end
- # Finally save whether the user marked the trace as being public
- if @trace.public?
- if @user.trace_public_default.nil?
- @user.preferences.create(:k => "gps.trace.public", :v => "default")
- end
+ # Finally save the user's preferred previacy level
+ if pref = @user.preferences.find(:first, :conditions => {:k => "gps.trace.visibility"})
+ pref.v = visibility
+ pref.save
else
- pref = @user.trace_public_default
- pref.destroy unless pref.nil?
+ @user.preferences.create(:k => "gps.trace.visibility", :v => visibility)
end
end
doc.find('//osm/node').each do |pt|
return Node.from_xml_node(pt, create)
end
+ raise OSM::APIBadXMLError.new("node", xml, "XML doesn't contain an osm/node element.")
rescue LibXML::XML::Error, ArgumentError => ex
raise OSM::APIBadXMLError.new("node", xml, ex.message)
end
doc.find('//osm/relation').each do |pt|
return Relation.from_xml_node(pt, create)
end
+ raise OSM::APIBadXMLError.new("node", xml, "XML doesn't contain an osm/relation element.")
rescue LibXML::XML::Error, ArgumentError => ex
raise OSM::APIBadXMLError.new("relation", xml, ex.message)
end
validates_length_of :name, :maximum => 255
validates_length_of :description, :maximum => 255
# validates_numericality_of :latitude, :longitude
- validates_inclusion_of :public, :inserted, :in => [ true, false]
-
+ validates_inclusion_of :inserted, :in => [ true, false ]
+ validates_inclusion_of :visibility, :in => ["private", "public", "trackable", "identifiable"]
+
belongs_to :user
has_many :tags, :class_name => 'Tracetag', :foreign_key => 'gpx_id', :dependent => :delete_all
has_many :points, :class_name => 'Tracepoint', :foreign_key => 'gpx_id', :dependent => :delete_all
end
def tagstring=(s)
- if s.include?','
+ if s.include? ','
self.tags = s.split(/\s*,\s*/).collect {|tag|
tt = Tracetag.new
tt.tag = tag
}
end
end
-
+
+ def public?
+ visibility == "public" || visibility == "identifiable"
+ end
+
+ def trackable?
+ visibility == "trackable" || visibility == "identifiable"
+ end
+
+ def identifiable?
+ visibility == "identifiable"
+ end
+
def large_picture= (data)
f = File.new(large_picture_name, "wb")
f.syswrite(data)
el1['lat'] = self.latitude.to_s
el1['lon'] = self.longitude.to_s
el1['user'] = self.user.display_name
- el1['public'] = self.public.to_s
+ el1['visibility'] = self.visibility
el1['pending'] = (!self.inserted).to_s
el1['timestamp'] = self.timestamp.xmlschema
return el1
belongs_to :trace, :foreign_key => 'gpx_id'
- def to_xml_node
+ def to_xml_node(print_timestamp = false)
el1 = XML::Node.new 'trkpt'
el1['lat'] = self.lat.to_s
el1['lon'] = self.lon.to_s
+ el1 << (XML::Node.new("time") << self.timestamp.xmlschema) if print_timestamp
return el1
end
end
return false
end
- def trace_public_default
- return self.preferences.find(:first, :conditions => {:k => "gps.trace.public", :v => "default"})
- end
-
def delete
self.active = false
self.display_name = "user_#{self.id}"
doc.find('//osm/way').each do |pt|
return Way.from_xml_node(pt, create)
end
+ raise OSM::APIBadXMLError.new("node", xml, "XML doesn't contain an osm/way element.")
rescue LibXML::XML::Error, ArgumentError => ex
raise OSM::APIBadXMLError.new("way", xml, ex.message)
end
:href => changeset_download_url(changeset, :only_path => false),
:type => "application/osmChange+xml"
- entry.title t('browse.changeset.title') + " " + h(changeset.id)
+ if !changeset.tags.empty? and changeset.tags.has_key? "comment"
+ entry.title t('browse.changeset.feed.title_comment', :id => h(changeset.id), :comment => h(changeset.tags['comment'])), :type => "html"
+ else
+ entry.title t('browse.changeset.feed.title', :id => h(changeset.id))
+ end
if changeset.user.data_public?
entry.author do |author|
<tr><td align="right"><%= t'trace.trace_form.upload_gpx' %></td><td><%= f.file_field :gpx_file, :size => 50, :maxlength => 255 %></td></tr>
<tr><td align="right"><%= t'trace.trace_form.description' %></td><td><%= f.text_field :description, :size => 50, :maxlength => 255 %></td></tr>
<tr><td align="right"><%= t'trace.trace_form.tags' %></td><td><%= f.text_field :tagstring, :size => 50, :maxlength => 255 %> (<%= t'trace.trace_form.tags_help' %>)</td></tr>
- <tr><td align="right"><%= t'trace.trace_form.public' %></td><td><%= f.check_box :public %> <span class="minorNote">(<a href="<%= t'trace.trace_form.public_help_url' %>"><%= t'trace.trace_form.public_help' %></a>)</span></td></tr>
+ <tr><td align="right"><%= t'trace.trace_form.visibility' %></td><td><%= f.select :visibility, [[t('trace.visibility.private'),"private"],[t('trace.visibility.public'),"public"],[t('trace.visibility.trackable'),"trackable"],[t('trace.visibility.identifiable'),"identifiable"]] %> <span class="minorNote">(<a href="<%= t'trace.trace_form.visibility_help_url' %>"><%= t'trace.trace_form.visibility_help' %></a>)</span></td></tr>
<tr><td></td><td><%= submit_tag t('trace.trace_form.upload_button') %> | <a href="<%= t'trace.trace_form.help_url' %>"><%= t'trace.trace_form.help' %></a></td></tr>
</table>
<% end %>
<td><%= t'trace.edit.tags' %></td>
<td><%= f.text_field :tagstring, :size => 50 %> (<%= t'trace.edit.tags_help' %>)</td>
</tr>
+ <tr>
+ <td><%= t'trace.edit.visibility' %></td>
+ <td><%= f.select :visibility, [[t('trace.visibility.private'),"private"],[t('trace.visibility.public'),"public"],[t('trace.visibility.trackable'),"trackable"],[t('trace.visibility.identifiable'),"identifiable"]] %> (<a href="<%= t'trace.edit.visibility_help_url' %>"><%= t'trace.edit.visibility_help' %></a>)</td>
+ </tr>
</table>
<br /><br />
<% end %>
</td>
</tr>
+ <tr>
+ <td><%= t'trace.view.visibility' %></td>
+ <td><%= t"trace.visibility.#{@trace.visibility}" %></td>
+ </tr>
</table>
<br /><br />
<table>
<tr>
- <% unless @trace.public? %>
- <td><%= button_to t('trace.view.make_public'), :controller => 'trace', :action => 'make_public', :id => @trace.id %></td>
- <% end %>
<% if @trace.user == @user %>
<td><%= button_to t('trace.view.edit_track'), :controller => 'trace', :action => 'edit', :id => @trace.id %></td>
<% end %>
<% if !@user.home_lat.nil? and !@user.home_lon.nil? %>
<% if !@user.nearby.empty? %>
<% @user.nearby.each do |nearby| %>
- <% nearest_str += "nearest.push( { 'display_name' : '#{nearby.display_name}', 'home_lat' : #{nearby.home_lat}, 'home_lon' : #{nearby.home_lon} } );\n" %>
+ <% nearest_str += "nearest.push( { 'display_name' : '#{escape_javascript(nearby.display_name)}', 'home_lat' : #{nearby.home_lat}, 'home_lon' : #{nearby.home_lon} } );\n" %>
<% end %>
<% end %>
<% end %>
download: "Download {{changeset_xml_link}} or {{osmchange_xml_link}}"
changesetxml: "Changeset XML"
osmchangexml: "osmChange XML"
+ feed:
+ title: "Changeset {{id}}"
+ title_comment: "Changeset {{id}} - {{comment}}"
changeset_navigation:
user:
name_tooltip: "View edits by {{user}}"
edit_link: Edit this entry
diary_comment:
comment_from: "Comment from {{link_user}} at {{comment_created_at}}"
+ feed:
+ user:
+ title: "OpenStreetMap diary entries for {{user}}"
+ description: "Recent OpenStreetmap diary entries from {{user}}"
+ language:
+ title: "OpenStreetMap diary entries in {{language_name}}"
+ description: "Recent diary entries from users of OpenStreetMap in {{language_name}}"
+ all:
+ title: "OpenStreetMap diary entries"
+ description: "Recent diary entries from users of OpenStreetMap"
export:
start:
area_to_export: "Area to Export"
destination: "Destination access"
construction: "Roads under construction"
trace:
+ visibility:
+ private: "Private (only shared as anonymous, unordered points)"
+ public: "Public (shown in trace list and as anonymous, unordered points)"
+ trackable: "Trackable (only shared as anonymous, ordered points with timestamps)"
+ identifiable: "Identifiable (shown in trace list and as identifiable, ordered points with timestamps)"
create:
upload_trace: "Upload GPS Trace"
trace_uploaded: "Your GPX file has been uploaded and is awaiting insertion in to the database. This will usually happen within half an hour, and an email will be sent to you on completion."
tags: "Tags:"
tags_help: "comma delimited"
save_button: "Save Changes"
+ visibility: "Visibility:"
+ visibility_help: "what does this mean?"
+ visibility_help_url: "http://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"
no_such_user:
title: "No such user"
heading: "The user {{user}} does not exist"
description: "Description"
tags: "Tags"
tags_help: "comma delimited"
- public: "Public?"
- public_help: "what does this mean?"
- public_help_url: "http://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"
+ visibility: "Visibility"
+ visibility_help: "what does this mean?"
+ visibility_help_url: "http://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"
upload_button: "Upload"
help: "Help"
help_url: "http://wiki.openstreetmap.org/wiki/Upload"
description: "Description:"
tags: "Tags:"
none: "None"
- make_public: "Make this track public permanently"
edit_track: "Edit this track"
delete_track: "Delete this track"
trace_not_found: "Trace not found!"
+ visibility: "Visibility:"
trace_paging_nav:
showing: "Showing page"
of: "of"
showing_page: "Jelenlegi oldal:"
of: "összesen:"
changeset:
+ id: "#{{id}}"
still_editing: "(szerkesztés alatt)"
anonymous: "Névtelen"
no_comment: "(nincs)"
area: "Terület"
list:
title: "Módosításcsomagok"
- description: "Legutóbbi szerkesztések"
- description_user: "{{user}} legutóbbi szerkesztései"
- description_bbox: "Legutóbbi szerkesztések ezen belül: {{bbox}}"
- description_user_bbox: "{{user}} legutóbbi szerkesztései ezen belül: {{bbox}}"
+ title_user: "{{user}} módosításcsomagjai"
+ title_bbox: "Módosításcsomagok ezen belül: {{bbox}}"
+ title_user_bbox: "{{user}} módosításcsomagjai ezen belül: {{bbox}}"
+
+ heading: "Módosításcsomagok"
+ heading_user: "Módosításcsomagok"
+ heading_bbox: "Módosításcsomagok"
+ heading_user_bbox: "Módosításcsomagok"
+
+ description: "Legutóbbi módosítások"
+ description_user: "{{user}} módosításcsomagjai"
+ description_bbox: "Módosításcsomagok ezen belül: {{bbox}}"
+ description_user_bbox: "{{user}} módosításcsomagjai ezen belül: {{bbox}}"
diary_entry:
new:
title: Új naplóbejegyzés
unread_button: "Jelölés olvasatlanként"
read_button: "Jelölés olvasottként"
reply_button: "Válasz"
+ delete_button: "Törlés"
new:
title: "Üzenet küldése"
send_message_to: "Új üzenet küldése neki: {{name}}"
reading_your_sent_messages: "Elküldött üzenetek olvasása"
to: "Címzett"
back_to_outbox: "Vissza az elküldött üzenetekhez"
+ sent_message_summary:
+ delete_button: "Törlés"
mark:
- as_read: "Üzenet jelölése olvasottként"
- as_unread: "Üzenet jelölése olvasatlanként"
+ as_read: "Üzenet megjelölve olvasottként"
+ as_unread: "Üzenet megjelölve olvasatlanként"
+ delete:
+ deleted: "Üzenet törölve"
site:
index:
js_1: "Vagy egy olyan böngészőt használsz, amely nem támogatja a javascriptet, vagy letiltottad a javascriptet."
account not active: "Sajnálom, a felhasználói fiókod még nincs aktiválva.<br>Az aktiváláshoz, kattints a fiókodat megerősítő e-mailben lévő hivatkozásra."
auth failure: "Sajnálom, ilyen adatokkal nem tudsz bejelentkezni."
lost_password:
- title: "elvesztett jelszó"
+ title: "Elvesztett jelszó"
heading: "Elfelejtetted jelszavad?"
email address: "E-mail cím:"
- new password button: "Küldj nekem egy új jelszót"
+ new password button: "Jelszó alaphelyzetbe állítása"
notice email on way: "Sajnálom, hogy elvesztetted :-( de már úton van egy e-mail, így nemsokára alaphelyzetbe állíthatod."
notice email cannot find: "Az e-mail cím nem található, sajnálom."
reset_password:
- title: "jelszó alaphelyzetbe állítása"
- flash changed check mail: "Jelszavad megváltozott, és úton van a postaládádba :-)"
+ title: "Jelszó alaphelyzetbe állítása"
+ heading: "{{user}} jelszavának alaphelyzetbe állítása"
+ password: "Jelszó: "
+ confirm password: "Jelszó megerősítése: "
+ reset: "Jelszó alaphelyzetbe állítása"
+ flash changed: "Jelszavad megváltozott."
flash token bad: "Nem található ez az utalvány, ellenőrizd az URL-t."
new:
title: "Felhasználói fiók létrehozása"
download: "Niðurhala breytingunni á {{changeset_xml_link}} eða á {{osmchange_xml_link}}"
changesetxml: "Breytingarsetts XML sniði"
osmchangexml: "osmChange XML sniði"
+ feed:
+ title: "Breytingarsett {{id}}"
+ title_comment: "Breytingarsett {{id}} - {{comment}}"
changeset_navigation:
user:
name_tooltip: "Skoða breytingarsett eftir {{user}}"
edit_link: "Breyta þessari færslu"
diary_comment:
comment_from: "Athugasemd eftir {{link_user}} þann {{comment_created_at}}"
+ feed:
+ user:
+ title: "OpenStreetMap dagbókarfærslur eftir {{user}}"
+ description: "Nýjustu dagbókarfærslur eftir {{user}}"
+ language:
+ title: "OpenStreetMap dagbókarfærslur á {{language_name}}"
+ description: "Nýjustu dagbókarfærslur frá OpenStreetMap á {{language_name}}"
+ all:
+ title: "OpenStreetMap dagbókarfærslur"
+ description: "Nýjustu dagbókarfærslur frá OpenStreetMap"
export:
start:
area_to_export: "Svæði til að niðurhala"
password: "Lykilorð: "
confirm password: "Staðfestu lykilorðið: "
signup: "Nýskrá"
- flash create success message: "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br /><br />Please note that you won't 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."
+ flash create success message: "Nýr notandi var búinn til fyrir þig og staðfestingarpóstur sendur á netfangið sem þú gafst upp.<br /><br />Þú muntu ekki geta innskráð þig fyrr en þú ert búin(n) að fylgja leiðbeiningunum í staðfestingarpóstinum.<br /><br />Ef þú notar spamkerfi sem sendir staðfestingarbeðnir þegar það verður vart við nýja sendendur þarft þú að bæta webmaster@openstreetmap.org á hvítlista. Það netfang getur ekki svarað staðfestingarbeiðnum."
no_such_user:
title: "Notandi ekki til"
heading: "Notandinn {{user}} er ekki til"
download: "Tải xuống {{changeset_xml_link}} hoặc {{osmchange_xml_link}}"
changesetxml: "Bộ thay đổi XML"
osmchangexml: "osmChange XML"
+ feed:
+ title: "Bộ thay đổi {{id}}"
+ title_comment: "Bộ thay đổi {{id}} - {{comment}}"
+ changeset_navigation:
+ user:
+ name_tooltip: "Xem các đóng góp của {{user}}"
+ prev_tooltip: "Đóng góp trước của {{user}}"
+ next_tooltip: "Đóng góp sau của {{user}}"
+ all:
+ prev_tooltip: "Bộ thay đổi trước"
+ next_tooltip: "Bộ thay đổi sau"
changeset_details:
created_at: "Lúc Tạo:"
closed_at: "Lúc Đóng:"
no_bounding_box: "Không lưu hộp bao của bộ thay đổi này."
show_area_box: "Hiện Hộp vùng"
box: "hộp"
- has_nodes: "Có {{count}} nốt sau:"
- has_ways: "Có {{count}} lối sau:"
- has_relations: "Có {{count}} quan hệ sau:"
+ has_nodes:
+ one: "Có {{count}} nốt sau:"
+ other: "Có {{count}} nốt sau:"
+ has_ways:
+ one: "Có {{count}} lối sau:"
+ other: "Có {{count}} lối sau:"
+ has_relations:
+ one: "Có {{count}} quan hệ sau:"
+ other: "Có {{count}} quan hệ sau:"
common_details:
edited_at: "Lúc Sửa đổi:"
edited_by: "Người Sửa đổi:"
relation_history:
relation_history: "Lịch sử Quan hệ"
relation_history_title: "Lịch sử Quan hệ: {{relation_name}}"
+ download: "{{download_xml_link}} hoặc {{view_details_link}}"
+ download_xml: "Tải xuống XML"
+ view_details: "xem chi tiết"
relation_member:
entry: "{{type}} {{name}}"
entry_role: "{{type}} {{name}} với vai trò {{role}}"
showing_page: "Đang hiện trang"
of: "trong"
changeset:
+ id: "#{{id}}"
still_editing: "(đang mở)"
anonymous: "Vô danh"
no_comment: "(không có)"
user: "Người dùng"
comment: "Miêu tả"
area: "Vùng"
- list_bbox:
- history: "Lịch sử"
- changesets_within_the_area: "Bộ thay đổi ở vùng:"
- show_area_box: "xem hộp vùng"
- no_changesets: "Không có bộ thay đổi"
- all_changes_everywhere: "Xem các thay đổi ở mọi nơi tại {{recent_changes_link}}"
- recent_changes: "Thay đổi Gần đây"
- no_area_specified: "Không định rõ vùng"
- first_use_view: "Trước tiên dùng {{view_tab_link}} để chuyển và phóng to một vùng, rồi nhấn chuột vào thẻ lịch sử."
- view_the_map: "xem bản đồ"
- view_tab: "thẻ Xem"
- alternatively_view: "Hoặc xem tất cả các {{recent_changes_link}}"
list:
- recent_changes: "Thay đổi Gần đây"
- recently_edited_changesets: "Bộ thay đổi được sửa đổi gần đây:"
- for_more_changesets: 'Để xem thêm bộ thay đổi, chọn người dùng và xem danh sách sửa đổi của họ, hoặc xem "lịch sử" của một vùng.'
- list_user:
- edits_by_username: "Sửa đổi của {{username_link}}"
- no_visible_edits_by: "{{name}} không có sửa đổi công khai."
- for_all_changes: "Xem các thay đổi bởi mọi người dùng tại {{recent_changes_link}}"
- recent_changes: "Thay đổi Gần đây"
+ title: "Các bộ thay đổi"
+ description: "Những đóng góp gần đây"
+ title_user: "Những bộ thay đổi của {{user}}"
+ title_bbox: "Những bộ thay đổi ở trong {{bbox}}"
+ title_user_bbox: "v bộ thay đổi của {{user}} ở trong {{bbox}}"
+
+ heading: "Các bộ thay đổi"
+ heading_user: "Các bộ thay đổi"
+ heading_bbox: "Các bộ thay đổi"
+ heading_user_bbox: "Các bộ thay đổi"
+
+ description: "Những thay đổi gần đây"
+ description_user: "Những bộ thay đổi của {{user}}"
+ description_bbox: "Những bộ thay đổi ở trong {{bbox}}"
+ description_user_bbox: "Những bộ thay đổi của {{user}} ở trong {{bbox}}"
diary_entry:
new:
title: "Mục Nhật ký Mới"
edit_link: "Sửa đổi mục này"
diary_comment:
comment_from: "Bình luận của {{link_user}} lúc {{comment_created_at}}"
+ feed:
+ user:
+ title: "Các mục nhật ký của {{user}}"
+ description: "Những mục gần đây trong nhật ký OpenStreetMap của {{user}}"
+ language:
+ title: "Các mục nhật ký OpenStreetMap bằng {{language_name}}"
+ description: "Những mục nhật ký gần đây của người dùng OpenStreetMap bằng {{language_name}}"
+ all:
+ title: "Các mục nhật ký OpenStreetMap"
+ description: "Những mục nhật ký gần đây của người dùng OpenStreetMap"
export:
start:
area_to_export: "Vùng để Xuất"
unread_button: "Đánh dấu là chưa đọc"
read_button: "Đánh dấu là đã đọc"
reply_button: "Trả lời"
+ delete_button: "Xóa"
new:
title: "Gửi thư"
send_message_to: "Gửi thư mới cho {{name}}"
reading_your_sent_messages: "Đọc thư đã gửi"
to: "Tới"
back_to_outbox: "Trở về hộp thư đã gửi"
+ sent_message_summary:
+ delete_button: "Xóa"
mark:
as_read: "Thư đã đọc"
as_unread: "Thư chưa đọc"
+ delete:
+ deleted: "Đã xóa thư"
site:
index:
js_1: "Hoặc trình duyệt của bạn không hỗ trợ JavaScript, hoặc bạn đã tắt JavaScript."
table:
heading: "Chú giải tại mức {{zoom_level}}"
entry:
- motorway: "Quốc lộ"
+ motorway: "Đường cao tốc"
trunk: "Xa lộ"
- primary: "Tỉnh lộ"
- secondary: "Đường chính"
- unclassified: "Đường lớn"
+ primary: "Đường chính"
+ secondary: "Đường lớn"
+ unclassified: "Đường không phân loại"
unsurfaced: "Đường không lát"
track: "Đường mòn"
byway: "Đường mòn đa mốt"
owner: "Tác giả:"
description: "Miêu tả:"
tags: "Thẻ:"
+ tags_help: "dấu phẩy phân cách"
save_button: "Lưu các Thay đổi"
no_such_user:
title: "Người dùng không tồn tại"
upload_gpx: "Tải lên Tập tin GPX"
description: "Miêu tả"
tags: "Thẻ"
+ tags_help: "dấu phẩy phân cách"
public: "Công khai?"
public_help: "có nghĩa là gì?"
public_help_url: "http://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces?uselang=vi"
account not active: "Rất tiếc, tài khoản của bạn chưa được kích hoạt.<br>Xin hãy nhấn chuột vào liên kết trong thư điện tử xác nhận tài khoản để kích hoạt tài khoản."
auth failure: "Rất tiếc, không thể đăng nhập với những chi tiết đó."
lost_password:
- title: "quên mất mật khẩu"
+ title: "Quên mất mật khẩu"
heading: "Quên mất Mật khẩu?"
email address: "Địa chỉ Thư điện tử:"
- new password button: "Gửi mật khẩu mới cho tôi"
+ new password button: "Đặt lại mật khẩu"
notice email on way: "Đáng tiếc là bạn quên nó. :-( May là thư điện tử sắp tới để bạn đặt nó lại."
notice email cannot find: "Rất tiếc, không tìm thấy địa chỉ thư điện tử."
reset_password:
- title: "đặt lại mật khẩu"
- flash changed check mail: "Mật khẩu của bạn đã được đổi và mật khẩu mới sắp tới hộp thư của bạn. :-)"
+ title: "Đặt lại mật khẩu"
+ heading: "Đặt lại Mật khẩu của {{user}}"
+ password: "Mật khẩu: "
+ confirm password: "Xác nhận Mật khẩu: "
+ reset: "Đặt lại Mật khẩu"
+ flash changed: "Mật khẩu của bạn đã được thay đổi."
flash token bad: "Không tìm thấy dấu hiệu đó. Có lẽ kiểm tra URL?"
new:
title: "Mở tài khoản"
failed: "Rất tiếc, việc thêm {{name}} là người bạn bị thất bại."
already_a_friend: "{{name}} đã là người bạn."
remove_friend:
- success: "{{name}} không còn người bạn."
+ success: "{{name}} không còn là người bạn."
not_a_friend: "{{name}} đã không phải người bạn."
<column/><headline>Uploading your track</headline>
<bodyText>Now, you need to get your track off the GPS set. Maybe your GPS came with some software, or maybe it lets you copy the files off via USB. If not, try <a href="http://www.gpsbabel.org/" target="_blank">GPSBabel</a>. Whatever, you want the file to be in GPX format.
-Then use the 'GPS Traces' tab to upload your track to the OpenStreetMap server. But this is only the first bit - it won't appear on the map yet. You need to draw and name the roads yourself, using the track as a guide.</bodyText>
+Then use the 'GPS Traces' tab to upload your track to OpenStreetMap. But this is only the first bit - it won't appear on the map yet. You must draw and name the roads yourself, using the track as a guide.</bodyText>
<headline>Using your track</headline>
<bodyText>Find your uploaded track in the 'GPS Traces' listing, and click 'edit' <i>right next to it</i>. Potlatch will start with this track loaded, plus any waypoints. You're ready to draw!
If you've accidentally deleted a way and saved it, press U (for 'undelete'). All the deleted ways will be shown. Choose the one you want; unlock it by clicking the padlock (by the ID); and save as usual.
Think someone else has made a mistake? Send them a friendly message. Use the history option (H) to select their name, then click 'Mail'.
+
+Use the Inspector (in the 'Advanced' menu) for helpful information about the current way or point.
</bodyText><column/><headline>FAQs</headline>
<bodyText><b>How do I see my waypoints?</b>
Waypoints only show up if you click 'edit' by the track name in 'GPS Traces'. The file has to have both waypoints and tracklog in it - the server rejects anything with waypoints alone.
-<b>Why can't I type text with accents?</b>
-<u>Linux users only</u>: This is a bug in Adobe Flash Player for Linux. We can't do anything until Adobe fixes it - sorry. Until then, you can copy and paste from elsewhere.
-
More FAQs for <a href="http://wiki.openstreetmap.org/wiki/Potlatch/FAQs" target="_blank">Potlatch</a> and <a href="http://wiki.openstreetmap.org/wiki/FAQ" target="_blank">OpenStreetMap</a>.
</bodyText>
C Close <u>c</u>hangeset
G Show <u>G</u>PS tracks
H Show <u>h</u>istory
+I Show <u>i</u>nspector
+J <u>J</u>oin point to crossing ways
K Loc<u>k</u>/unlock current selection
L Show current <u>l</u>atitude/longitude
M <u>M</u>aximise editing window
map.connect '/trace/:id/data.:format', :controller => 'trace', :action => 'data'
map.connect '/trace/:id/edit', :controller => 'trace', :action => 'edit'
map.connect '/trace/:id/delete', :controller => 'trace', :action => 'delete'
- map.connect '/trace/:id/make_public', :controller => 'trace', :action => 'make_public'
map.connect '/user/:display_name/traces', :controller => 'trace', :action => 'list'
map.connect '/user/:display_name/traces/page/:page', :controller => 'trace', :action => 'list'
map.connect '/user/:display_name/traces/rss', :controller => 'trace', :action => 'georss'
--- /dev/null
+require 'lib/migrate'
+
+class AddMoreControlsToGpxFiles < ActiveRecord::Migration
+ def self.up
+ create_enumeration :gpx_visibility_enum, ["private", "public", "trackable", "identifiable"]
+ add_column :gpx_files, :visibility, :gpx_visibility_enum, :default => "public", :null => false
+ Trace.update_all("visibility = 'private'", { :public => false })
+ add_index :gpx_files, [:visible, :visibility], :name => "gpx_files_visible_visibility_idx"
+ remove_index :gpx_files, :name => "gpx_files_visible_public_idx"
+ remove_column :gpx_files, :public
+ end
+
+ def self.down
+ add_column :gpx_files, :public, :boolean, :default => true, :null => false
+ Trace.update_all("public = false", { :visibility => "private" })
+ add_index :gpx_files, [:visible, :public], :name => "gpx_files_visible_public_idx"
+ remove_index :gpx_files, :name => "gpx_files_visible_visibility_idx"
+ remove_column :gpx_files, :visibility
+ drop_enumeration :gpx_visibility_enum
+ end
+end
node.style.fontStyle = 'italic';
}
}
-
+
node = document.getElementById("historyanchor");
if (node) {
if (zoom >= 11) {
typeof minlat == "number" &&
typeof maxlon == "number" &&
typeof maxlat == "number") {
-
+
minlon = Math.round(minlon * decimals) / decimals;
minlat = Math.round(minlat * decimals) / decimals;
maxlon = Math.round(maxlon * decimals) / decimals;
maxlat = Math.round(maxlat * decimals) / decimals;
args.bbox = minlon + "," + minlat + "," + maxlon + "," + maxlat;
}
-
+
node.href = setArgs("/history", args);
node.style.fontStyle = 'normal';
} else {
if (layers && (layers != "B000FTF") && (layers != "B000FTFT")) {
args["layers"] = layers;
}
+ else {
+ delete args["layers"];
+ }
// Here we're assuming that all parameters but ?layers= and
// ?{node,way,relation}= can be safely omitted from the shortlink
if (window.location.hostname.match(/^www\.openstreetmap\.org/i)) {
return "http://osm.org";
} else {
- return "";
+ return "";
}
}
for (var key in keys) {
var re_key = '\\[\\[' + key + '\\]\\]';
var re = new RegExp(re_key, "g");
-
+
string = string.replace(re, keys[key]);
}
-
+
return string;
-}
+}
function makeShortCode(lat, lon, zoom) {
char_array = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@";
timestamp: "2008-10-01 10:10:10"
tile: <%= QuadTile.tile_for_point(1, 1) %>
+trackable_trace_1:
+ trackid: 1
+ latitude: <%= (51.510 * SCALE).to_i %>
+ longitude: <%= (-0.140 * SCALE).to_i %>
+ gpx_id: 3
+ timestamp: "2009-07-30 17:46:00"
+ tile: <%= QuadTile.tile_for_point(51.510, -0.140) %>
+
+trackable_trace_2:
+ trackid: 2
+ latitude: <%= (51.511 * SCALE).to_i %>
+ longitude: <%= (-0.141 * SCALE).to_i %>
+ gpx_id: 3
+ timestamp: "2009-07-30 17:47:00"
+ tile: <%= QuadTile.tile_for_point(51.511, -0.141) %>
+
+identifiable_trace_1:
+ trackid: 1
+ latitude: <%= (51.512 * SCALE).to_i %>
+ longitude: <%= (0.142 * SCALE).to_i %>
+ gpx_id: 4
+ timestamp: "2009-07-30 17:46:00"
+ tile: <%= QuadTile.tile_for_point(51.512, 0.142) %>
+
latitude: 1
longitude: 1
timestamp: "2008-10-29 10:10:10"
- public: true
+ visibility: "public"
description: This is a trace
inserted: true
latitude: 51.3
longitude: -0.56
timestamp: "2009-05-06 13:34:34"
- public: false
+ visibility: "private"
description: This is an anonymous trace
inserted: true
+
+trackable_trace_file:
+ id: 3
+ user_id: 2
+ visible: false
+ name: Trackable Trace.gpx
+ size: 123
+ latitude: 51.51
+ longitude: -0.14
+ timestamp: "2009-07-30 17:48:34"
+ visibility: "trackable"
+ description: This trace shows trksegs and timestamps, but no user details.
+ inserted: true
+
+identifiable_trace_file:
+ id: 4
+ user_id: 2
+ visible: false
+ name: Identifiable Trace.gpx
+ size: 123
+ latitude: 51.512
+ longitude: 0.142
+ timestamp: "2009-07-30 17:48:34"
+ visibility: "identifiable"
+ description: This trace shows trksegs, timestamps and user details.
+ inserted: true
def test_tracepoints
point = gpx_files(:public_trace_file)
- minlon = point.longitude-0.1
- minlat = point.latitude-0.1
- maxlon = point.longitude+0.1
- maxlat = point.latitude+0.1
+ minlon = point.longitude-0.001
+ minlat = point.latitude-0.001
+ maxlon = point.longitude+0.001
+ maxlat = point.latitude+0.001
bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}"
get :trackpoints, :bbox => bbox
#print @response.body
end
end
+ def test_tracepoints_trackable
+ point = gpx_files(:trackable_trace_file)
+ minlon = point.longitude-0.002
+ minlat = point.latitude-0.002
+ maxlon = point.longitude+0.002
+ maxlat = point.latitude+0.002
+ bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}"
+ get :trackpoints, :bbox => bbox
+ #print @response.body
+ assert_response :success
+ assert_select "gpx[version=1.0][creator=OpenStreetMap.org][xmlns=http://www.topografix.com/GPX/1/0/]:root", :count => 1 do
+ assert_select "trk", :count => 1 do
+ assert_select "trk > trkseg", :count => 2 do |trksegs|
+ trksegs.each do |trkseg|
+ assert_select trkseg, "trkpt", :count => 1 do |trkpt|
+ assert_select trkpt[0], "time", :count => 1
+ end
+ end
+ end
+ end
+ end
+ end
+
+ def test_tracepoints_identifiable
+ point = gpx_files(:identifiable_trace_file)
+ minlon = point.longitude-0.002
+ minlat = point.latitude-0.002
+ maxlon = point.longitude+0.002
+ maxlat = point.latitude+0.002
+ bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}"
+ get :trackpoints, :bbox => bbox
+ #print @response.body
+ assert_response :success
+ assert_select "gpx[version=1.0][creator=OpenStreetMap.org][xmlns=http://www.topografix.com/GPX/1/0/]:root", :count => 1 do
+ assert_select "trk", :count => 1 do
+ assert_select "trk>name", :count => 1
+ assert_select "trk>desc", :count => 1
+ assert_select "trk>url", :count => 1
+ assert_select "trkseg", :count => 1 do
+ assert_select "trkpt", :count => 1 do
+ assert_select "time", :count => 1
+ end
+ end
+ end
+ end
+ end
+
def test_map_without_bbox
["trackpoints", "map"].each do |tq|
get tq
user = users(:public_user)
get :list, {:format => "html", :display_name => user.display_name}
assert_response :success
- assert_template "list"
+ assert_template "changeset/_user"
## FIXME need to add more checks to see which if edits are actually shown if your data is public
end
lat = 3.434
lon = 3.23
+ # test that the upload is rejected when xml is valid, but osm doc isn't
+ content("<create/>")
+ put :create
+ assert_response :bad_request, "node upload did not return bad_request status"
+ assert_equal "Cannot parse valid node from xml string <create/>. XML doesn't contain an osm/node element.", @response.body
+
# test that the upload is rejected when no lat is supplied
# create a minimal xml file
content("<osm><node lon='#{lon}' changeset='#{changeset.id}'/></osm>")
assert_response :bad_request,
"should not be able to delete a node with a different ID from the XML"
+ # try to delete a node rubbish in the payloads
+ content("<delete/>")
+ delete :delete, :id => current_nodes(:visible_node).id
+ assert_response :bad_request,
+ "should not be able to delete a node without a valid XML payload"
+
# valid delete now takes a payload
content(nodes(:public_visible_node).to_xml)
delete :delete, :id => current_nodes(:public_visible_node).id
assert_response :bad_request,
"should not be able to update a node with a different ID from the XML"
+ ## try an update with a minimal valid XML doc which isn't a well-formed OSM doc.
+ content "<update/>"
+ put :update, :id => current_nodes(:visible_node).id
+ assert_response :bad_request,
+ "should not be able to update a node with non-OSM XML doc."
+
## finally, produce a good request which should work
content current_nodes(:public_visible_node).to_xml
put :update, :id => current_nodes(:public_visible_node).id
api_fixtures
def test_trace_count
- assert_equal 2, Trace.count
+ assert_equal 4, Trace.count
end
end
api_fixtures
def test_tracepoint_count
- assert_equal 1, Tracepoint.count
+ assert_equal 4, Tracepoint.count
end
end