Merge 7452:7744 from trunk.
This commit is contained in:
commit
5620d7263a
37 changed files with 435 additions and 96 deletions
|
@ -594,8 +594,8 @@ class AmfController < ApplicationController
|
|||
# the delete_with_relations_and_nodes_and_history method should do this,
|
||||
# but at present it just throws a 'precondition failed'
|
||||
way=way.to_i
|
||||
db_now='@now'+(rand*100).to_i.to_s+uid.to_s+id.to_i.abs.to_s+Time.new.to_i.to_s
|
||||
db_uqn='unin'+(rand*100).to_i.to_s+uid.to_s+way.to_i.abs.to_s+Time.new.to_i.to_s
|
||||
db_now='@now'+(rand*100).to_i.to_s+uid.to_s+way.abs.to_s+Time.new.to_i.to_s
|
||||
db_uqn='unin'+(rand*100).to_i.to_s+uid.to_s+way.abs.to_s+Time.new.to_i.to_s
|
||||
ActiveRecord::Base.connection.execute("SET #{db_now}=NOW()")
|
||||
createuniquenodes(way,db_uqn,[])
|
||||
deleteuniquenoderelations(db_uqn,uid,db_now)
|
||||
|
|
|
@ -30,11 +30,16 @@ class DiaryEntryController < ApplicationController
|
|||
def list
|
||||
if params[:display_name]
|
||||
@this_user = User.find_by_display_name(params[:display_name])
|
||||
@title = @this_user.display_name + "'s diary"
|
||||
@entry_pages, @entries = paginate(:diary_entries,
|
||||
:conditions => ['user_id = ?', @this_user.id],
|
||||
:order => 'created_at DESC',
|
||||
:per_page => 20)
|
||||
if @this_user
|
||||
@title = @this_user.display_name + "'s diary"
|
||||
@entry_pages, @entries = paginate(:diary_entries,
|
||||
:conditions => ['user_id = ?', @this_user.id],
|
||||
:order => 'created_at DESC',
|
||||
:per_page => 20)
|
||||
else
|
||||
@not_found_user = params[:display_name]
|
||||
render :action => 'no_such_user', :status => :not_found
|
||||
end
|
||||
else
|
||||
@title = "Users' diaries"
|
||||
@entry_pages, @entries = paginate(:diary_entries,
|
||||
|
|
|
@ -17,13 +17,17 @@ class MessageController < ApplicationController
|
|||
Notifier::deliver_message_notification(@message)
|
||||
redirect_to :controller => 'message', :action => 'inbox', :display_name => @user.display_name
|
||||
end
|
||||
else
|
||||
@title = params[:title]
|
||||
end
|
||||
end
|
||||
|
||||
def reply
|
||||
message = Message.find(params[:message_id], :conditions => ["to_user_id = ? or from_user_id = ?", @user.id, @user.id ])
|
||||
title = message.title.sub(/^Re:\s*/, "Re: ")
|
||||
redirect_to :action => 'new', :user_id => message.from_user_id, :title => title
|
||||
@body = "On #{message.sent_on} #{message.sender.display_name} wrote:\n\n#{message.body.gsub(/^/, '> ')}"
|
||||
@title = "Re: #{message.title.sub(/^Re:\s*/, '')}"
|
||||
@user_id = message.from_user_id
|
||||
render :action => 'new'
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render :nothing => true, :status => :not_found
|
||||
end
|
||||
|
|
|
@ -83,14 +83,17 @@ class TraceController < ApplicationController
|
|||
|
||||
def view
|
||||
@trace = Trace.find(params[:id])
|
||||
@title = "Viewing trace #{@trace.name}"
|
||||
if !@trace.visible?
|
||||
render :nothing => true, :status => :not_found
|
||||
elsif !@trace.public? and @trace.user.id != @user.id
|
||||
render :nothing => true, :status => :forbidden
|
||||
|
||||
if @trace and @trace.visible? and
|
||||
(@trace.public? or @trace.user.id == @user.id)
|
||||
@title = "Viewing trace #{@trace.name}"
|
||||
else
|
||||
flash[:notice] = "Trace not found!"
|
||||
redirect_to :controller => 'trace', :action => 'list'
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render :nothing => true, :status => :not_found
|
||||
flash[:notice] = "Trace not found!"
|
||||
redirect_to :controller => 'trace', :action => 'list'
|
||||
end
|
||||
|
||||
def create
|
||||
|
@ -196,7 +199,7 @@ class TraceController < ApplicationController
|
|||
conditions[0] += " AND users.display_name = ?"
|
||||
conditions << params[:display_name]
|
||||
end
|
||||
|
||||
|
||||
if params[:tag]
|
||||
conditions[0] += " AND EXISTS (SELECT * FROM gpx_file_tags AS gft WHERE gft.gpx_id = gpx_files.id AND gft.tag = ?)"
|
||||
conditions << params[:tag]
|
||||
|
|
|
@ -11,6 +11,8 @@ class UserController < ApplicationController
|
|||
@title = 'create account'
|
||||
@user = User.new(params[:user])
|
||||
|
||||
@user.data_public = true
|
||||
|
||||
if @user.save
|
||||
token = @user.tokens.create
|
||||
flash[:notice] = "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br>Please note that you won't be able to login until you've received and confirmed your email address."
|
||||
|
@ -179,7 +181,8 @@ class UserController < ApplicationController
|
|||
if @this_user
|
||||
@title = @this_user.display_name
|
||||
else
|
||||
render :nothing => true, :status => :not_found
|
||||
@not_found_user = params[:display_name]
|
||||
render :action => 'no_such_user', :status => :not_found
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,8 +1,41 @@
|
|||
# Update and read user preferences, which are arbitrayr key/val pairs
|
||||
class UserPreferenceController < ApplicationController
|
||||
before_filter :authorize
|
||||
|
||||
def read
|
||||
def read_one
|
||||
pref = UserPreference.find(@user.id, params[:preference_key])
|
||||
|
||||
if pref
|
||||
render :text => pref.v.to_s
|
||||
else
|
||||
render :text => 'OH NOES! PREF NOT FOUND!', :status => 404
|
||||
end
|
||||
end
|
||||
|
||||
def update_one
|
||||
begin
|
||||
pref = UserPreference.find(@user.id, params[:preference_key])
|
||||
pref.v = request.raw_post.chomp
|
||||
pref.save
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
pref = UserPreference.new
|
||||
pref.user = @user
|
||||
pref.k = params[:preference_key]
|
||||
pref.v = request.raw_post.chomp
|
||||
pref.save
|
||||
end
|
||||
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
def delete_one
|
||||
UserPreference.delete(@user.id, params[:preference_key])
|
||||
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
# print out all the preferences as a big xml block
|
||||
def read
|
||||
doc = OSM::API.new.get_xml_doc
|
||||
|
||||
prefs = @user.preferences
|
||||
|
@ -15,9 +48,9 @@ class UserPreferenceController < ApplicationController
|
|||
|
||||
doc.root << el1
|
||||
render :text => doc.to_s, :content_type => "text/xml"
|
||||
|
||||
end
|
||||
|
||||
# update the entire set of preferences
|
||||
def update
|
||||
begin
|
||||
p = XML::Parser.new
|
||||
|
@ -30,12 +63,12 @@ class UserPreferenceController < ApplicationController
|
|||
|
||||
doc.find('//preferences/preference').each do |pt|
|
||||
pref = UserPreference.new
|
||||
|
||||
|
||||
unless keyhash[pt['k']].nil? # already have that key
|
||||
render :text => 'OH NOES! CAN HAS UNIQUE KEYS?', :status => :not_acceptable
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
keyhash[pt['k']] = 1
|
||||
|
||||
pref.k = pt['k']
|
||||
|
@ -64,5 +97,4 @@ class UserPreferenceController < ApplicationController
|
|||
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -2,4 +2,8 @@ module ApplicationHelper
|
|||
def htmlize(text)
|
||||
return sanitize(auto_link(simple_format(text), :urls))
|
||||
end
|
||||
|
||||
def rss_link_to(*args)
|
||||
return link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), Hash[*args], { :class => "rsssmall" });
|
||||
end
|
||||
end
|
||||
|
|
|
@ -35,6 +35,8 @@ class Notifier < ActionMailer::Base
|
|||
headers "Auto-Submitted" => "auto-generated"
|
||||
body :trace_name => trace.name,
|
||||
:trace_points => trace.size,
|
||||
:trace_description => trace.description,
|
||||
:trace_tags => trace.tags,
|
||||
:possible_points => possible_points
|
||||
end
|
||||
|
||||
|
@ -44,6 +46,8 @@ class Notifier < ActionMailer::Base
|
|||
subject "[OpenStreetMap] GPX Import failure"
|
||||
headers "Auto-Submitted" => "auto-generated"
|
||||
body :trace_name => trace.name,
|
||||
:trace_description => trace.description,
|
||||
:trace_tags => trace.tags,
|
||||
:error => error
|
||||
end
|
||||
|
||||
|
|
|
@ -191,6 +191,7 @@ class Trace < ActiveRecord::Base
|
|||
if first
|
||||
f_lat = point['latitude']
|
||||
f_lon = point['longitude']
|
||||
first = false
|
||||
end
|
||||
|
||||
tp = Tracepoint.new
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
class UserPreference < ActiveRecord::Base
|
||||
set_primary_keys :user_id, :k
|
||||
belongs_to :user
|
||||
|
||||
# Turn this Node in to an XML Node without the <osm> wrapper.
|
||||
|
|
|
@ -28,5 +28,5 @@
|
|||
|
||||
<br />
|
||||
|
||||
<%= link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), :action => 'rss') %>
|
||||
<%= auto_discovery_link_tag(:atom, :action => 'rss') %>
|
||||
<%= rss_link_to :action => 'rss' %>
|
||||
<%= auto_discovery_link_tag :atom, :action => 'rss' %>
|
||||
|
|
|
@ -11,10 +11,13 @@
|
|||
<td><%= f.text_area :body, :cols => 80 %></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>Location</th>
|
||||
<td><a name="map"></a><div id="map" style="border: 1px solid black; position: relative; width : 90%; height : 400px; display: none;"></div>
|
||||
<span class="location">Latitude: <%= f.text_field :latitude, :size => 20, :id => "latitude" %> Longitude: <%= f.text_field :longitude, :size => 20, :id => "longitude" %></span> <a href="#map" id="usemap" onclick="document.getElementById('map').style.display = 'block'; document.getElementById('usemap').style.display = 'none';">use map</a> </td>
|
||||
</tr>
|
||||
<th>Location</th>
|
||||
<td>
|
||||
<div id="map" style="border: 1px solid black; position: relative; width : 90%; height : 400px; display: none;"></div>
|
||||
<span class="location">Latitude: <%= f.text_field :latitude, :size => 20, :id => "latitude" %> Longitude: <%= f.text_field :longitude, :size => 20, :id => "longitude" %></span>
|
||||
<a href="javascript:openMap()" id="usemap">use map</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><%= submit_tag 'Save' %></td>
|
||||
|
@ -40,7 +43,7 @@
|
|||
<!--
|
||||
var marker;
|
||||
|
||||
function init(){
|
||||
function init() {
|
||||
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
|
||||
var zoom = <%= zoom %>;
|
||||
|
||||
|
@ -63,7 +66,12 @@
|
|||
removeMarkerFromMap(marker);
|
||||
}
|
||||
|
||||
marker = addMarkerToMap(merc, null, "Diary entry location");
|
||||
marker = addMarkerToMap(lonlat, null, "Diary entry location");
|
||||
}
|
||||
|
||||
function openMap() {
|
||||
$("map").style.display = "block";
|
||||
$("usemap").style.display = "none";
|
||||
}
|
||||
|
||||
window.onload = init;
|
||||
|
|
2
app/views/diary_entry/no_such_user.rhtml
Normal file
2
app/views/diary_entry/no_such_user.rhtml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<h2><%= h(@not_found_user) %></h2>
|
||||
<p>Sorry, there is no user with the name <%= @not_found_user -%>. Please check your spelling, or maybe the link you clicked is wrong.</p>
|
|
@ -18,11 +18,13 @@
|
|||
|
||||
<div class="export_details">
|
||||
<p>
|
||||
<%= radio_button_tag("format", "osm") %>OpenStreetMap XML Data
|
||||
<%= radio_button_tag("format", "osm") %> OpenStreetMap XML Data
|
||||
<br/>
|
||||
<%= radio_button_tag("format", "mapnik") %>Mapnik Image
|
||||
<%= radio_button_tag("format", "mapnik") %> Mapnik Image
|
||||
<br/>
|
||||
<%= radio_button_tag("format", "osmarender") %>Osmarender Image
|
||||
<%= radio_button_tag("format", "osmarender") %> Osmarender Image
|
||||
<br/>
|
||||
<%= radio_button_tag("format", "html") %> Embeddable HTML
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -52,6 +54,23 @@
|
|||
<p>Zoom <%= select_tag("osmarender_zoom", options_for_select([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])) %></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="export_html">
|
||||
<p class="export_heading">Options</p>
|
||||
<div class="export_details">
|
||||
<p><a id="add_marker" href="#">Add a marker to the map</a></p>
|
||||
<p id="marker_inputs" style="display:none">
|
||||
Lat: <input type="text" id="marker_lat" size="9" />
|
||||
Lon: <input type="text" id="marker_lon" size="9" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="export_heading">Output</p>
|
||||
<div class="export_details">
|
||||
<p><input type="text" id="export_html_text" style="width:95%" /></p>
|
||||
<p>Paste HTML to embed in website</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="export_buttons">
|
||||
<p><%= submit_tag "Export", :id => "export_commit" %></p>
|
||||
|
|
|
@ -3,6 +3,8 @@ page.replace_html :sidebar_content, :partial => 'start'
|
|||
page << <<EOJ
|
||||
var vectors;
|
||||
var box;
|
||||
var markerLayer;
|
||||
var markerControl;
|
||||
|
||||
function startExport() {
|
||||
vectors = new OpenLayers.Layer.Vector("Vector Layer", {
|
||||
|
@ -22,11 +24,10 @@ page << <<EOJ
|
|||
map.addControl(box);
|
||||
|
||||
map.events.register("moveend", map, mapMoved);
|
||||
map.events.register("changebaselayer", map, htmlUrlChanged);
|
||||
|
||||
openSidebar({ onclose: stopExport });
|
||||
|
||||
setBounds(map.getExtent());
|
||||
|
||||
if (map.baseLayer.name == "Mapnik") {
|
||||
$("format_mapnik").checked = true;
|
||||
} else if (map.baseLayer.name == "Osmarender") {
|
||||
|
@ -34,6 +35,7 @@ page << <<EOJ
|
|||
}
|
||||
|
||||
formatChanged();
|
||||
setBounds(map.getExtent());
|
||||
|
||||
$("viewanchor").className = "";
|
||||
$("exportanchor").className = "active";
|
||||
|
@ -44,7 +46,9 @@ page << <<EOJ
|
|||
$("exportanchor").className = "";
|
||||
|
||||
clearBox();
|
||||
clearMarker();
|
||||
map.events.unregister("moveend", map, mapMoved);
|
||||
map.events.unregister("changebaselayer", map, htmlUrlChanged);
|
||||
map.removeLayer(vectors);
|
||||
}
|
||||
|
||||
|
@ -93,6 +97,66 @@ page << <<EOJ
|
|||
$("drag_box").innerHTML = "Manually select a different area";
|
||||
}
|
||||
|
||||
function startMarker() {
|
||||
$("add_marker").innerHTML='Click on the map to add a marker';
|
||||
|
||||
if (!markerLayer) {
|
||||
markerLayer = new OpenLayers.Layer.Vector("",{
|
||||
displayInLayerSwitcher: false,
|
||||
style: {
|
||||
externalGraphic: OpenLayers.Util.getImagesLocation() + "marker.png",
|
||||
graphicXOffset: -10.5,
|
||||
graphicYOffset: -25,
|
||||
graphicWidth: 21,
|
||||
graphicHeight: 25
|
||||
}
|
||||
});
|
||||
map.addLayer(markerLayer);
|
||||
|
||||
markerControl = new OpenLayers.Control.DrawFeature(markerLayer, OpenLayers.Handler.Point);
|
||||
map.addControl(markerControl);
|
||||
|
||||
markerLayer.events.on({ "featureadded": endMarker });
|
||||
}
|
||||
|
||||
markerLayer.destroyFeatures();
|
||||
markerControl.activate();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$("add_marker").onclick = startMarker;
|
||||
|
||||
function endMarker(event) {
|
||||
markerControl.deactivate();
|
||||
|
||||
$("add_marker").innerHTML = "Change marker position";
|
||||
$("marker_inputs").style.display = "block";
|
||||
|
||||
var epsg4326 = new OpenLayers.Projection("EPSG:4326");
|
||||
var epsg900913 = new OpenLayers.Projection("EPSG:900913");
|
||||
var geom = event.feature.geometry.clone().transform(epsg900913, epsg4326);
|
||||
|
||||
$("marker_lon").value = geom.x.toFixed(5);
|
||||
$("marker_lat").value = geom.y.toFixed(5);
|
||||
|
||||
htmlUrlChanged();
|
||||
}
|
||||
|
||||
function clearMarker() {
|
||||
$("marker_lon").value = "";
|
||||
$("marker_lat").value = "";
|
||||
$("marker_inputs").style.display = "none";
|
||||
$("add_marker").innerHTML = "Add a marker to the map";
|
||||
|
||||
if (markerLayer) {
|
||||
markerControl.destroy();
|
||||
markerLayer.destroy();
|
||||
markerLayer = null;
|
||||
markerControl = null;
|
||||
}
|
||||
}
|
||||
|
||||
function mapMoved() {
|
||||
setBounds(map.getExtent());
|
||||
validateControls();
|
||||
|
@ -110,6 +174,7 @@ page << <<EOJ
|
|||
$("maxlat").value = Math.round(bounds.top * decimals) / decimals;
|
||||
|
||||
mapnikSizeChanged();
|
||||
htmlUrlChanged();
|
||||
}
|
||||
|
||||
function clearBox() {
|
||||
|
@ -160,7 +225,39 @@ page << <<EOJ
|
|||
}
|
||||
}
|
||||
|
||||
function htmlUrlChanged() {
|
||||
var bounds = new OpenLayers.Bounds($("minlon").value, $("minlat").value, $("maxlon").value, $("maxlat").value);
|
||||
var layerName = map.baseLayer.name.toLowerCase();
|
||||
var url = "http://#{SERVER_URL}/export/embed.html?bbox=" + bounds.toBBOX() + "&layer=" + layerName;
|
||||
var markerUrl = "";
|
||||
|
||||
if ($("marker_lat").value && $("marker_lon").value) {
|
||||
markerUrl = "&mlat=" + $("marker_lat").value + "&mlon=" + $("marker_lon").value;
|
||||
url += "&marker=" + $("marker_lat").value + "," + $("marker_lon").value;
|
||||
}
|
||||
|
||||
var html = '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+url+'" style="border: 1px solid black"></iframe>';
|
||||
|
||||
// Create "larger map" link
|
||||
var center = bounds.getCenterLonLat();
|
||||
var epsg4326 = new OpenLayers.Projection("EPSG:4326");
|
||||
var epsg900913 = new OpenLayers.Projection("EPSG:900913");
|
||||
|
||||
bounds.transform(epsg4326, epsg900913);
|
||||
var zoom = map.getZoomForExtent(bounds);
|
||||
|
||||
html += '<br /><small><a href="http://#{SERVER_URL}/?lat='+center.lat+'&lon='+center.lon+'&zoom='+zoom+markerUrl+'">View Larger Map</a></small>';
|
||||
|
||||
$("export_html_text").value = html;
|
||||
|
||||
if ($("format_html").checked) {
|
||||
$("export_html_text").select();
|
||||
}
|
||||
}
|
||||
|
||||
function formatChanged() {
|
||||
$("export_commit").style.display = "inline";
|
||||
|
||||
if ($("format_osm").checked) {
|
||||
$("export_osm").style.display = "inline";
|
||||
} else {
|
||||
|
@ -183,12 +280,22 @@ page << <<EOJ
|
|||
$("export_osmarender").style.display = "none";
|
||||
}
|
||||
|
||||
if ($("format_html").checked) {
|
||||
$("export_html").style.display = "inline";
|
||||
$("export_commit").style.display = "none";
|
||||
$("export_html_text").select();
|
||||
} else {
|
||||
$("export_html").style.display = "none";
|
||||
clearMarker();
|
||||
}
|
||||
|
||||
validateControls();
|
||||
}
|
||||
|
||||
$("format_osm").onclick = formatChanged;
|
||||
$("format_mapnik").onclick = formatChanged;
|
||||
$("format_osmarender").onclick = formatChanged;
|
||||
$("format_html").onclick = formatChanged;
|
||||
|
||||
function maxMapnikScale() {
|
||||
var bounds = new OpenLayers.Bounds($("minlon").value, $("minlat").value, $("maxlon").value, $("maxlat").value);
|
||||
|
|
|
@ -95,6 +95,12 @@
|
|||
<%= yield :left_menu %>
|
||||
</div>
|
||||
|
||||
<div id="sotm" class="left_menu">
|
||||
<div id="sotminfo">
|
||||
Come to the second OpenStreetMap Conference, <a href="http://www.stateofthemap.org">The State of the Map</a>: 12th-13th July 2008, Limerick, Ireland.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= yield :optionals %>
|
||||
<div id="cclogo">
|
||||
<center>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% display_name = User.find_by_id(params[:user_id]).display_name %>
|
||||
<% title = params[:message] ? params[:message][:title] : params[:title] %>
|
||||
<% user_id = params[:user_id] || @user_id %>
|
||||
<% display_name = User.find_by_id(user_id).display_name %>
|
||||
|
||||
<h2>Send a new message to <%= h(display_name) %></h2>
|
||||
|
||||
|
@ -10,19 +10,19 @@
|
|||
|
||||
<%= error_messages_for 'message' %>
|
||||
|
||||
<% form_for :message do |f| %>
|
||||
<% form_for :message, :url => { :action => "new", :user_id => user_id } do |f| %>
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<th>Subject</th>
|
||||
<td><%= text_field_tag 'message[title]', title, :size => 60 %></td>
|
||||
<td><%= f.text_field :title, :size => 60, :value => @title %></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>Body</th>
|
||||
<td><%= f.text_area :body, :cols => 80 %></td>
|
||||
<td><%= f.text_area :body, :cols => 80, :value => @body %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><%= submit_tag 'Send' %></td>
|
||||
<td><%= submit_tag 'Send', :action => 'new' %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
|
14
app/views/notifier/_gpx_description.rhtml
Normal file
14
app/views/notifier/_gpx_description.rhtml
Normal file
|
@ -0,0 +1,14 @@
|
|||
Hi,
|
||||
|
||||
It looks like your GPX file
|
||||
|
||||
<%= @trace_name %>
|
||||
|
||||
with the description
|
||||
|
||||
<%= @trace_description %>
|
||||
<% if @trace_tags.length>0 %>
|
||||
and the following tags:
|
||||
<% @trace_tags.each do |tag| %>
|
||||
<%= tag.tag.rstrip %><% end %><% else %>
|
||||
and no tags.<% end %>
|
|
@ -1,9 +1,4 @@
|
|||
Hi,
|
||||
|
||||
It looks like your GPX file
|
||||
|
||||
<%= @trace_name %>
|
||||
|
||||
<%= render :partial => "gpx_description" %>
|
||||
failed to import. Here's the error:
|
||||
|
||||
<%= @error %>
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
Hi,
|
||||
|
||||
It looks like your GPX file
|
||||
|
||||
<%= @trace_name %>
|
||||
|
||||
<%= render :partial => "gpx_description" %>
|
||||
loaded successfully with <%= @trace_points %> out of a possible
|
||||
<%= @possible_points %> points.
|
||||
|
|
|
@ -6,3 +6,9 @@
|
|||
<p>If this is you, please click the link below to confirm that account.</p>
|
||||
|
||||
<p><a href="<%= @url %>"><%= @url %></a></p>
|
||||
|
||||
<p>You may also want to <a href="http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page">sign up to the OpenStreetMap wiki</a>.</p>
|
||||
|
||||
<p>It is recommended that you create a user wiki page, which includes category tags noting where you are, such as <a href="http://wiki.openstreetmap.org/index.php/Category:Users_in_London">[[Category:Users_in_London]]</a>.</p>
|
||||
|
||||
<p>A list of current users in categories, based on where in the world they are, is available from <a href="http://wiki.openstreetmap.org/index.php/Category:Users_by_geographical_region">Category:Users_by_geographical_region</a>.</p>
|
||||
|
|
|
@ -6,3 +6,15 @@ Someone (hopefully you) would like to create an account over at
|
|||
If this is you, please click the link below to confirm that account.
|
||||
|
||||
<%= @url %>
|
||||
|
||||
You may also want to sign up to the OpenStreetMap wiki at:
|
||||
|
||||
http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page
|
||||
|
||||
It is recommended that you create a user wiki page, which includes
|
||||
category tags noting where you are, such as [[Category:Users_in_London]].
|
||||
|
||||
A list of current users in categories, based on where in the world
|
||||
they are, is available from:
|
||||
|
||||
http://wiki.openstreetmap.org/index.php/Category:Users_by_geographical_region
|
||||
|
|
|
@ -38,7 +38,13 @@
|
|||
<% form_remote_tag(:loading => "startSearch()",
|
||||
:complete => "endSearch()",
|
||||
:url => { :controller => :geocoder, :action => :search }) do %>
|
||||
<%= text_field_tag :query, h(params[:query]) %>
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= text_field_tag :query, h(params[:query]) %></td>
|
||||
<td></td>
|
||||
<td><%= submit_tag 'Go' %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</span>
|
||||
<p id="search_active">Searching...</p>
|
||||
|
|
|
@ -24,29 +24,27 @@
|
|||
<% session[:token] = @user.tokens.create.token unless session[:token] %>
|
||||
|
||||
<% if params['mlon'] and params['mlat'] %>
|
||||
<% lon = h(params['mlon']) %>
|
||||
<% lat = h(params['mlat']) %>
|
||||
<% zoom = h(params['zoom'] || '14') %>
|
||||
<% lon = h(params['mlon']) %>
|
||||
<% lat = h(params['mlat']) %>
|
||||
<% zoom = h(params['zoom'] || '14') %>
|
||||
<% elsif @user and params['lon'].nil? and params['lat'].nil? and params['gpx'].nil? %>
|
||||
<% lon = @user.home_lon %>
|
||||
<% lat = @user.home_lat %>
|
||||
<% zoom = '14' %>
|
||||
<% elsif params['gpx'].nil? %>
|
||||
<% lon = h(params['lon'] || '-0.1') %>
|
||||
<% lat = h(params['lat'] || '51.5') %>
|
||||
<% zoom = h(params['zoom'] || '14') %>
|
||||
<% lon = @user.home_lon %>
|
||||
<% lat = @user.home_lat %>
|
||||
<% zoom = '14' %>
|
||||
<% else %>
|
||||
<% lon = nil %>
|
||||
<% lat = nil %>
|
||||
<% zoom = '14' %>
|
||||
<% lon = h(params['lon'] || 'null') %>
|
||||
<% lat = h(params['lat'] || 'null') %>
|
||||
<% zoom = h(params['zoom'] || '14') %>
|
||||
<% end %>
|
||||
|
||||
<div id="map">You need a Flash player to use Potlatch, the
|
||||
<div id="map">
|
||||
You need a Flash player to use Potlatch, the
|
||||
OpenStreetMap Flash editor. You can <a href="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">download Flash Player from Adobe.com</a>.
|
||||
|
||||
<a href="http://wiki.openstreetmap.org/index.php/Editing">Several other options</a> are also available
|
||||
for editing OpenStreetMap.
|
||||
</div>
|
||||
|
||||
<%= javascript_include_tag 'swfobject.js' %>
|
||||
<script type="text/javascript" defer="defer">
|
||||
var brokenContentSize = $("content").offsetWidth == 0;
|
||||
|
@ -68,7 +66,7 @@
|
|||
if (lat) { fo.addVariable('lat',lat); }
|
||||
if (lon) { fo.addVariable('long',lon); }
|
||||
<% if params['gpx'] %>
|
||||
fo.addVariable('gpx','<%= h(params['gpx']) + "/data.xml" %>');
|
||||
fo.addVariable('gpx','<%= h(params['gpx']) %>');
|
||||
<% end %>
|
||||
fo.write("map");
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
Licensed under the Creative Commons Attribution-Share Alike 2.0 license
|
||||
by the OpenStreetMap project and it's contributors.
|
||||
by the OpenStreetMap project and its contributors.
|
||||
</td>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -1,15 +1,24 @@
|
|||
<h1><%= h(@title) %></h1>
|
||||
|
||||
<span class="rsssmall"><a href="<%= url_for :action => 'georss', :display_name => @display_name, :tag => @tag %>"><img src="/images/RSS.gif" border="0" alt="RSS" /></a></span>
|
||||
<% if @user.nil? or @display_name.nil? or @user.display_name != @display_name %>
|
||||
| <%= link_to 'See just your traces, or upload a trace', :action => 'mine' %>
|
||||
<% end %>
|
||||
<% if @tag or @display_name %>
|
||||
| <%= link_to 'See all traces', :controller => 'trace', :action => 'list' %>
|
||||
<% end %>
|
||||
<% if @tag and @user and @user.display_name == @display_name %>
|
||||
| <%= link_to 'See all your traces', :controller => 'trace', :action => 'mine' %>
|
||||
<% end %>
|
||||
<%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<p>
|
||||
<%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %>
|
||||
<% if @user.nil? or @display_name.nil? or @user.display_name != @display_name %>
|
||||
| <%= link_to 'See just your traces, or upload a trace', :action => 'mine' %>
|
||||
<% end %>
|
||||
<% if @tag or @display_name %>
|
||||
| <%= link_to 'See all traces', :controller => 'trace', :action => 'list' %>
|
||||
<% end %>
|
||||
<% if @tag and @user and @user.display_name == @display_name %>
|
||||
| <%= link_to 'See all your traces', :controller => 'trace', :action => 'mine' %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<% if @user and @user.traces.count(:conditions => "inserted=0") > 4 %>
|
||||
<p>
|
||||
You have <%= @user.traces.count(:conditions => "inserted=0") %> traces
|
||||
waiting for upload. Please consider waiting for these to finish before
|
||||
uploading any more, so as not to block the queue for other users.
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
@ -26,7 +26,9 @@
|
|||
<% if @user.data_public? %>
|
||||
All your edits are public.
|
||||
<% else %>
|
||||
Currently your edits are anonymous and people can't send you messages or see your location. To show what you edited and allow people to contact you through the website, click the button below. <b>You will need to do this if you want to use the online editor</b> (<a href="http://wiki.openstreetmap.org/index.php/Disabling_anonymous_edits">find out why</a>). This action cannot be reversed.
|
||||
Currently your edits are anonymous and people can't send you messages or see your location. To show what you edited and allow people to contact you through the website, click the button below.
|
||||
<b>You will need to do this if you want to use the online editor and it is encouraged</b> (<a href="http://wiki.openstreetmap.org/index.php/Disabling_anonymous_edits">find out why</a>).
|
||||
This action cannot be reversed and all new users are now public by default.
|
||||
<br /><br />
|
||||
<%= button_to "Make all my edits public, forever", :action => :go_public %>
|
||||
<%= button_to "Make all my edits public", :action => :go_public %>
|
||||
<% end %>
|
||||
|
|
2
app/views/user/no_such_user.rhtml
Normal file
2
app/views/user/no_such_user.rhtml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<h2><%= h(@not_found_user) %></h2>
|
||||
<p>Sorry, there is no user with the name <%= @not_found_user -%>. Please check your spelling, or maybe the link you clicked is wrong.</p>
|
Loading…
Add table
Add a link
Reference in a new issue