Merge 14059:14394 from trunk.
authorTom Hughes <tom@compton.nu>
Wed, 8 Apr 2009 13:53:09 +0000 (13:53 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 8 Apr 2009 13:53:09 +0000 (13:53 +0000)
13 files changed:
app/controllers/trace_controller.rb
app/views/layouts/site.rhtml
app/views/site/_key.rhtml
config/lighttpd.conf
public/export/embed.html
public/images/keymapnik12.png
public/images/keymapnik13.png
public/images/keymapnik15.png [new file with mode: 0644]
public/images/keymapnik6.png
public/images/keymapnik7.png
public/images/keymapnik8.png
public/images/keymapnik9.png
public/stylesheets/site.css

index c0a0b36b53274809f365638a9f4378bba2bba15c..b52be7f349bbb83af740eae7b48a0d5c315919b7 100644 (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
     
index 49c0ae3769f4bd0ca7b3f7e625a30931baf3aeeb..bc51fa98b3a576eaee6ec6d89ead45607f271da7 100644 (file)
       <% 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.
         <%= 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>
index c632f16617c6cb2662bacef45a3a80309096f466..f800bbb9767cc29cc3266d87179956dba7c1fbf4 100644 (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" });
index 5cc3134b54b4e15b2aa48d6c28089d22a1438ce1..419f25e3266fb26cb78a5ddbca31de83c1a26fb7 100644 (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",
index af45a6b1f99cea1eb631c0e19a6863d76763a128..20e1d2ac9672c0fddb66917d8485626aac8178e9 100644 (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", {
                 map.addControl(new OpenLayers.Control.PanZoom());
             }
         }
+    // -->
     </script>
   </head>
+
   <body onload="init()">
     <div id="map"></div>
   </body>
index 44bffb81071cc6b8eace95ac08400c80a88e45dd..2d83b8cf97845efb617591c33174ce423fcdd951 100644 (file)
Binary files a/public/images/keymapnik12.png and b/public/images/keymapnik12.png differ
index cb0e3dffb346417c946f91d3c373588e5f5731f0..51153869c7025e7aa2335ce37d3c24a31224aa88 100644 (file)
Binary files a/public/images/keymapnik13.png and b/public/images/keymapnik13.png differ
diff --git a/public/images/keymapnik15.png b/public/images/keymapnik15.png
new file mode 100644 (file)
index 0000000..51b7335
Binary files /dev/null and b/public/images/keymapnik15.png differ
index a4436791510b7a81db59ec8b3b450fe704dd1d58..e2b5b1ddedab8d9333a4cabdbab930019688ee5f 100644 (file)
Binary files a/public/images/keymapnik6.png and b/public/images/keymapnik6.png differ
index edbee1261d830515ed8f1cd486f5bd2038a2763c..c917631c55897b6bd147d0b2dbba414b6848a4b7 100644 (file)
Binary files a/public/images/keymapnik7.png and b/public/images/keymapnik7.png differ
index 374d5a9f976a7103040115a11d4addf510da8414..948cc1c854fe458af9960a3379d028fdf2cccf73 100644 (file)
Binary files a/public/images/keymapnik8.png and b/public/images/keymapnik8.png differ
index a7eb550de7ec57e010854e96fc191a7ba8bc4932..4ab9f8b2dfe706922e0a1d2ef0855ee017e655b1 100644 (file)
Binary files a/public/images/keymapnik9.png and b/public/images/keymapnik9.png differ
index 87d325ddb0c4437445461ead3816be3d0797c505..0bab9c57ff4232d3f8a68638edfe0a75a0f587a3 100644 (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;