source: subversion/sites/rails_port/app/views/layouts/site.rhtml @ 14694

Revision 14694, 6.6 KB checked in by edgemaster, 5 years ago (diff)

Fix multiple issues with links to /history from the homepage. Thanks to Ed Avis for bringing this to our attention.

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3  <head>
4    <%= javascript_include_tag 'prototype' %>
5    <%= javascript_include_tag 'site' %>
6    <!--[if lt IE 7]><%= javascript_include_tag 'pngfix' %><![endif]--> <!-- thanks, microsoft! -->
7    <%= stylesheet_link_tag 'site' %>
8    <%= stylesheet_link_tag 'print', :media => "print" %>
9    <%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => "/opensearch/osm.xml" }) %>
10    <%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %>
11    <%= yield :head %>
12    <title>OpenStreetMap<%= ' | '+ h(@title) if @title %></title>
13  </head>
14  <body>
15    <div id="content">
16      <% if @notice || flash[:notice] %>
17        <div id="notice"><%= @notice || flash[:notice] %></div>
18      <% end %>
19
20      <%= yield %>
21    </div>
22
23    <span id="greeting">
24      <% if @user and @user.id %>
25        Welcome, <%= link_to h(@user.display_name), {:controller => 'user', :action => 'view', :display_name => @user.display_name}%> |
26        <% @inbox_weight = 'bold' if @user.new_messages.size > 0 %>
27        <%= yield :greeting %>
28        <%= link_to "inbox (#{@user.new_messages.size})", {:controller => 'message', :action => 'inbox', :display_name => @user.display_name}, {:style => "font-weight: #{@inbox_weight};" } %> |
29        <%= link_to 'logout', {:controller => 'user', :action => 'logout', :referer => request.request_uri}, {:id => 'logoutanchor'}%>
30      <% else %>
31        <%= link_to 'log in', {:controller => 'user', :action => 'login', :referer => request.request_uri}, {:id => 'loginanchor'}%> |
32        <%= link_to 'sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %>
33      <% end %>
34    </span>
35
36    <div>
37      <ul id="tabnav">
38        <%
39        viewclass = ''
40        editclass = ''
41        historyclass = ''
42        exportclass = ''
43        traceclass = ''
44        viewclass = 'active' if params['controller'] == 'site' and params['action'] == 'index'
45        editclass = 'active' if params['controller'] == 'site' and params['action'] == 'edit'
46        historyclass = 'active' if params['controller'] == 'changeset' and params['action'] == 'list_bbox'
47        exportclass = 'active' if params['controller'] == 'site' and params['action'] == 'export'
48        traceclass = 'active' if params['controller'] == 'trace'
49        diaryclass = 'active' if params['controller'] == 'diary_entry'
50        %>
51        <li><%= link_to 'View', {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => 'view maps', :class => viewclass} %></li>
52        <li><%= link_to 'Edit', {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => 'edit maps', :class => editclass} %></li>
53        <li><%= link_to 'History', {:controller => 'changeset', :action => 'list_bbox' }, {:id => 'historyanchor', :title => 'changeset history', :class => historyclass} %></li>
54        <% if params['controller'] == 'site' and (params['action'] == 'index' or params['action'] == 'export') %>
55        <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>
56        <% else %>
57        <li><%= link_to 'Export', {:controller => 'site', :action => 'export'}, {:id => 'exportanchor', :title => 'export map data', :class => exportclass} %></li>
58        <% end %>
59        <li><%= link_to 'GPS Traces', {:controller => 'trace', :action => 'list'}, {:id => 'traceanchor', :title => 'manage traces', :class => traceclass} %></li>
60        <li><%= link_to 'User Diaries', {:controller => 'diary_entry', :action => 'list', :display_name => nil}, {:id => 'diaryanchor', :title => 'view user diaries', :class => diaryclass} %></li>
61      </ul>
62    </div>
63
64    <div id="left">
65
66      <div id="logo">
67        <center>
68          <h1>OpenStreetMap</h1>
69          <%= link_to(image_tag("osm_logo.png", :size => "120x120", :border => 0), :controller => 'site', :action => 'index') %><br/>
70          <h2 class="nowrap">The Free Wiki World Map</h2>
71        </center>
72      </div>
73
74      <% unless @user %>
75      <div id="intro">
76        <p>
77          OpenStreetMap is a free editable map of the whole world. It
78          is made by people like you.
79        </p>
80        <p>
81          OpenStreetMap allows you to view, edit and use geographical
82          data in a collaborative way from anywhere on Earth.
83        </p>
84        <p>
85          OpenStreetMap's hosting is kindly supported by the
86          <a href="http://www.vr.ucl.ac.uk">UCL VR Centre</a> and
87          <a href="http://www.bytemark.co.uk">bytemark</a>.
88        </p>
89      </div>
90      <% end %>
91
92      <% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>
93      <div id="alert">
94        The OpenStreetMap database is currently offline while
95        essential database maintenance work is carried out.
96      </div>
97      <% elsif OSM_STATUS == :database_readonly or OSM_STATUS == :api_readonly %>
98      <div id="alert">
99        The OpenStreetMap database is currently in read-only mode while
100        essential database maintenance work is carried out.
101      </div>
102      <% end %>
103
104      <% if false %>
105      <div id="donate" class="notice">
106        Support OpenStreetMap by
107        <a href="http://donate.openstreetmap.org/">donating</a>
108        to the Hardware Upgrade Fund.
109      </div>
110      <% end %>
111
112      <div id="left_menu" class="left_menu">
113        <a href="http://wiki.openstreetmap.org">Help &amp; Wiki</a><br />
114        <a href="http://www.opengeodata.org/">News blog</a><br />
115        <a href="http://wiki.openstreetmap.org/index.php/Merchandise">Shop</a><br />
116        <%= yield :left_menu %>
117      </div>
118
119      <div id="sotm" class="notice">
120        Come to the 2009 OpenStreetMap
121        Conference, <a href="http://www.stateofthemap.org">The State
122        of the Map</a>, July 10-12 in Amsterdam!
123      </div>
124
125      <%= yield :optionals %>
126
127      <center>
128        <div class="button" style="width: 115px">
129          <a href="http://donate.openstreetmap.org/"><img src="/images/donate.png" border="0" alt="Make a Donation" /></a>
130        </div>
131
132        <div id="cclogo" class="button" style="width: 88px">
133          <%= link_to image_tag("cc_button.png", :alt => "CC by-sa 2.0", :border => "0"), "http://creativecommons.org/licenses/by-sa/2.0/" %>
134        </div>
135      </center>
136    </div>
137  </body>
138</html>
Note: See TracBrowser for help on using the repository browser.