]> git.openstreetmap.org Git - rails.git/blob - app/views/layouts/_header.html.erb
Localise local chapters
[rails.git] / app / views / layouts / _header.html.erb
1 <header class="closed clearfix">
2   <h1>
3     <a href="<%= root_path %>" class="geolink">
4       <picture>
5         <source srcset="<%= image_path "osm_logo.svg" %>" type="image/svg+xml" />
6         <%= image_tag "osm_logo.png", :srcset => image_path("osm_logo.svg"), :alt => t("layouts.logo.alt_text"), :class => "logo" %>
7       </picture>
8       <%= t "layouts.project_name.h1" %>
9     </a>
10   </h1>
11   <a href="#" id="menu-icon"></a>
12   <nav class='primary'>
13     <%= content_for :header %>
14     <div class="btn-group">
15       <div id="edit_tab" class="btn-group <%= current_page_class(edit_path) %>">
16         <%= link_to t("layouts.edit"),
17                     edit_path,
18                     :class => "btn btn-outline-primary geolink editlink",
19                     :id => "editanchor",
20                     :data => { :editor => preferred_editor } %>
21         <a class='btn btn-outline-primary dropdown-toggle dropdown-toggle-split' data-toggle='dropdown' href='#'></a>
22         <ul class='dropdown-menu'>
23           <% Editors::RECOMMENDED_EDITORS.each do |editor| %>
24             <li>
25               <%= link_to t("layouts.edit_with", :editor => t("editor.#{editor}.description")),
26                           edit_path(:editor => editor),
27                           :data => { :editor => editor },
28                           :class => "geolink editlink dropdown-item" %>
29             </li>
30           <% end %>
31         </ul>
32       </div>
33       <%= link_to t("layouts.history"), history_path, :class => "btn btn-outline-primary geolink flex-grow-1 current_page_class(history_path)", :id => "history_tab" %>
34       <%= link_to t("layouts.export"), export_path, :class => "btn btn-outline-primary geolink current_page_class(export_path)", :id => "export_tab" %>
35     </div>
36   </nav>
37   <nav class='secondary'>
38     <ul class='mx-1 px-0'>
39       <% if can? :index, Issue %>
40         <li class="compact-hide nav-item <%= current_page_class(issues_path) %>">
41           <%= link_to issues_path(:status => "open"), :class => "nav-link" do %>
42             <%= t("layouts.issues") %>
43             <%= open_issues_count %>
44           <% end -%>
45         </li>
46       <% end %>
47       <li class="compact-hide nav-item <%= current_page_class(traces_path) %>">
48         <%= link_to t("layouts.gps_traces"), traces_path, :class => "nav-link" %>
49       </li>
50       <li class="compact-hide nav-item <%= current_page_class(diary_entries_path) %>">
51         <%= link_to t("layouts.user_diaries"), diary_entries_path, :class => "nav-link" %>
52       </li>
53       <li class="compact-hide nav-item <%= current_page_class(communities_path) %>">
54         <%= link_to t("layouts.communities"), communities_path, :class => "nav-link" %>
55       </li>
56       <li class="compact-hide nav-item <%= current_page_class(copyright_path) %>">
57         <%= link_to t("layouts.copyright"), copyright_path, :class => "nav-link" %>
58       </li>
59       <li class="compact-hide nav-item <%= current_page_class(help_path) %>">
60         <%= link_to t("layouts.help"), help_path, :class => "nav-link" %>
61       </li>
62       <li class="compact-hide nav-item <%= current_page_class(about_path) %>">
63         <%= link_to t("layouts.about"), about_path, :class => "nav-link" %>
64       </li>
65       <li id="compact-secondary-nav" class="dropdown nav-item">
66         <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#"><%= t "layouts.more" %></a>
67         <ul class="dropdown-menu">
68           <% if Settings.status != "database_offline" && can?(:index, Issue) %>
69             <li class="<%= current_page_class(issues_path) %>">
70               <%= link_to issues_path(:status => "open"), :class => "dropdown-item" do %>
71                 <%= t("layouts.issues") %>
72                 <%= open_issues_count %>
73               <% end -%>
74             </li>
75           <% end %>
76           <li class="<%= current_page_class(traces_path) %>"><%= link_to t("layouts.gps_traces"), traces_path, :class => "dropdown-item" %></li>
77           <li class="<%= current_page_class(diary_entries_path) %>"><%= link_to t("layouts.user_diaries"), diary_entries_path, :class => "dropdown-item" %></li>
78           <li class="<%= current_page_class(communities_path) %>"><%= link_to t("layouts.communities"), communities_path, :class => "dropdown-item" %></li>
79           <li class="<%= current_page_class(copyright_path) %>"><%= link_to t("layouts.copyright"), copyright_path, :class => "dropdown-item" %></li>
80           <li class="<%= current_page_class(help_path) %>"><%= link_to t("layouts.help"), help_path, :class => "dropdown-item" %></li>
81           <li class="<%= current_page_class(about_path) %>"><%= link_to t("layouts.about"), about_path, :class => "dropdown-item" %></li>
82         </ul>
83       </li>
84     </ul>
85     <% if current_user && current_user.id %>
86       <div class='d-inline-flex dropdown user-menu logged-in clearfix'>
87         <a class='dropdown-toggle btn btn-outline-secondary pl-2 py-1 flex-grow-1' data-toggle='dropdown' href="#">
88           <%= user_thumbnail_tiny(current_user, :width => 25, :height => 25) %>
89           <%= render :partial => "layouts/inbox" %>
90           <span class="user-button">
91             <span class='username'>
92               <%= current_user.display_name %>
93             </span>
94           </span>
95         </a>
96         <div class='dropdown-menu dropdown-menu-right'>
97           <%= link_to inbox_messages_path, :class => "dropdown-item" do %>
98             <%= t("users.show.my messages") %>
99             <span class='count-number'><%= number_with_delimiter(current_user.new_messages.size) %></span>
100           <% end %>
101           <%= link_to t("users.show.my profile"), user_path(current_user), :class => "dropdown-item" %>
102           <%= link_to t("users.show.my settings"), user_account_path(current_user), :class => "dropdown-item" %>
103           <%= link_to t("users.show.my_preferences"), preferences_path, :class => "dropdown-item" %>
104           <div class="dropdown-divider"></div>
105           <%= yield :greeting %>
106           <%= link_to t("layouts.logout"), logout_path(:referer => request.fullpath), :method => "post", :class => "geolink dropdown-item" %>
107         </div>
108       </div>
109     <% else %>
110       <div class="d-inline-flex btn-group login-menu" role="">
111         <%= link_to t("layouts.log_in"), login_path(:referer => request.fullpath), :class => "geolink btn btn-outline-secondary" %>
112         <%= link_to t("layouts.sign_up"), user_new_path, :class => "btn btn-outline-secondary" %>
113       </ul>
114     <% end %>
115   </nav>
116 </header>