]> git.openstreetmap.org Git - rails.git/blob - app/views/layouts/_header.html.erb
efe9efdf8426dfdcb9ef6d1ba56a0890c667d2d5
[rails.git] / app / views / layouts / _header.html.erb
1 <header class="closed">
2   <h1>
3     <a href="<%= root_path %>" class="geolink">
4       <%= image_tag "osm_logo.png", :alt => t('layouts.logo.alt_text'), :class => 'logo' %>
5       <%= t 'layouts.project_name.h1' %>
6     </a>
7   </h1>
8   <a href="#" id="menu-icon"></a>
9   <nav class='primary'>
10     <%= content_for :header %>
11     <ul>
12       <li id="edit_tab" class="dropdown <%= current_page_class(edit_path) %>">
13         <%= link_to t('layouts.edit'), edit_path, :class => "tab geolink editlink",
14                     :id => 'editanchor',
15                     :data => { :editor => preferred_editor }
16         %><a class='dropdown-toggle' data-toggle='dropdown' href='#'><b class="caret"></b></a>
17         <ul class='dropdown-menu'>
18           <% Editors::RECOMMENDED_EDITORS.each do |editor| %>
19             <li>
20               <%= link_to t('layouts.edit_with', :editor => t("editor.#{editor}.description")),
21                           edit_path(:editor => editor),
22                           :data => { :editor => editor },
23                           :class => "geolink editlink" %>
24             </li>
25           <% end %>
26         </ul>
27       </li>
28       <li id="history_tab" class="<%= current_page_class(history_path) %>">
29         <%= link_to t('layouts.history'), history_path, :class => 'tab geolink' %>
30       </li>
31       <li id="export_tab" class="<%= current_page_class(export_path) %>">
32         <%= link_to t('layouts.export'), export_path, :class => 'tab geolink' %>
33       </li>
34     </ul>
35   </nav>
36   <nav class='secondary'>
37     <ul>
38       <li class="compact-hide <%= current_page_class(traces_path) %>"><%= link_to t('layouts.gps_traces'), traces_path %></li>
39       <li class="compact-hide <%= current_page_class(diary_path) %>"><%= link_to t('layouts.user_diaries'), diary_path %></li>
40       <li class="compact-hide <%= current_page_class(help_path) %>"><%= link_to t('layouts.help'), help_path %></li>
41       <li class="compact-hide <%= current_page_class(about_path) %>"><%= link_to t('layouts.about'), about_path %></li>
42       <li id="compact-secondary-nav" class="dropdown">
43         <a class="dropdown-toggle" data-toggle="dropdown" href="#">More <b class="caret"></b></a>
44         <ul class="dropdown-menu">
45           <li class="<%= current_page_class(traces_path) %>"><%= link_to t('layouts.gps_traces'), traces_path %></li>
46           <li class="<%= current_page_class(diary_path) %>"><%= link_to t('layouts.user_diaries'), diary_path %></li>
47           <li class="<%= current_page_class(help_path) %>"><%= link_to t('layouts.help'), help_path %></li>
48           <li class="<%= current_page_class(about_path) %>"><%= link_to t('layouts.about'), about_path %></li>
49         </ul>
50       </li>
51     </ul>
52     <% if @user && @user.id %>
53       <div class='dropdown user-menu logged-in'>
54         <a class='dropdown-toggle' data-toggle='dropdown' href="#">
55           <%= user_thumbnail_tiny(@user, :size => 25, :width => 25, :height => 25)
56           %><%= render :partial => 'layouts/inbox'
57         %><span class="user-button"><span class='username'><%= @user.display_name %></span>
58           <b class="caret"></b></span>
59         </a>
60         <ul class='dropdown-menu'>
61           <li>
62             <%= link_to inbox_path(:display_name => @user.display_name) do %>
63               <span class='count-number'><%= number_with_delimiter(@user.new_messages.size) %></span>
64               <%= t('message.inbox.my_inbox') %>
65             <% end %>
66           </li>
67           <li>
68             <%= link_to t('user.view.my profile'), user_path(:display_name => @user.display_name) %>
69           </li>
70           <li>
71             <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
72           </li>
73           <li class="divider"></li>
74           <li>
75             <%= yield :greeting %>
76           </li>
77           <li>
78             <%= link_to t('layouts.logout'), logout_path(:session => request.session_options[:id], :referer => request.fullpath) %>
79           </li>
80         </ul>
81       </div>
82     <% else %>
83       <ul class="user-menu clearfix">
84         <li><%= link_to t('layouts.log_in'), login_path(:referer => request.fullpath) %></li>
85         <li><%= link_to t('layouts.sign_up'), user_new_path %></li>
86       </ul>
87     <% end %>
88   </nav>
89 </header>