]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/layouts/site.rhtml
Remove old code to exit after 10000 requests as the memory limit code
[rails.git] / app / views / layouts / site.rhtml
index c2e4c9bfc3e4a5e4121d6474270c3d11f21c7e96..93abf3a5efac6ffd870e74a415f3aaaa8ea36d58 100644 (file)
@@ -1,49 +1,63 @@
-<html>
+<!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>
-    <%= javascript_include_tag 'main.js' %>
-    <!--[if IE]><%= javascript_include_tag 'pngfix.js' %><![endif]--> <!-- thanks, microsoft! -->
-    <%= javascript_include_tag 'tile.js' %>
-    <%= javascript_include_tag 'site.js' %>
-
-    <link rel="stylesheet" type="text/css" href="/stylesheets/site.css" />
-    <title>OpenStreetMap</title>
+    <%= javascript_include_tag 'prototype' %>
+    <%= javascript_include_tag 'site' %>
+    <!--[if lt IE 7]><%= javascript_include_tag 'pngfix' %><![endif]--> <!-- thanks, microsoft! -->
+    <%= stylesheet_link_tag 'site' %>
+    <%= stylesheet_link_tag 'print', :media => "print" %>
+    <%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => "/opensearch/osm.xml" }) %>
+    <%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %>
+    <%= yield :head %>
+    <title>OpenStreetMap<%= ' | '+ h(@title) if @title %></title>
   </head>
   <body>
-
-    <% if params[:controller] == 'site' and params[:action] == 'index' %>
-    <div id="map" style="border: 1px solid black; position: absolute; right: 5px; bottom: 5px; left: 200px; top: 70px;"></div> 
-    <% end %>
     <div id="content">
-      <% if flash[:notice] %>
-        <div id="notice"><%= flash[:notice] %></div>
+      <% if @notice || flash[:notice] %>
+        <div id="notice"><%= @notice || flash[:notice] %></div>
       <% end %>
 
       <%= yield %>
-
     </div>
 
     <span id="greeting">
-      <% if @user %>
-        Welcome, <%= link_to @user.display_name, {:controller => 'user', :action => 'view', :display_name => @user.display_name}, {:id => 'loginanchor'}%> |
-        <%= link_to 'logout', {:controller => 'user', :action => 'logout'}, {:id => 'loginanchor'}%>
+      <% if @user and @user.id %>
+        Welcome, <%= link_to h(@user.display_name), {:controller => 'user', :action => 'view', :display_name => @user.display_name}%> | 
+        <% @inbox_weight = 'bold' if @user.new_messages.size > 0 %>
+        <%= yield :greeting %>
+        <%= link_to "inbox (#{@user.new_messages.size})", {:controller => 'message', :action => 'inbox', :display_name => @user.display_name}, {:style => "font-weight: #{@inbox_weight};" } %> |
+        <%= link_to 'logout', {:controller => 'user', :action => 'logout', :referer => request.request_uri}, {:id => 'logoutanchor'}%>
       <% else %>
-        <%= link_to 'log in', {:controller => 'user', :action => 'login'}, {:id => 'loginanchor'}%> |
+        <%= link_to 'log in', {:controller => 'user', :action => 'login', :referer => request.request_uri}, {:id => 'loginanchor'}%> |
         <%= link_to 'sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %>
       <% end %>
     </span>
 
     <div>
       <ul id="tabnav">
-        <% viewclass = ''
+        <%
+        viewclass = ''
         editclass = ''
+        historyclass = ''
+        exportclass = ''
         traceclass = ''
         viewclass = 'active' if params['controller'] == 'site' and params['action'] == 'index' 
         editclass = 'active' if params['controller'] == 'site' and params['action'] == 'edit' 
+        historyclass = 'active' if params['controller'] == 'changeset' and params['action'] == 'list_bbox' 
+        exportclass = 'active' if params['controller'] == 'site' and params['action'] == 'export'
         traceclass = 'active' if params['controller'] == 'trace'
+        diaryclass = 'active' if params['controller'] == 'diary_entry'
         %>
-        <li><%= link_to 'View', {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => 'view maps', :class => viewclass  } %></li>
-        <li><%= link_to 'Edit', {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => 'edit maps', :class => editclass } %></li>
-        <li><%= link_to 'GPS traces', {:controller => 'trace', :action => 'list'}, {:id => 'traceanchor', :title => 'manage traces', :class => traceclass } %></li>
+        <li><%= link_to 'View', {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => 'view maps', :class => viewclass} %></li>
+        <li><%= link_to 'Edit', {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => 'edit maps', :class => editclass} %></li>
+        <li><%= link_to 'History', {:controller => 'changeset', :action => 'list_bbox' }, {:id => 'historyanchor', :title => 'changeset history', :class => historyclass} %></li>
+        <% if params['controller'] == 'site' and (params['action'] == 'index' or params['action'] == 'export') %>
+        <li><%= link_to_remote 'Export', {:url => {:controller => 'export', :action => 'start'}}, {:id => 'exportanchor', :title => 'export map data', :class => exportclass, :href => url_for(:controller => 'site', :action => 'export')} %></li>
+        <% else %>
+        <li><%= link_to 'Export', {:controller => 'site', :action => 'export'}, {:id => 'exportanchor', :title => 'export map data', :class => exportclass} %></li>
+        <% end %>
+        <li><%= link_to 'GPS Traces', {:controller => 'trace', :action => 'list'}, {:id => 'traceanchor', :title => 'manage traces', :class => traceclass} %></li>
+        <li><%= link_to 'User Diaries', {:controller => 'diary_entry', :action => 'list', :display_name => nil}, {:id => 'diaryanchor', :title => 'view user diaries', :class => diaryclass} %></li>
       </ul>
     </div>
 
       <div id="logo">
         <center>
           <h1>OpenStreetMap</h1>
