Merge 14059:14394 from trunk.

This commit is contained in:
Tom Hughes 2009-04-08 13:53:09 +00:00
commit 1f8a68371a
13 changed files with 51 additions and 35 deletions

View file

@ -304,20 +304,37 @@ class TraceController < ApplicationController
private
def do_create(file, tags, description, public)
# Sanitise the user's filename
name = file.original_filename.gsub(/[^a-zA-Z0-9.]/, '_')
# Get a temporary filename...
filename = "/tmp/#{rand}"
# ...and save the uploaded file to that location
File.open(filename, "w") { |f| f.write(file.read) }
@trace = Trace.new({:name => name, :tagstring => tags,
:description => description, :public => public})
@trace.inserted = false
@trace.user = @user
@trace.timestamp = Time.now.getutc
# Create the trace object, falsely marked as already
# inserted to stop the import daemon trying to load it
@trace = Trace.new({
:name => name,
:tagstring => tags,
:description => description,
:public => public,
:inserted => true,
:user => @user,
:timestamp => Time.now.getutc
})
# Save the trace object
if @trace.save
# Rename the temporary file to the final name
FileUtils.mv(filename, @trace.trace_name)
# Clear the inserted flag to make the import daemon load the trace
@trace.inserted = false
@trace.save!
else
# Remove the file as we have failed to update the database
FileUtils.rm_f(filename)
end

View file

@ -102,7 +102,7 @@
<% end %>
<% if false %>
<div id="donate">
<div id="donate" class="notice">
Support OpenStreetMap by
<a href="http://donate.openstreetmap.org/">donating</a>
to the Hardware Upgrade Fund.
@ -116,6 +116,12 @@
<%= yield :left_menu %>
</div>
<div id="sotm" class="notice">
Come to the 2009 OpenStreetMap
Conference, <a href="http://www.stateofthemap.org">The State
of the Map</a>, July 10-12 in Amsterdam!
</div>
<%= yield :optionals %>
<center>

View file

@ -9,7 +9,8 @@
if (zoomlevel<7 ) { var imgname = 'keymapnik6.png'; }
else if (zoomlevel<13) { var imgname = 'keymapnik'+zoomlevel+'.png'; }
else { var imgname = 'keymapnik13.png'; }
else if (zoomlevel<15) { var imgname = 'keymapnik13.png'; }
else { var imgname = 'keymapnik15.png'; }
updateSidebar("Map key", "<p><img src='images/"+imgname+"' /><\/p>");
openSidebar({ width: "210px" });

View file

@ -58,7 +58,7 @@ evasive.max-conns-per-ip = 20
mimetype.assign = (
".css" => "text/css",
".gif" => "image/gif",
".html" => "text/html",
".html" => "text/html; charset=utf-8",
".js" => "application/x-javascript",
".png" => "image/png",
".swf" => "application/x-shockwave-flash",

View file

@ -1,6 +1,17 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>OpenStreetMap Embedded</title>
<style type="text/css">
html {
width: 100%;
height: 100%;
}
body {
width: 100%;
height: 100%;
margin: 0px;
}
#map {
width: 100%;
height: 100%;
@ -9,9 +20,10 @@
bottom: 3px!important;
}
</style>
<script src="http://openstreetmap.org/openlayers/OpenLayers.js"></script>
<script src="http://openstreetmap.org/openlayers/OpenStreetMap.js"></script>
<script src="http://openstreetmap.org/openlayers/OpenLayers.js" type="text/javascript"></script>
<script src="http://openstreetmap.org/openlayers/OpenStreetMap.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var map, layer;
function init(){
map = new OpenLayers.Map ("map", {
@ -74,8 +86,10 @@
map.addControl(new OpenLayers.Control.PanZoom());
}
}
// -->
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View file

@ -83,7 +83,7 @@ body {
font-size: 14px;
}
#donate {
.notice {
width: 150px;
margin: 10px;
padding: 10px;
@ -91,7 +91,7 @@ body {
background: #ea0;
line-height: 1.2em;
text-align: left;
font-size: 12px;
font-size: 14px;
}
.left_menu {
@ -572,28 +572,6 @@ input[type="submit"] {
padding: 2px;
}
/**State of the Map */
#sotminfo {
background: #99F;
font-size: 11px;
margin: 0px;
padding: 0px;
border: 1px solid #ccc;
left: 0px;
line-height: 1.2em;
text-align: Left;
font-weight: normal;
}
#sotminfo a:link {
text-decoration: underline;
}
#sotminfo a:visited {
text-decoration: underline;
}
#permalink {
z-index:10000;
position:absolute;