]> git.openstreetmap.org Git - rails.git/blob - app/views/layouts/site.html.erb
bd77966db009a2d15f53b7b54578740cd5628b87
[rails.git] / app / views / layouts / site.html.erb
1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= I18n.locale %>" lang="<%= I18n.locale %>" dir="<%= dir %>">
3   <%= render :partial => "layouts/head" %>
4   <body class="<%= params[:controller] %> <%= params[:controller] %>-<%= params[:action] %>">
5     <div id="small-title">
6       <%= link_to(image_tag("osm_logo.png", :size => "16x16", :alt => t('layouts.logo.alt_text')), root_path) %>
7       <h1><%= t 'layouts.project_name.h1' %></h1>
8     </div>
9         <div id="left">
10       <div id="logo">
11         <%= link_to(image_tag("osm_logo.png",
12           :size => "120x120",
13           :alt => t('layouts.logo.alt_text')),
14           root_path) %>
15         <h1><%= t 'layouts.project_name.h1' %></h1>
16         <h2><%= t('layouts.tag_line') %></h2>
17       </div>
18       <%= yield :optionals %>
19       <% unless @user %>
20       <div class="sidebar-copy intro">
21         <p><%= t 'layouts.intro_1' %></p>
22         <p>
23         <%= t 'layouts.intro_2_html',
24           :download => link_to(t('layouts.intro_2_download'), "http://planet.openstreetmap.org/"),
25           :use => link_to(t('layouts.intro_2_use'), t('layouts.intro_2_use_url')),
26           :license => link_to(t('layouts.intro_2_license'), copyright_path),
27           :create_account => link_to(t('layouts.intro_2_create_account'), user_new_path)
28         %>
29         </p>
30       </div>
31       <% end %>
32       <% if STATUS == :database_offline or STATUS == :api_offline %>
33       <div class="sidebar-alert">
34         <p><%= t 'layouts.osm_offline' %></p>
35       </div>
36       <% elsif STATUS == :database_readonly or STATUS == :api_readonly %>
37       <div class="sidebar-alert">
38         <p><%= t 'layouts.osm_read_only' %></p>
39       </div>
40       <% end %>
41       <ul id="left_menu" class="left_menu">
42         <li>
43           <h4><%= t'layouts.help' %></h4>
44           <ul>
45             <li><%= link_to(t('layouts.help_centre'), t('layouts.help_url'), :title => t('layouts.help_title')) %></li>
46             <li><%= link_to(t('layouts.documentation'), t('layouts.wiki_url'), :title => t('layouts.documentation_title')) %></li>
47             <li><%= link_to t('layouts.copyright'), copyright_path %></li>
48           </ul>
49         </li>
50         <li>
51           <h4><%= t'layouts.community' %></h4>
52           <ul>
53             <li><a href="http://blogs.openstreetmap.org/" title="<%= t 'layouts.community_blogs_title' %>"><%= t 'layouts.community_blogs' %></a></li>
54             <li><a href="http://www.osmfoundation.org" title="<%= t 'layouts.foundation_title' %>"><%= t 'layouts.foundation' %></a></li>
55             <li><%= link_to(t('layouts.user_diaries'), diary_path, {
56               :title => t('layouts.user_diaries_tooltip')
57             }) %></li>
58           </ul>
59         </li>
60         <li>
61           <h4><%= link_to t('layouts.gps_traces'), traces_path, {
62             :id => 'traceanchor',
63             :title => t('layouts.gps_traces_tooltip')
64           } %></h4>
65         </li>
66         <%= yield :left_menu %>
67       </ul>
68       <div class='ad-container'>
69         <div class='ads'>
70           <%= ad = [{:image => 'sotm-birmingham-ad.png',
71                      :title => 'State of the Map Birmingham',
72                      :href =>'http://stateofthemap.org/'},
73                     {:image => 'sotm-us-ad.png',
74                      :title => 'State of the Map USA',
75                      :href =>'http://stateofthemap.us/'},
76                     {:image => 'donate-ad.png',
77                      :title => 'Server Donation Drive',
78                      :href =>'http://donate.openstreetmap.org/'}].sample
79
80               link_to ad[:href], :title => ad[:title] do
81                 image_tag ad[:image], :class => :ad
82               end
83           %>
84         </div>
85       </div>
86       <a title="<%= h(t('layouts.make_a_donation.title')) %>" href="http://donate.openstreetmap.org/" class="donate">
87         <span><%= h(t('layouts.make_a_donation.text')) %></span>
88       </a>
89       <div class='sidebar-copy'>
90         <p class='deemphasize'><%= t 'layouts.partners_html',
91           :ucl => link_to(t('layouts.partners_ucl'), "http://www.vr.ucl.ac.uk"),
92           :ic => link_to(t('layouts.partners_ic'), "http://www.imperial.ac.uk/"),
93           :bytemark => link_to(t('layouts.partners_bytemark'), "http://www.bytemark.co.uk"),
94           :partners => link_to(t('layouts.partners_partners'), t('layouts.partners_url')) %>
95         </p>
96       </div>
97     </div>
98     <div id='top-bar'>
99       <ul class='secondary-actions' id="greeting">
100          <% if @user and @user.id %>
101            <li id="full-greeting"><%=link_to h(@user.display_name), user_path(:display_name => @user.display_name), :title => t('layouts.welcome_user_link_tooltip') %></li>
102            <li><%= yield :greeting %></li>
103            <li><%= render :partial => "layouts/inbox" %></li>
104            <li><%= link_to t('layouts.logout'), logout_path(:session => request.session_options[:id], :referer => request.fullpath), {:id => 'logoutanchor', :title => t('layouts.logout_tooltip')}%></li>
105          <% else %>
106            <li><%= link_to t('layouts.log_in'), login_path(:referer => request.fullpath), {:id => 'loginanchor', :title => t('layouts.log_in_tooltip')} %></li>
107            <li><%= link_to t('layouts.sign_up'), user_new_path, {:id => 'registeranchor', :title => t('layouts.sign_up_tooltip')} %></li>
108          <% end %>
109       </ul>
110       <ul id="tabnav">
111         <li><%= link_to t('layouts.view'), root_path, {
112           :id => 'viewanchor',
113           :title => t('layouts.view_tooltip'),
114           :class => 'geolink llz layers'
115         } %></li>
116         <li><%= link_to h(t('layouts.edit')) + content_tag(:span, "▼", :class => "menuicon"), edit_path, {
117           :id => 'editanchor',
118           :title => t('javascripts.site.edit_tooltip'),
119           :data => { :minzoom => 13, :editor => preferred_editor },
120           :class => 'geolink llz object disabled'
121         } %></li>
122         <li><%= link_to t('layouts.history'), browse_changesets_path, {
123           :id => 'historyanchor',
124           :data => { :minzoom => 11 },
125           :title => t('javascripts.site.history_tooltip'),
126           :class => 'geolink bbox'
127         } %></li>
128         <li><%= link_to t('layouts.export'), export_path, {
129           :id => 'exportanchor',
130           :title => t('layouts.export_tooltip'),
131           :data => { :url => url_for(:controller => :export, :action => :start) },
132           :class => 'geolink llz layers'
133         } %></li>
134       </ul>
135     </div>
136     <div id="editmenu" class="menu">
137       <ul>
138         <% Editors::RECOMMENDED_EDITORS.each do |editor| %>
139           <li><%= link_to t('layouts.edit_with',
140             :editor => t("editor.#{editor}.description")),
141             edit_path(:editor => editor), {
142             :data => { :editor => editor },
143             :class => "geolink llz object"
144           } %></li>
145         <% end %>
146         <%= yield :editmenu %>
147       </ul>
148     </div>
149     <script type="text/javascript">
150       createMenu("editanchor", "editmenu", "left");
151     </script>
152     <div class="wrapper">
153       <%= render :partial => "layouts/flash", :locals => { :flash => flash } %>
154       <% if content_for? :heading %>
155       <div class="content-heading">
156         <%= yield :heading %>
157       </div>
158       <% end %>
159       <div id="content" class="clearfix">
160         <%= yield %>
161       </div>
162     </div>
163     <% if defined?(PIWIK_LOCATION) and defined?(PIWIK_SITE) -%>
164     <noscript><p><img src="<%= request.protocol %><%= PIWIK_LOCATION %>/piwik.php?idsite=<%= PIWIK_SITE %>" style="border:0" alt="" /></p></noscript>
165     <% end -%>
166   </body>
167 </html>