-          <img src="/images/osm_logo.png" width="120" height="120"/><br/>
-          <nobr><h2>The Free Wiki World Map</h2></nobr>
+          <%= link_to(image_tag("osm_logo.png", :size => "120x120", :border => 0), :controller => 'site', :action => 'index') %><br/>
+          <h2 class="nowrap">The Free Wiki World Map</h2>
         </center>
       </div>
+
       <% unless @user %>
       <div id="intro">
-        OpenStreetMap is a free editable map of the whole world. It is made by people like you.
-        <p/>
-        OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth.
-        <p/>
-        OpenStreetMap's hosting is kindly supported by the <a href="http://www.vr.ucl.ac.uk">UCL VR Centre</a> and <a href="http://www.bytemark.co.uk">bytemark</a>.
+        <p>
+          OpenStreetMap is a free editable map of the whole world. It
+          is made by people like you.
+        </p>
+        <p>
+          OpenStreetMap allows you to view, edit and use geographical
+          data in a collaborative way from anywhere on Earth.
+        </p>
+        <p>
+          OpenStreetMap's hosting is kindly supported by the
+          <a href="http://www.vr.ucl.ac.uk">UCL VR Centre</a> and
+          <a href="http://www.bytemark.co.uk">bytemark</a>.
+        </p>
       </div>
       <% end %>
 
-      <div id="left_menu">
-        <a href="http://wiki.openstreetmap.org">Help & Wiki</a><br />
-               <%= link_to "Users' diaries", {:controller => 'diary_entry', :action => 'list'} %><br />
+      <% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>
+      <div id="alert">
+        The OpenStreetMap database is currently offline while
+        essential database maintenance work is carried out.
+      </div>
+      <% elsif OSM_STATUS == :database_readonly or OSM_STATUS == :api_readonly %>
+      <div id="alert">
+        The OpenStreetMap database is currently in read-only mode while
+        essential database maintenance work is carried out.
+      </div>
+      <% end %>
+
+      <% if false %>
+      <div id="donate" class="notice">
+        Support OpenStreetMap by
+        <a href="http://donate.openstreetmap.org/">donating</a>
+        to the Hardware Upgrade Fund.
+      </div>
+      <% end %>
+
+      <div id="left_menu" class="left_menu">
+        <a href="http://wiki.openstreetmap.org">Help &amp; Wiki</a><br />
         <a href="http://www.opengeodata.org/">News blog</a><br />
         <a href="http://wiki.openstreetmap.org/index.php/Merchandise">Shop</a><br />
+        <%= yield :left_menu %>
       </div>
-      <%= yield :optionals %>
-      <div id="cclogo">
-        <center>
 
-          <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
-            <input type="hidden" name="cmd" value="_s-xclick">
-            <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" style="border: none;" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
-            <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
-            <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHTwYJKoZIhvcNAQcEoIIHQDCCBzwCAQExggEwMIIBLAIBADC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9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MjYwODQ2NDdaMCMGCSqGSIb3DQEJBDEWBBTyC1ZchvuTMtcYeudPPSP/w8HiEDANBgkqhkiG9w0BAQEFAASBgJPpBf69pRAJfhzv/MfPiMncuq3TSlvpX7VtG9p4dXzSko4i2lWUDD72r5zdF2NwDgZ6avf630PutgpOzYJQ525If1xU2olc9DWI43UZTqY+FArgFuCJ8VnkPsy9mcbXPoSjLRqNwrsA2yoETxMISO3ASELzELJTJgpPk4bU57eZ-----END PKCS7-----">
-          </form>
+      <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>
 
-          <a href="http://creativecommons.org/licenses/by-sa/2.0/"><img src="/images/cc_button.png" border="0"></a>
+      <%= yield :optionals %>
 
-        </center>
-      </div>
+      <center>
+        <div class="button" style="width: 115px">
+          <a href="http://donate.openstreetmap.org/"><img src="/images/donate.png" border="0" alt="Make a Donation" /></a>
+        </div>
 
+        <div id="cclogo" class="button" style="width: 88px">
+          <%= link_to image_tag("cc_button.png", :alt => "CC by-sa 2.0", :border => "0"), "http://creativecommons.org/licenses/by-sa/2.0/" %>
+        </div>
+      </center>
     </div>
   </body>
 </html>