From 536dee8fc7f28ab2fc10a9e0873f33b649ad424f Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 12 Aug 2021 17:52:55 +0100 Subject: [PATCH] Use named paths for various user blocks links --- app/views/user_blocks/_block.html.erb | 2 +- app/views/user_blocks/show.html.erb | 2 +- app/views/users/show.html.erb | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/user_blocks/_block.html.erb b/app/views/user_blocks/_block.html.erb index b309e9e11..f39efb571 100644 --- a/app/views/user_blocks/_block.html.erb +++ b/app/views/user_blocks/_block.html.erb @@ -17,6 +17,6 @@ <%= link_to t(".show"), block %> <% if current_user and current_user.id == block.creator_id and block.active? %><%= link_to t(".edit"), edit_user_block_path(block) %><% end %> <% if show_revoke_link %> - <% if block.active? %><%= link_to t(".revoke"), :controller => "user_blocks", :action => "revoke", :id => block.id %><% end %> + <% if block.active? %><%= link_to t(".revoke"), revoke_user_block_path(block) %><% end %> <% end %> diff --git a/app/views/user_blocks/show.html.erb b/app/views/user_blocks/show.html.erb index 64f7299ef..d686bda10 100644 --- a/app/views/user_blocks/show.html.erb +++ b/app/views/user_blocks/show.html.erb @@ -14,7 +14,7 @@
  • <%= link_to t(".edit"), edit_user_block_path(@user_block) %>
  • <% end %> <% if can?(:revoke, UserBlock) %> -
  • <%= link_to(t(".revoke"), :controller => "user_blocks", :action => "revoke", :id => @user_block.id) %>
  • +
  • <%= link_to t(".revoke"), revoke_user_block_path(@user_block) %>
  • <% end %> <% end %>
  • <%= link_to t(".back"), user_blocks_path %>
  • diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 61a775c51..5e7883799 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -30,14 +30,14 @@ <% if current_user.blocks.exists? %>
  • - <%= link_to t(".blocks on me"), :controller => "user_blocks", :action => "blocks_on", :display_name => current_user.display_name %> + <%= link_to t(".blocks on me"), user_blocks_on_path(current_user) %> <%= number_with_delimiter(current_user.blocks.active.size) %>
  • <% end %> <% if can?(:create, UserBlock) and current_user.blocks_created.exists? %>
  • - <%= link_to t(".blocks by me"), :controller => "user_blocks", :action => "blocks_by", :display_name => current_user.display_name %> + <%= link_to t(".blocks by me"), user_blocks_by_path(current_user) %> <%= number_with_delimiter(current_user.blocks_created.active.size) %>
  • <% end %> @@ -84,21 +84,21 @@ <% if @user.blocks.exists? %>
  • - <%= link_to t(".block_history"), :controller => "user_blocks", :action => "blocks_on", :display_name => @user.display_name %> + <%= link_to t(".block_history"), user_blocks_on_path(@user) %> <%= number_with_delimiter(@user.blocks.active.size) %>
  • <% end %> <% if @user.moderator? and @user.blocks_created.exists? %>
  • - <%= link_to t(".moderator_history"), :controller => "user_blocks", :action => "blocks_by", :display_name => @user.display_name %> + <%= link_to t(".moderator_history"), user_blocks_by_path(@user) %> <%= number_with_delimiter(@user.blocks_created.active.size) %>
  • <% end %> <% if can?(:create, UserBlock) %>
  • - <%= link_to t(".create_block"), :controller => "user_blocks", :action => "new", :display_name => @user.display_name %> + <%= link_to t(".create_block"), new_user_block_path(@user) %>
  • <% end %> -- 2.45.1