Create received blocks resource
This commit is contained in:
parent
7a4115f090
commit
2df389c97e
11 changed files with 146 additions and 121 deletions
|
@ -7,16 +7,16 @@
|
|||
<% if current_user&.blocks&.exists? %>
|
||||
<li class="nav-item">
|
||||
<%= link_to t(".blocks_on_me"),
|
||||
user_blocks_on_path(current_user),
|
||||
:class => ["nav-link", { :active => action_name == "blocks_on" && current_user == @user }] %>
|
||||
user_received_blocks_path(current_user),
|
||||
:class => ["nav-link", { :active => controller_name == "received_blocks" && current_user == @user }] %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% on_user = @user || @user_block&.user %>
|
||||
<% if on_user != current_user && on_user&.blocks&.exists? %>
|
||||
<li class="nav-item">
|
||||
<%= 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")),
|
||||
user_blocks_on_path(on_user),
|
||||
:class => ["nav-link", { :active => action_name == "blocks_on" }] %>
|
||||
user_received_blocks_path(on_user),
|
||||
:class => ["nav-link", { :active => controller_name == "received_blocks" }] %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if current_user&.blocks_created&.exists? %>
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<% content_for :heading_class, "pb-0" %>
|
||||
<% content_for :heading do %>
|
||||
<h1><%= t(".heading_html", :name => link_to(@user.display_name, @user)) %></h1>
|
||||
<%= render :partial => "navigation" %>
|
||||
<%= render :partial => "user_blocks/navigation" %>
|
||||
<% end %>
|
||||
|
||||
<% unless @user_blocks.empty? %>
|
||||
<%= render :partial => "page" %>
|
||||
<%= render :partial => "user_blocks/page" %>
|
||||
<% else %>
|
||||
<p><%= t ".empty", :name => @user.display_name %></p>
|
||||
<% end %>
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<% if current_user.blocks.exists? %>
|
||||
<li>
|
||||
<%= link_to t(".blocks on me"), user_blocks_on_path(current_user) %>
|
||||
<%= link_to t(".blocks on me"), user_received_blocks_path(current_user) %>
|
||||
<span class='badge count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
|
@ -93,7 +93,7 @@
|
|||
|
||||
<% if @user.blocks.exists? %>
|
||||
<li>
|
||||
<%= link_to t(".block_history"), user_blocks_on_path(@user) %>
|
||||
<%= link_to t(".block_history"), user_received_blocks_path(@user) %>
|
||||
<span class='badge count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue