]> git.openstreetmap.org Git - rails.git/blob - app/views/user_blocks/_navigation.html.erb
Merge remote-tracking branch 'upstream/pull/5401'
[rails.git] / app / views / user_blocks / _navigation.html.erb
1 <ul class="nav nav-tabs">
2   <li class="nav-item">
3     <%= link_to t(".all_blocks"),
4                 user_blocks_path,
5                 :class => ["nav-link", { :active => action_name == "index" }] %>
6   </li>
7   <% if current_user&.blocks&.exists? %>
8     <li class="nav-item">
9       <%= link_to t(".blocks_on_me"),
10                   user_blocks_on_path(current_user),
11                   :class => ["nav-link", { :active => action_name == "blocks_on" && current_user == @user }] %>
12     </li>
13   <% end %>
14   <% on_user = @user || @user_block&.user %>
15   <% if on_user != current_user && on_user&.blocks&.exists? %>
16     <li class="nav-item">
17       <%= link_to t(".blocks_on_user_html", :user => tag.span(on_user.display_name, :class => "username text-truncate d-inline-block align-bottom", :dir => "auto")),
18                   user_blocks_on_path(on_user),
19                   :class => ["nav-link", { :active => action_name == "blocks_on" }] %>
20     </li>
21   <% end %>
22   <% if current_user&.blocks_created&.exists? %>
23     <li class="nav-item">
24       <%= link_to t(".blocks_by_me"),
25                   user_blocks_by_path(current_user),
26                   :class => ["nav-link", { :active => action_name == "blocks_by" && current_user == @user }] %>
27     </li>
28   <% end %>
29   <% by_user = @user || @user_block&.creator %>
30   <% if by_user != current_user && by_user&.blocks_created&.exists? %>
31     <li class="nav-item">
32       <%= link_to t(".blocks_by_user_html", :user => tag.span(by_user.display_name, :class => "username text-truncate d-inline-block align-bottom", :dir => "auto")),
33                   user_blocks_by_path(by_user),
34                   :class => ["nav-link", { :active => action_name == "blocks_by" }] %>
35     </li>
36   <% end %>
37   <% if @user_block&.persisted? %>
38     <li class="nav-item">
39       <%= link_to t(".block", :id => @user_block.id),
40                   user_block_path(@user_block),
41                   :class => "nav-link active" %>
42     </li>
43   <% elsif @user_block&.new_record? %>
44     <li class="nav-item">
45       <%= link_to t(".new_block"),
46                   new_user_block_path,
47                   :class => "nav-link active" %>
48     </li>
49   <% end %>
50 </ul>