]> git.openstreetmap.org Git - rails.git/blob - app/views/old_elements/_actions.html.erb
Add version to breadcrumbs on old element pages
[rails.git] / app / views / old_elements / _actions.html.erb
1 <div class='secondary-actions mb-3'>
2   <% if !@feature.redacted? %>
3     <%= link_to t("browse.download_xml"), send(:"api_#{@type}_version_path", *@feature.id) %>
4   <% elsif current_user&.moderator? %>
5     <% if !params[:show_redactions] %>
6       <%= link_to t(".view_redacted_data"), :params => { :show_redactions => true } %>
7     <% else %>
8       <%= link_to t(".view_redaction_message") %>
9     <% end %>
10   <% end %>
11 </div>
12
13 <nav>
14   <ol class="breadcrumb mb-1">
15     <li class="breadcrumb-item">
16       <%= link_to t(@type, :scope => "browse.versions_navigation"), @current_feature %>
17     </li>
18     <li class="breadcrumb-item">
19       <%= link_to t("browse.versions_navigation.history"), :action => :index %>
20     </li>
21     <li class="breadcrumb-item active" aria-current="page">
22       <span class="py-1 px-2 rounded bg-body-secondary">
23         <%= t "browse.versions_navigation.version", :version => @feature.version %>
24       </span>
25     </li>
26   </ol>
27 </nav>
28
29 <div class='secondary-actions'>
30   <% if @feature.version > 1 %>
31     <%= link_to({ :version => @feature.version - 1 }, { :class => "icon-link" }) do %>
32       <%= previous_page_svg_tag :height => 11 %>
33       <%= "#{t('browse.version')} ##{@feature.version - 1}" %>
34     <% end %>
35   <% end %>
36   <% if @feature.version > 1 && !@feature.latest_version? %>
37     &middot;
38   <% end %>
39   <% unless @feature.latest_version? %>
40     <%= link_to({ :version => @feature.version + 1 }, { :class => "icon-link" }) do %>
41       <%= "#{t('browse.version')} ##{@feature.version + 1}" %>
42       <%= next_page_svg_tag :height => 11 %>
43     <% end %>
44   <% end %>
45 </div>