diff --git a/app/helpers/links_helper.rb b/app/helpers/links_helper.rb
index 6c4f29630..dcca17693 100644
--- a/app/helpers/links_helper.rb
+++ b/app/helpers/links_helper.rb
@@ -4,4 +4,12 @@ module LinksHelper
t("links.form.delete_button"),
builder, class: "delete remove-element"
end
+
+ def link_to_signin(options = {})
+ link_to t("users.signin"), new_user_session_path, options
+ end
+
+ def link_to_signup(options = {})
+ link_to t("users.signup"), new_user_registration_path, options
+ end
end
diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb
index cc55283a4..3279b4e04 100644
--- a/app/views/budgets/index.html.erb
+++ b/app/views/budgets/index.html.erb
@@ -44,9 +44,7 @@
<% else %>
<%= t("budgets.investments.index.sidebar.not_logged_in",
- sign_in: link_to(t("users.signin"), new_user_session_path),
- sign_up: link_to(t("users.signup"), new_user_registration_path)
- ).html_safe %>
+ sign_in: link_to_signin, sign_up: link_to_signup).html_safe %>
<% end %>
<% end %>
diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb
index df7856927..0507d9090 100644
--- a/app/views/budgets/investments/_ballot.html.erb
+++ b/app/views/budgets/investments/_ballot.html.erb
@@ -44,8 +44,6 @@
<% verify_account = link_to(t("users.verify_account"), verification_path) %>
- <% signin = link_to(t("users.signin"), new_user_session_path) %>
- <% signup = link_to(t("users.signup"), new_user_registration_path) %>
<% my_heading = link_to(investment.heading.name,
budget_investments_path(budget_id: investment.budget_id,
heading_id: investment.heading_id)) %>
@@ -55,8 +53,8 @@
<%= t("budgets.ballots.reasons_for_not_balloting.#{reason}",
- verify_account: verify_account, signin: signin,
- signup: signup, my_heading: my_heading,
+ verify_account: verify_account, signin: link_to_signin,
+ signup: link_to_signup, my_heading: my_heading,
change_ballot: change_ballot,
heading_link: heading_link(@assigned_heading, @budget)).html_safe %>
diff --git a/app/views/budgets/investments/_votes.html.erb b/app/views/budgets/investments/_votes.html.erb
index f946d749c..d3bb650f1 100644
--- a/app/views/budgets/investments/_votes.html.erb
+++ b/app/views/budgets/investments/_votes.html.erb
@@ -34,8 +34,8 @@
<%= t("votes.budget_investments.#{reason}",
count: investment.group.max_votable_headings,
verify_account: link_to(t("users.verify_account"), verification_path),
- signin: link_to(t("users.signin"), new_user_session_path),
- signup: link_to(t("users.signup"), new_user_registration_path),
+ signin: link_to_signin,
+ signup: link_to_signup,
supported_headings: (current_user && current_user.headings_voted_within_group(investment.group).map(&:name).sort.to_sentence)
).html_safe %>
diff --git a/app/views/budgets/show.html.erb b/app/views/budgets/show.html.erb
index a602b076a..86cb7fadb 100644
--- a/app/views/budgets/show.html.erb
+++ b/app/views/budgets/show.html.erb
@@ -30,8 +30,7 @@
<% else %>
<%= t("budgets.investments.index.sidebar.not_logged_in",
- sign_in: link_to(t("users.signin"), new_user_session_path),
- sign_up: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
+ sign_in: link_to_signin, sign_up: link_to_signup).html_safe %>
<% end %>
<% end %>
diff --git a/app/views/comments/_votes.html.erb b/app/views/comments/_votes.html.erb
index 5b10fcc99..95e2ab60b 100644
--- a/app/views/comments/_votes.html.erb
+++ b/app/views/comments/_votes.html.erb
@@ -82,8 +82,8 @@
<%= t("votes.comment_unauthenticated",
- signin: link_to(t("users.signin"), new_user_session_path),
- signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
+ signin: link_to_signin,
+ signup: link_to_signup).html_safe %>
<% end %>
diff --git a/app/views/direct_messages/new.html.erb b/app/views/direct_messages/new.html.erb
index 513d4ab6d..cfd03a460 100644
--- a/app/views/direct_messages/new.html.erb
+++ b/app/views/direct_messages/new.html.erb
@@ -10,8 +10,7 @@
<%= t("users.login_to_continue",
- signin: link_to(t("users.signin"), new_user_session_path),
- signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
+ signin: link_to_signin, signup: link_to_signup).html_safe %>
<% elsif not @receiver.email_on_direct_message? %>
diff --git a/app/views/legislation/annotations/_comments_box.html.erb b/app/views/legislation/annotations/_comments_box.html.erb
index 9dc735f43..7340f7e04 100644
--- a/app/views/legislation/annotations/_comments_box.html.erb
+++ b/app/views/legislation/annotations/_comments_box.html.erb
@@ -35,8 +35,7 @@
<%= t("users.login_to_comment",
- signin: link_to(t("users.signin"), new_user_session_path),
- signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
+ signin: link_to_signin, signup: link_to_signup).html_safe %>
diff --git a/app/views/legislation/processes/_help_gif.html.erb b/app/views/legislation/processes/_help_gif.html.erb
index 943da67de..fdf00a2c5 100644
--- a/app/views/legislation/processes/_help_gif.html.erb
+++ b/app/views/legislation/processes/_help_gif.html.erb
@@ -12,8 +12,7 @@
<% else %>
<%= t("annotator.help.text",
- sign_in: link_to(t("users.signin"), new_user_session_path),
- sign_up: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
+ sign_in: link_to_signin, sign_up: link_to_signup).html_safe %>
<% end %>
diff --git a/app/views/legislation/questions/_participation_not_allowed.html.erb b/app/views/legislation/questions/_participation_not_allowed.html.erb
index 2c7d85782..da08ab9c0 100644
--- a/app/views/legislation/questions/_participation_not_allowed.html.erb
+++ b/app/views/legislation/questions/_participation_not_allowed.html.erb
@@ -14,8 +14,7 @@
<% elsif !user_signed_in? %>
<%= t("legislation.questions.participation.unauthenticated",
- signin: link_to(t("users.signin"), new_user_session_path),
- signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
+ signin: link_to_signin, signup: link_to_signup).html_safe %>
<% elsif !@process.debate_phase.open? %>
diff --git a/app/views/polls/_callout.html.erb b/app/views/polls/_callout.html.erb
index 4740bfcaa..4bb6e821d 100644
--- a/app/views/polls/_callout.html.erb
+++ b/app/views/polls/_callout.html.erb
@@ -2,8 +2,8 @@
<% if current_user.nil? %>
<%= t("polls.show.cant_answer_not_logged_in",
- signin: link_to(t("users.signin"), new_user_session_path, class: "probe-message"),
- signup: link_to(t("users.signup"), new_user_registration_path, class: "probe-message")).html_safe %>
+ signin: link_to_signin(class: "probe-message"),
+ signup: link_to_signup(class: "probe-message")).html_safe %>
<% elsif current_user.unverified? %>
diff --git a/app/views/shared/_login_to_comment.html.erb b/app/views/shared/_login_to_comment.html.erb
index aa21f6cdf..3b63339b8 100644
--- a/app/views/shared/_login_to_comment.html.erb
+++ b/app/views/shared/_login_to_comment.html.erb
@@ -1,6 +1,3 @@
- <%= t("users.login_to_comment",
- signin: link_to(t("users.signin"), new_user_session_path),
- signup: link_to(t("users.signup"), new_user_registration_path)
- ).html_safe %>
+ <%= t("users.login_to_comment", signin: link_to_signin, signup: link_to_signup).html_safe %>
diff --git a/app/views/shared/_login_to_vote.html.erb b/app/views/shared/_login_to_vote.html.erb
index 8349eab3e..30c86b8f6 100644
--- a/app/views/shared/_login_to_vote.html.erb
+++ b/app/views/shared/_login_to_vote.html.erb
@@ -1,6 +1,3 @@
- <%= t("users.login_to_continue",
- signin: link_to(t("users.signin"), new_user_session_path),
- signup: link_to(t("users.signup"), new_user_registration_path)
- ).html_safe %>
+ <%= t("users.login_to_continue", signin: link_to_signin, signup: link_to_signup).html_safe %>
diff --git a/app/views/topics/_informative_text.html.erb b/app/views/topics/_informative_text.html.erb
index 59a6a7327..1736ccb31 100644
--- a/app/views/topics/_informative_text.html.erb
+++ b/app/views/topics/_informative_text.html.erb
@@ -7,7 +7,6 @@
<% else %>
<%= t("community.show.create_first_community_topic.sub_first_theme",
- sign_in: link_to(t("users.signin"), new_user_session_path),
- sign_up: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
+ sign_in: link_to_signin, sign_up: link_to_signup).html_safe %>
<% end %>