1 <ul class="nav nav-tabs">
3 <%= link_to t(".all_blocks"),
5 :class => ["nav-link", { :active => action_name == "index" }] %>
7 <% if current_user&.blocks&.exists? %>
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 }] %>
14 <% on_user = @user || @user_block&.user %>
15 <% if on_user != current_user && on_user&.blocks&.exists? %>
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" }] %>
22 <% if current_user&.blocks_created&.exists? %>
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 }] %>
29 <% by_user = @user || @user_block&.creator %>
30 <% if by_user != current_user && by_user&.blocks_created&.exists? %>
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" }] %>
37 <% if @user_block&.persisted? %>
39 <%= link_to t(".block", :id => @user_block.id),
40 user_block_path(@user_block),
41 :class => "nav-link active" %>
43 <% elsif @user_block&.new_record? %>
45 <%= link_to t(".new_block"),
47 :class => "nav-link active" %>