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