From: Anton Khorev Date: Wed, 20 Mar 2024 01:27:58 +0000 (+0300) Subject: Simplify link_to user calls on block pages X-Git-Tag: live~650^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/85571799767b36d26d7f7397183131dfe826f67f Simplify link_to user calls on block pages --- diff --git a/app/views/user_blocks/_block.html.erb b/app/views/user_blocks/_block.html.erb index f39efb571..50fe74e4c 100644 --- a/app/views/user_blocks/_block.html.erb +++ b/app/views/user_blocks/_block.html.erb @@ -1,9 +1,9 @@ <% if show_user_name %> - <%= link_to block.user.display_name, user_path(block.user) %> + <%= link_to block.user.display_name, block.user %> <% end %> <% if show_creator_name %> - <%= link_to block.creator.display_name, user_path(block.creator) %> + <%= link_to block.creator.display_name, block.creator %> <% end %> <%= h truncate(block.reason) %> <%= h block_status(block) %> @@ -11,7 +11,7 @@ <% if block.revoker_id.nil? %> <%= t(".not_revoked") %> <% else %> - <%= link_to block.revoker.display_name, user_path(block.revoker) %> + <%= link_to block.revoker.display_name, block.revoker %> <% end %> <%= link_to t(".show"), block %> diff --git a/app/views/user_blocks/blocks_by.html.erb b/app/views/user_blocks/blocks_by.html.erb index d5283925b..87ff7f5b2 100644 --- a/app/views/user_blocks/blocks_by.html.erb +++ b/app/views/user_blocks/blocks_by.html.erb @@ -1,6 +1,6 @@ <% @title = t(".title", :name => @user.display_name) %> <% content_for :heading do %> -

<%= t(".heading_html", :name => link_to(@user.display_name, user_path(@user))) %>

+

<%= t(".heading_html", :name => link_to(@user.display_name, @user)) %>

<% end %> <% unless @user_blocks.empty? %> diff --git a/app/views/user_blocks/blocks_on.html.erb b/app/views/user_blocks/blocks_on.html.erb index 7d1f83ce3..ed03342dc 100644 --- a/app/views/user_blocks/blocks_on.html.erb +++ b/app/views/user_blocks/blocks_on.html.erb @@ -1,6 +1,6 @@ <% @title = t(".title", :name => @user.display_name) %> <% content_for :heading do %> -

<%= t(".heading_html", :name => link_to(@user.display_name, user_path(@user))) %>

+

<%= t(".heading_html", :name => link_to(@user.display_name, @user)) %>

<% end %> <% unless @user_blocks.empty? %> diff --git a/app/views/user_blocks/edit.html.erb b/app/views/user_blocks/edit.html.erb index db7c5e057..a5b165e9a 100644 --- a/app/views/user_blocks/edit.html.erb +++ b/app/views/user_blocks/edit.html.erb @@ -1,8 +1,6 @@ <% @title = t ".title", :name => @user_block.user.display_name %> <% content_for :heading do %> -

<%= t(".heading_html", - :name => link_to(@user_block.user.display_name, - user_path(@user_block.user))) %>

+

<%= t(".heading_html", :name => link_to(@user_block.user.display_name, @user_block.user)) %>