From 86a205c8fcf3cdbc9f5149ba3bd1edd84c09b95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 1 Oct 2019 22:19:20 +0200 Subject: [PATCH] Extract link to verify account to a mehtod We were using the same text and the same route in many places. --- app/helpers/links_helper.rb | 4 ++++ app/views/budgets/index.html.erb | 2 +- app/views/budgets/investments/_ballot.html.erb | 3 +-- app/views/budgets/investments/_sidebar.html.erb | 2 +- app/views/budgets/investments/_votes.html.erb | 2 +- app/views/budgets/show.html.erb | 2 +- app/views/comments/_comment_tree.html.erb | 2 +- app/views/debates/_votes.html.erb | 3 +-- app/views/direct_messages/new.html.erb | 2 +- app/views/legislation/proposals/_featured_votes.html.erb | 3 +-- app/views/legislation/proposals/_votes.html.erb | 2 +- .../legislation/questions/_participation_not_allowed.html.erb | 2 +- app/views/proposals/_featured_votes.html.erb | 3 +-- app/views/proposals/_votes.html.erb | 3 +-- 14 files changed, 17 insertions(+), 18 deletions(-) diff --git a/app/helpers/links_helper.rb b/app/helpers/links_helper.rb index dcca17693..89321462e 100644 --- a/app/helpers/links_helper.rb +++ b/app/helpers/links_helper.rb @@ -12,4 +12,8 @@ module LinksHelper def link_to_signup(options = {}) link_to t("users.signup"), new_user_registration_path, options end + + def link_to_verify_account + link_to t("users.verify_account"), verification_path + end end diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb index 3279b4e04..e194af049 100644 --- a/app/views/budgets/index.html.erb +++ b/app/views/budgets/index.html.erb @@ -38,7 +38,7 @@ <% else %>
<%= t("budgets.investments.index.sidebar.verified_only", - verify: link_to(t("users.verify_account"), verification_path)).html_safe %> + verify: link_to_verify_account).html_safe %>
<% end %> <% else %> diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb index 0507d9090..ae027b2fc 100644 --- a/app/views/budgets/investments/_ballot.html.erb +++ b/app/views/budgets/investments/_ballot.html.erb @@ -43,7 +43,6 @@ <% if reason.present? && !ballot.has_investment?(investment) %>