]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/layouts/site.rhtml
Add support for putting the site in an offline mode where it operates
[rails.git] / app / views / layouts / site.rhtml
index 0ff110cedd9cc940a6e8f819652d843870622c0f..52e7b6b242847869e54c8feb7f2f1ab9530c74bb 100644 (file)
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html>
   <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" }) %>
+    <title>OpenStreetMap<%= ' | '+ h(@title) if @title %></title>
   </head>
   <body>
-
     <div id="content">
-<% if @flash[:notice] %>
-  <div id="notice"><%= @flash[:notice] %></div>
-<% end %>
-
-    <%= @content_for_layout %>
-
-  </div>
-
-  <span id="greeting">
-    <%= link_to 'Login', {:controller => 'user', :action => 'login'}, {:id => 'loginanchor'}%> /
-    <%= link_to 'Sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %>
-  </span>
-  
-  <div>
-    <ul id="tabnav">
-      <li><a  id="viewanchor" href="/index.html" title="view maps">View</a></li>
-      <li><a  style="font-style:italic" href="/login.html" title="edit maps">Edit</a></li>
-      <li><a  href="/traces" title="manage traces">GPS traces</a></li>
-    </ul>
-  </div>
+      <% if flash[:notice] %>
+        <div id="notice"><%= flash[:notice] %></div>
+      <% end %>
 
-  <div id="left">
-
-    <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>
-      </center>
+      <%= yield %>
     </div>
 
-    <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>.
-
+    <span id="greeting">
+      <% 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', :referer => request.request_uri}, {:id => 'loginanchor'}%> |
+        <%= link_to 'sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %>
+      <% end %>
+    </span>
+
+    <div>
+      <ul id="tabnav">
+        <%
+        viewclass = ''
+        editclass = ''
+        exportclass = ''
+        traceclass = ''
+        viewclass = 'active' if params['controller'] == 'site' and params['action'] == 'index' 
+        editclass = 'active' if params['controller'] == 'site' and params['action'] == 'edit' 
+        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>
+        <% 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="left_menu">
-      <a href="http://wiki.openstreetmap.org">Help & 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 />
-      <center>
+    <div id="left">
 
-        <script type="text/javascript"><!--
-          var detect = navigator.userAgent.toLowerCase();
-          if (detect.indexOf('msie') >= 0) {
-            document.write('<script type=\"text/javascript\"> google_ad_client = \"pub-7727744269903103\";  google_ad_width = 125;  google_ad_height = 125;  google_ad_format = \"125x125_as_rimg\";  google_cpa_choice = \"CAAQveHnzwEaCEiH5iXPqf1SKJe193M\";  </script>  <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">  </script>');
-            }
-//--></script>
+      <div id="logo">
+        <center>
+          <h1>OpenStreetMap</h1>
+          <%= 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>.
+      </div>
+      <% end %>
 
-          </center>
+      <% 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 == :api_readonly %>
+      <div id="alert">
+        The OpenStreetMap database is currently in read-only mode while
+        essential database maintenance work is carried out.
+      </div>
+      <% end %>
 
-        </div>
+      <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>
 
+      <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>
 
-        <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" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
-              <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHFgYJKoZIhvcNAQcEoIIHBzCCBwMCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDA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9JXw8ZyNZ4qZO3x5vRRPWaD/jQTjsz9/I2jwahkUZ/hsJqxJyhrpI-----END PKCS7-----">
-            </form>
+      <%= yield :optionals %>
+      <div id="cclogo">
+        <center>
 
-            <a href="http://creativecommons.org/licenses/by-sa/2.0/"><img src="/images/cc_button.png" border="0"></a>
+          <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" 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-----MIIHTwYJKoZIhvcNAQcEoIIHQDCCBzwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCsNDDDDa7OZFojBzDvG4HSPXOiJSO3VNuLoc8HGwsds3LsZYYtv4cPGw7Z/SoVVda+RELM+5FQn0D3Kv7hjA2Z6QdwEkFH2kDDlXCvyPt53ENHkQrzC1KOueRpimsQMH5hl03nvuVXij0hEYlMFqTH0UZr80vyczB+lJU6ZKYtrDELMAkGBSsOAwIaBQAwgcwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIZa12CIRB0geAgahqF6Otz0oY0+Wg56fSuEpZvbUmNGEQznjWqBXkJqTkZT0jOwekOrlEi7bNEU8yVIie2u5L1gOhBDSl6rmgpxxVURSa4Jig5qiSioyK5baH6HjXVPQ+MDEWg1gZ4LtjYYtroZ8SBE/1eikQWmG7EOEgU62Vn/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BTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MjYwODQ2NDdaMCMGCSqGSIb3DQEJBDEWBBTyC1ZchvuTMtcYeudPPSP/w8HiEDANBgkqhkiG9w0BAQEFAASBgJPpBf69pRAJfhzv/MfPiMncuq3TSlvpX7VtG9p4dXzSko4i2lWUDD72r5zdF2NwDgZ6avf630PutgpOzYJQ525If1xU2olc9DWI43UZTqY+FArgFuCJ8VnkPsy9mcbXPoSjLRqNwrsA2yoETxMISO3ASELzELJTJgpPk4bU57eZ-----END PKCS7-----" />
+          </form>
 
-          </center>
-        </div>
+          <a href="http://creativecommons.org/licenses/by-sa/2.0/"><img src="/images/cc_button.png" border="0" alt="" /></a>
 
+        </center>
       </div>
+
+    </div>
   </body>
 </html>