]> git.openstreetmap.org Git - rails.git/blob - app/views/layouts/site.rhtml
005b6e68e8f2f2287ee7c86d75f5026ce1d714bd
[rails.git] / app / views / layouts / site.rhtml
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         <%= t 'layouts.welcome_user', :user_link => (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 t('layouts.inbox', :size => @user.new_messages.size), {:controller => 'message', :action => 'inbox', :display_name => @user.display_name}, {:style => "font-weight: #{@inbox_weight};" } %> |
29         <%= link_to t('layouts.logout'), {:controller => 'user', :action => 'logout', :referer => request.request_uri}, {:id => 'logoutanchor'}%>
30       <% else %>               
31         <%= link_to t('layouts.log_in'), {:controller => 'user', :action => 'login', :referer => request.request_uri}, {:id => 'loginanchor'}%> |
32         <%= link_to t('layouts.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 t('layouts.view'), {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => 'view maps', :class => viewclass} %></li>
52         <li><%= link_to t('layouts.edit'), {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => 'edit maps', :class => editclass} %></li>
53         <li><%= link_to t('layouts.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 t('layouts.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 t('layouts.export'), {:controller => 'site', :action => 'export'}, {:id => 'exportanchor', :title => 'export map data', :class => exportclass} %></li>
58         <% end %>
59         <li><%= link_to t('layouts.gps_traces'), {:controller => 'trace', :action => 'list'}, {:id => 'traceanchor', :title => 'manage traces', :class => traceclass} %></li>
60         <li><%= link_to t('layouts.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"><%= t('layouts.tag_line') %></h2>
71         </center>
72       </div>
73
74       <% unless @user %>
75       <div id="intro">
76         <p>
77           <%= t 'layouts.intro_1' %>
78         </p>
79         <p>
80           <%= t 'layouts.intro_2' %>.
81         </p>
82         <p>
83         <%= t 'layouts.intro_3', 
84               :ucl => '<a href="http://www.vr.ucl.ac.uk">UCL VR Centre</a>', 
85               :bytemark => '<a href="http://www.bytemark.co.uk">bytemark</a>' %>
86         </p>
87       </div>
88       <% end %>
89
90       <% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>
91       <div id="alert">
92         <%= t 'layouts.offline' %>
93       </div>
94       <% elsif OSM_STATUS == :database_readonly or OSM_STATUS == :api_readonly %>
95       <div id="alert">
96         <%= t 'layouts.read_only' %>
97       <% end %>
98
99       <% if false %>
100       <div id="donate" class="notice">
101         <%= t 'layouts.donate', :link => "<a href=\"http://donate.openstreetmap.org/\">#{donate_link_text}</a>" %>
102       </div>
103       <% end %>
104
105       <div id="left_menu" class="left_menu">
106         <a href="http://wiki.openstreetmap.org"><%= t 'layouts.help_wiki' %></a><br />
107         <a href="http://www.opengeodata.org/"><%= t 'layouts.news_blog' %></a><br />
108         <a href="http://wiki.openstreetmap.org/index.php/Merchandise"><%= t 'layouts.shop' %></a><br />
109         <%= yield :left_menu %>
110       </div>
111
112       <div id="sotm" class="notice">
113         <%= link_to image_tag("sotm.png", :alt => "State of the Map", :border => "0"), "http://www.stateofthemap.org/" %>
114       </div>
115
116       <%= yield :optionals %>
117
118       <center>
119         <div class="button" style="width: 115px">
120           <a href="http://donate.openstreetmap.org/"><img src="/images/donate.png" border="0" alt="<%= t 'layouts.alt_donation' %>" /></a>
121         </div>
122
123         <div id="cclogo" class="button" style="width: 88px">
124           <%= link_to image_tag("cc_button.png", :alt => "CC by-sa 2.0", :border => "0"), "http://creativecommons.org/licenses/by-sa/2.0/" %>
125         </div>
126       </center>
127     </div>
128   </body>
129 </html>