From ae64458fceb39fec355e542f7313db458ddfd843 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javi=20Mart=C3=ADn?=
Date: Tue, 1 Oct 2019 21:16:53 +0200
Subject: [PATCH 1/7] Use the same I18n key for "login to comment" text
We were using several different keys, all of them having the same
translations.
---
app/views/comments/_comment_tree.html.erb | 6 +++---
app/views/comments/_commentable_tree.html.erb | 6 +++---
app/views/comments/_votes.html.erb | 4 ++--
app/views/debates/_comments.html.erb | 6 +++---
app/views/legislation/annotations/_comments_box.html.erb | 6 +++---
app/views/legislation/annotations/_form.html.erb | 6 +++---
app/views/legislation/proposals/_comments.html.erb | 6 +++---
app/views/polls/_comments.html.erb | 6 +++---
app/views/proposals/_comments.html.erb | 6 +++---
app/views/topics/_comments.html.erb | 6 +++---
config/locales/en/community.yml | 3 ---
config/locales/en/general.yml | 8 +++-----
config/locales/en/legislation.yml | 3 ---
config/locales/es/community.yml | 3 ---
config/locales/es/general.yml | 8 +++-----
config/locales/es/legislation.yml | 3 ---
16 files changed, 35 insertions(+), 51 deletions(-)
diff --git a/app/views/comments/_comment_tree.html.erb b/app/views/comments/_comment_tree.html.erb
index 0d9137c44..33824d743 100644
--- a/app/views/comments/_comment_tree.html.erb
+++ b/app/views/comments/_comment_tree.html.erb
@@ -35,9 +35,9 @@
<% else %>
- <%= t("debates.show.login_to_comment",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/comments/_commentable_tree.html.erb b/app/views/comments/_commentable_tree.html.erb
index 07ba48f52..ca45f0f80 100644
--- a/app/views/comments/_commentable_tree.html.erb
+++ b/app/views/comments/_commentable_tree.html.erb
@@ -20,9 +20,9 @@
- <%= t("debates.show.login_to_comment",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/comments/_votes.html.erb b/app/views/comments/_votes.html.erb
index 2b377ce4e..5b10fcc99 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("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ signin: link_to(t("users.signin"), new_user_session_path),
+ signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
<% end %>
diff --git a/app/views/debates/_comments.html.erb b/app/views/debates/_comments.html.erb
index e7e25f3e8..15f0d18d2 100644
--- a/app/views/debates/_comments.html.erb
+++ b/app/views/debates/_comments.html.erb
@@ -14,9 +14,9 @@
- <%= t("debates.show.login_to_comment",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/legislation/annotations/_comments_box.html.erb b/app/views/legislation/annotations/_comments_box.html.erb
index 4fe50f225..9dc735f43 100644
--- a/app/views/legislation/annotations/_comments_box.html.erb
+++ b/app/views/legislation/annotations/_comments_box.html.erb
@@ -34,9 +34,9 @@
- <%= t("legislation.annotations.form.login_to_comment",
- signin: link_to(t("legislation.annotations.form.signin"), new_user_session_path),
- signup: link_to(t("legislation.annotations.form.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
diff --git a/app/views/legislation/annotations/_form.html.erb b/app/views/legislation/annotations/_form.html.erb
index 7ca1401a2..dd48038ba 100644
--- a/app/views/legislation/annotations/_form.html.erb
+++ b/app/views/legislation/annotations/_form.html.erb
@@ -24,9 +24,9 @@
<% end %>
<% else %>
- <%= t("legislation.annotations.form.login_to_comment",
- signin: link_to(t("legislation.annotations.form.signin"), new_user_session_path),
- signup: link_to(t("legislation.annotations.form.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/legislation/proposals/_comments.html.erb b/app/views/legislation/proposals/_comments.html.erb
index ffd5d5acb..6ff14f477 100644
--- a/app/views/legislation/proposals/_comments.html.erb
+++ b/app/views/legislation/proposals/_comments.html.erb
@@ -9,9 +9,9 @@
- <%= t("proposals.show.login_to_comment",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/polls/_comments.html.erb b/app/views/polls/_comments.html.erb
index bc2ca8e07..017684b02 100644
--- a/app/views/polls/_comments.html.erb
+++ b/app/views/polls/_comments.html.erb
@@ -9,9 +9,9 @@
- <%= t("polls.show.login_to_comment",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/proposals/_comments.html.erb b/app/views/proposals/_comments.html.erb
index ffd5d5acb..6ff14f477 100644
--- a/app/views/proposals/_comments.html.erb
+++ b/app/views/proposals/_comments.html.erb
@@ -9,9 +9,9 @@
- <%= t("proposals.show.login_to_comment",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/topics/_comments.html.erb b/app/views/topics/_comments.html.erb
index b2ee11d99..c1e29af2c 100644
--- a/app/views/topics/_comments.html.erb
+++ b/app/views/topics/_comments.html.erb
@@ -15,9 +15,9 @@
<% else %>
- <%= t("topics.show.login_to_comment",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/config/locales/en/community.yml b/config/locales/en/community.yml
index 3e46a0685..b0b0eaba1 100644
--- a/config/locales/en/community.yml
+++ b/config/locales/en/community.yml
@@ -55,6 +55,3 @@ en:
recommendation_one: Do not write the topic title or whole sentences in capital letters. On the internet that is considered shouting. And no one likes to be yelled at.
recommendation_two: Any topic or comment that implies an illegal action will be eliminated, also those that intend to sabotage the spaces of the subject, everything else is allowed.
recommendation_three: Enjoy this space, the voices that fill it, it's yours too.
- topics:
- show:
- login_to_comment: You must %{signin} or %{signup} to leave a comment.
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index dd337a680..dcb63c9bf 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -164,7 +164,6 @@ en:
comments_title: Comments
edit_debate_link: Edit
flag: This debate has been flagged as inappropriate by several users.
- login_to_comment: You must %{signin} or %{signup} to leave a comment.
share: Share
author: Author
update:
@@ -462,7 +461,6 @@ en:
comments_tab: Comments
dashboard_proposal_link: Dashboard
flag: This proposal has been flagged as inappropriate by several users.
- login_to_comment: You must %{signin} or %{signup} to leave a comment.
notifications_tab: Notifications
milestones_tab: Milestones
retired_warning: "The author considers this proposal should not receive more supports."
@@ -667,7 +665,6 @@ en:
back: Back to voting
cant_answer_not_logged_in: "You must %{signin} or %{signup} to participate."
comments_tab: Comments
- login_to_comment: You must %{signin} or %{signup} to leave a comment.
signin: Sign in
signup: Sign up
cant_answer_verify_html: "You must %{verify_link} in order to answer."
@@ -861,6 +858,9 @@ en:
manage:
all: "You do not have permission to carry out the action '%{action}' on %{subject}."
users:
+ login_to_comment: "You must %{signin} or %{signup} to leave a comment."
+ signin: Sign in
+ signup: Sign up
direct_messages:
new:
body_label: Message
@@ -920,8 +920,6 @@ en:
comment_unauthenticated: You must %{signin} or %{signup} to vote.
disagree: I disagree
organizations: Organizations are not permitted to vote
- signin: Sign in
- signup: Sign up
supports: Supports
unauthenticated: You must %{signin} or %{signup} to continue.
verified_only: Only verified users can vote on proposals; %{verify_account}.
diff --git a/config/locales/en/legislation.yml b/config/locales/en/legislation.yml
index 7900d86bd..c9d0b8a58 100644
--- a/config/locales/en/legislation.yml
+++ b/config/locales/en/legislation.yml
@@ -14,9 +14,6 @@ en:
publish_comment: Publish Comment
form:
phase_not_open: This phase is not open
- login_to_comment: You must %{signin} or %{signup} to leave a comment.
- signin: Sign in
- signup: Sign up
index:
title: Comments
comments_about: Comments about
diff --git a/config/locales/es/community.yml b/config/locales/es/community.yml
index 2d62c7b2f..8f8ef09c1 100644
--- a/config/locales/es/community.yml
+++ b/config/locales/es/community.yml
@@ -55,6 +55,3 @@ es:
recommendation_one: No escribas el título del tema o frases enteras en mayúsculas. En internet eso se considera gritar. Y a nadie le gusta que le griten.
recommendation_two: Cualquier tema o comentario que implique una acción ilegal será eliminada, también las que tengan la intención de sabotear los espacios del tema, todo lo demás está permitido.
recommendation_three: Disfruta de este espacio, de las voces que lo llenan, también es tuyo
- topics:
- show:
- login_to_comment: Necesitas %{signin} o %{signup} para comentar.
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index 51fe7d00a..e48b32953 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -164,7 +164,6 @@ es:
comments_title: Comentarios
edit_debate_link: Editar debate
flag: Este debate ha sido marcado como inapropiado por varios usuarios.
- login_to_comment: Necesitas %{signin} o %{signup} para comentar.
share: Compartir
author: Autor
update:
@@ -462,7 +461,6 @@ es:
comments_tab: Comentarios
dashboard_proposal_link: Panel de control
flag: Esta propuesta ha sido marcada como inapropiada por varios usuarios.
- login_to_comment: Necesitas %{signin} o %{signup} para comentar.
notifications_tab: Notificaciones
milestones_tab: Seguimiento
retired_warning: "El autor de esta propuesta considera que ya no debe seguir recogiendo apoyos."
@@ -665,7 +663,6 @@ es:
back: Volver a votaciones
cant_answer_not_logged_in: "Necesitas %{signin} o %{signup} para participar."
comments_tab: Comentarios
- login_to_comment: Necesitas %{signin} o %{signup} para comentar.
signin: iniciar sesión
signup: registrarte
cant_answer_verify_html: "Por favor %{verify_link} para poder responder."
@@ -858,6 +855,9 @@ es:
manage:
all: "No tienes permiso para realizar la acción '%{action}' sobre %{subject}."
users:
+ login_to_comment: "Necesitas %{signin} o %{signup} para comentar."
+ signin: iniciar sesión
+ signup: registrarte
direct_messages:
new:
body_label: Mensaje
@@ -917,8 +917,6 @@ es:
comment_unauthenticated: Necesitas %{signin} o %{signup} para poder votar.
disagree: No estoy de acuerdo
organizations: Las organizaciones no pueden votar.
- signin: iniciar sesión
- signup: registrarte
supports: Apoyos
unauthenticated: Necesitas %{signin} o %{signup} para continuar.
verified_only: Las propuestas sólo pueden ser votadas por usuarios verificados, %{verify_account}.
diff --git a/config/locales/es/legislation.yml b/config/locales/es/legislation.yml
index 2864a6184..19a86e119 100644
--- a/config/locales/es/legislation.yml
+++ b/config/locales/es/legislation.yml
@@ -14,9 +14,6 @@ es:
publish_comment: Publicar Comentario
form:
phase_not_open: Esta fase del proceso no está abierta
- login_to_comment: Necesitas %{signin} o %{signup} para comentar.
- signin: iniciar sesión
- signup: registrarte
index:
title: Comentarios
comments_about: Comentarios sobre
From 78c6f6f7e93b820d2c3ba0007a14e0abe45e907e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javi=20Mart=C3=ADn?=
Date: Tue, 1 Oct 2019 22:49:31 +0200
Subject: [PATCH 2/7] Use the same key for "signin" and "signup" texts
We were using the same texts in several places
---
app/views/budgets/index.html.erb | 7 +++----
app/views/budgets/investments/_ballot.html.erb | 5 ++---
app/views/budgets/investments/_votes.html.erb | 4 ++--
app/views/budgets/show.html.erb | 4 ++--
app/views/debates/_votes.html.erb | 6 +++---
app/views/direct_messages/new.html.erb | 6 +++---
app/views/legislation/processes/_help_gif.html.erb | 4 ++--
.../legislation/proposals/_featured_votes.html.erb | 4 ++--
app/views/legislation/proposals/_votes.html.erb | 6 +++---
.../questions/_participation_not_allowed.html.erb | 4 ++--
app/views/polls/_callout.html.erb | 4 ++--
app/views/proposals/_featured_votes.html.erb | 6 +++---
app/views/proposals/_votes.html.erb | 6 +++---
app/views/topics/_informative_text.html.erb | 4 ++--
config/locales/en/budgets.yml | 2 --
config/locales/en/community.yml | 2 --
config/locales/en/general.yml | 13 +++----------
config/locales/en/legislation.yml | 2 --
config/locales/es/budgets.yml | 2 --
config/locales/es/community.yml | 2 --
config/locales/es/general.yml | 11 +++--------
config/locales/es/legislation.yml | 2 --
spec/features/budgets/ballots_spec.rb | 2 +-
spec/features/comments/budget_investments_spec.rb | 2 +-
spec/features/comments/debates_spec.rb | 2 +-
.../comments/legislation_annotations_spec.rb | 2 +-
.../features/comments/legislation_questions_spec.rb | 2 +-
spec/features/comments/polls_spec.rb | 2 +-
spec/features/comments/proposals_spec.rb | 2 +-
spec/features/comments/topics_spec.rb | 4 ++--
spec/features/legislation/draft_versions_spec.rb | 2 +-
spec/features/polls/polls_spec.rb | 2 +-
spec/support/common_actions/votes.rb | 4 ++--
33 files changed, 53 insertions(+), 79 deletions(-)
diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb
index 5a7dde0ba..5d3cf11aa 100644
--- a/app/views/budgets/index.html.erb
+++ b/app/views/budgets/index.html.erb
@@ -45,10 +45,9 @@
<% else %>
<%= t("budgets.investments.index.sidebar.not_logged_in",
- sign_in: link_to(t("budgets.investments.index.sidebar.sign_in"),
- new_user_session_path),
- sign_up: link_to(t("budgets.investments.index.sidebar.sign_up"),
- new_user_registration_path)).html_safe %>
+ sign_in: link_to(t("users.signin"), new_user_session_path),
+ sign_up: link_to(t("users.signup"), new_user_registration_path)
+ ).html_safe %>
<% end %>
<% end %>
diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb
index 2913d2a32..c21b2818e 100644
--- a/app/views/budgets/investments/_ballot.html.erb
+++ b/app/views/budgets/investments/_ballot.html.erb
@@ -43,10 +43,9 @@
<% if reason.present? && !ballot.has_investment?(investment) %>
-
<% verify_account = link_to(t("votes.verify_account"), verification_path) %>
- <% signin = link_to(t("votes.signin"), new_user_session_path) %>
- <% signup = link_to(t("votes.signup"), new_user_registration_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)) %>
diff --git a/app/views/budgets/investments/_votes.html.erb b/app/views/budgets/investments/_votes.html.erb
index 0483e9040..9c0aba6d4 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("votes.verify_account"), verification_path),
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path),
+ signin: link_to(t("users.signin"), new_user_session_path),
+ signup: link_to(t("users.signup"), new_user_registration_path),
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 26af33856..c6fc56529 100644
--- a/app/views/budgets/show.html.erb
+++ b/app/views/budgets/show.html.erb
@@ -30,8 +30,8 @@
<% else %>
<%= t("budgets.investments.index.sidebar.not_logged_in",
- sign_in: link_to(t("budgets.investments.index.sidebar.sign_in"), new_user_session_path),
- sign_up: link_to(t("budgets.investments.index.sidebar.sign_up"), new_user_registration_path)).html_safe %>
+ sign_in: link_to(t("users.signin"), new_user_session_path),
+ sign_up: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
<% end %>
<% end %>
diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb
index 2fed2fe85..dd7c6e1ea 100644
--- a/app/views/debates/_votes.html.erb
+++ b/app/views/debates/_votes.html.erb
@@ -59,9 +59,9 @@
<% elsif !user_signed_in? %>
- <%= t("votes.unauthenticated",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/direct_messages/new.html.erb b/app/views/direct_messages/new.html.erb
index 4f57d10ad..6e403d48f 100644
--- a/app/views/direct_messages/new.html.erb
+++ b/app/views/direct_messages/new.html.erb
@@ -9,9 +9,9 @@
<% if not current_user %>
- <%= t("users.direct_messages.new.authenticate",
- signin: link_to(t("users.direct_messages.new.signin"), new_user_session_path),
- signup: link_to(t("users.direct_messages.new.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% elsif not @receiver.email_on_direct_message? %>
diff --git a/app/views/legislation/processes/_help_gif.html.erb b/app/views/legislation/processes/_help_gif.html.erb
index 5b14f4d2b..943da67de 100644
--- a/app/views/legislation/processes/_help_gif.html.erb
+++ b/app/views/legislation/processes/_help_gif.html.erb
@@ -12,8 +12,8 @@
<% else %>
<%= t("annotator.help.text",
- sign_in: link_to(t("annotator.help.text_sign_in"), new_user_session_path),
- sign_up: link_to(t("annotator.help.text_sign_up"), new_user_registration_path)).html_safe %>
+ sign_in: link_to(t("users.signin"), new_user_session_path),
+ sign_up: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
<% end %>
diff --git a/app/views/legislation/proposals/_featured_votes.html.erb b/app/views/legislation/proposals/_featured_votes.html.erb
index a514f51fe..df99dfd95 100644
--- a/app/views/legislation/proposals/_featured_votes.html.erb
+++ b/app/views/legislation/proposals/_featured_votes.html.erb
@@ -29,8 +29,8 @@
<% elsif !user_signed_in? %>
<%= t("votes.unauthenticated",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ signin: link_to(t("users.signin"), new_user_session_path),
+ signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
<% end %>
diff --git a/app/views/legislation/proposals/_votes.html.erb b/app/views/legislation/proposals/_votes.html.erb
index 7d06045b0..6ce1b28f0 100644
--- a/app/views/legislation/proposals/_votes.html.erb
+++ b/app/views/legislation/proposals/_votes.html.erb
@@ -61,9 +61,9 @@
<% elsif !user_signed_in? %>
- <%= t("votes.unauthenticated",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/legislation/questions/_participation_not_allowed.html.erb b/app/views/legislation/questions/_participation_not_allowed.html.erb
index 18862a826..269f7f859 100644
--- a/app/views/legislation/questions/_participation_not_allowed.html.erb
+++ b/app/views/legislation/questions/_participation_not_allowed.html.erb
@@ -14,8 +14,8 @@
<% elsif !user_signed_in? %>
<%= t("legislation.questions.participation.unauthenticated",
- signin: link_to(t("legislation.questions.participation.signin"), new_user_session_path),
- signup: link_to(t("legislation.questions.participation.signup"), new_user_registration_path)).html_safe %>
+ signin: link_to(t("users.signin"), new_user_session_path),
+ signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
<% elsif !@process.debate_phase.open? %>
diff --git a/app/views/polls/_callout.html.erb b/app/views/polls/_callout.html.erb
index 24dc2d775..4740bfcaa 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("polls.show.signin"), new_user_session_path, class: "probe-message"),
- signup: link_to(t("polls.show.signup"), new_user_registration_path, class: "probe-message")).html_safe %>
+ 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 %>
<% elsif current_user.unverified? %>
diff --git a/app/views/proposals/_featured_votes.html.erb b/app/views/proposals/_featured_votes.html.erb
index a514f51fe..81caf134a 100644
--- a/app/views/proposals/_featured_votes.html.erb
+++ b/app/views/proposals/_featured_votes.html.erb
@@ -28,9 +28,9 @@
<% elsif !user_signed_in? %>
- <%= t("votes.unauthenticated",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/proposals/_votes.html.erb b/app/views/proposals/_votes.html.erb
index 399dacd15..427215ba5 100644
--- a/app/views/proposals/_votes.html.erb
+++ b/app/views/proposals/_votes.html.erb
@@ -37,9 +37,9 @@
<% elsif !user_signed_in? %>
- <%= t("votes.unauthenticated",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
+ <%= 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 %>
<% end %>
diff --git a/app/views/topics/_informative_text.html.erb b/app/views/topics/_informative_text.html.erb
index 6a8475d8f..59a6a7327 100644
--- a/app/views/topics/_informative_text.html.erb
+++ b/app/views/topics/_informative_text.html.erb
@@ -7,7 +7,7 @@
<% else %>
<%= t("community.show.create_first_community_topic.sub_first_theme",
- sign_in: link_to(t("community.show.create_first_community_topic.sign_in"), new_user_session_path),
- sign_up: link_to(t("community.show.create_first_community_topic.sign_up"), new_user_registration_path)).html_safe %>
+ sign_in: link_to(t("users.signin"), new_user_session_path),
+ sign_up: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
<% end %>
diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml
index f3b576ce3..fa275e71c 100644
--- a/config/locales/en/budgets.yml
+++ b/config/locales/en/budgets.yml
@@ -98,8 +98,6 @@ en:
verify_account: "verify your account"
create: "Create a budget investment"
not_logged_in: "To create a new budget investment you must %{sign_in} or %{sign_up}."
- sign_in: "sign in"
- sign_up: "sign up"
by_feasibility: By feasibility
feasible: Feasible projects
unfeasible: Unfeasible projects
diff --git a/config/locales/en/community.yml b/config/locales/en/community.yml
index b0b0eaba1..d08d9dbab 100644
--- a/config/locales/en/community.yml
+++ b/config/locales/en/community.yml
@@ -17,8 +17,6 @@ en:
first_theme_not_logged_in: No issue available, participate creating the first one.
first_theme: Create the first community topic
sub_first_theme: "To create a theme you must %{sign_in} or %{sign_up}."
- sign_in: "sign in"
- sign_up: "sign up"
tab:
participants: Participants
sidebar:
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index dcb63c9bf..a3e6d3662 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -665,8 +665,6 @@ en:
back: Back to voting
cant_answer_not_logged_in: "You must %{signin} or %{signup} to participate."
comments_tab: Comments
- signin: Sign in
- signup: Sign up
cant_answer_verify_html: "You must %{verify_link} in order to answer."
verify_link: "verify your account"
cant_answer_expired: "This poll has finished."
@@ -859,8 +857,9 @@ en:
all: "You do not have permission to carry out the action '%{action}' on %{subject}."
users:
login_to_comment: "You must %{signin} or %{signup} to leave a comment."
- signin: Sign in
- signup: Sign up
+ login_to_continue: "You must %{signin} or %{signup} to continue."
+ signin: "sign in"
+ signup: "sign up"
direct_messages:
new:
body_label: Message
@@ -870,9 +869,6 @@ en:
title_label: Title
verified_only: To send a private message %{verify_account}
verify_account: verify your account
- authenticate: You must %{signin} or %{signup} to continue.
- signin: sign in
- signup: sign up
show:
receiver: Message sent to %{receiver}
show:
@@ -921,7 +917,6 @@ en:
disagree: I disagree
organizations: Organizations are not permitted to vote
supports: Supports
- unauthenticated: You must %{signin} or %{signup} to continue.
verified_only: Only verified users can vote on proposals; %{verify_account}.
verify_account: verify your account
budget_investments:
@@ -1002,8 +997,6 @@ en:
help:
alt: Select the text you want to comment and press the button with the pencil.
text: To comment this document you must %{sign_in} or %{sign_up}. Then select the text you want to comment and press the button with the pencil.
- text_sign_in: login
- text_sign_up: sign up
title: How I can comment this document?
links:
form:
diff --git a/config/locales/en/legislation.yml b/config/locales/en/legislation.yml
index c9d0b8a58..f365297de 100644
--- a/config/locales/en/legislation.yml
+++ b/config/locales/en/legislation.yml
@@ -113,8 +113,6 @@ en:
participation:
phase_not_open: This phase is not open
organizations: Organisations are not permitted to participate in the debate
- signin: Sign in
- signup: Sign up
unauthenticated: You must %{signin} or %{signup} to participate.
verified_only: Only verified users can participate, %{verify_account}.
verify_account: verify your account
diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml
index 855598a0d..8b18b9c3e 100644
--- a/config/locales/es/budgets.yml
+++ b/config/locales/es/budgets.yml
@@ -98,8 +98,6 @@ es:
verify_account: "verifica tu cuenta"
create: "Crear proyecto de gasto"
not_logged_in: "Para crear un nuevo proyecto de gasto debes %{sign_in} o %{sign_up}."
- sign_in: "iniciar sesión"
- sign_up: "registrarte"
by_feasibility: Por viabilidad
feasible: Ver los proyectos viables
unfeasible: Ver los proyectos inviables
diff --git a/config/locales/es/community.yml b/config/locales/es/community.yml
index 8f8ef09c1..f1090cba8 100644
--- a/config/locales/es/community.yml
+++ b/config/locales/es/community.yml
@@ -17,8 +17,6 @@ es:
first_theme_not_logged_in: No hay ningún tema disponible, participa creando el primero.
first_theme: Crea el primer tema de la comunidad
sub_first_theme: "Para crear un tema debes %{sign_in} o %{sign_up}."
- sign_in: "iniciar sesión"
- sign_up: "registrarte"
tab:
participants: Participantes
sidebar:
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index e48b32953..3db1f24af 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -663,8 +663,6 @@ es:
back: Volver a votaciones
cant_answer_not_logged_in: "Necesitas %{signin} o %{signup} para participar."
comments_tab: Comentarios
- signin: iniciar sesión
- signup: registrarte
cant_answer_verify_html: "Por favor %{verify_link} para poder responder."
verify_link: "verifica tu cuenta"
cant_answer_expired: "Esta votación ha terminado."
@@ -856,8 +854,9 @@ es:
all: "No tienes permiso para realizar la acción '%{action}' sobre %{subject}."
users:
login_to_comment: "Necesitas %{signin} o %{signup} para comentar."
- signin: iniciar sesión
- signup: registrarte
+ login_to_continue: "Necesitas %{signin} o %{signup} para continuar."
+ signin: "iniciar sesión"
+ signup: "registrarte"
direct_messages:
new:
body_label: Mensaje
@@ -867,9 +866,6 @@ es:
title_label: Título
verified_only: Para enviar un mensaje privado %{verify_account}
verify_account: verifica tu cuenta
- authenticate: Necesitas %{signin} o %{signup}.
- signin: iniciar sesión
- signup: registrarte
show:
receiver: Mensaje enviado a %{receiver}
show:
@@ -918,7 +914,6 @@ es:
disagree: No estoy de acuerdo
organizations: Las organizaciones no pueden votar.
supports: Apoyos
- unauthenticated: Necesitas %{signin} o %{signup} para continuar.
verified_only: Las propuestas sólo pueden ser votadas por usuarios verificados, %{verify_account}.
verify_account: verifica tu cuenta
budget_investments:
diff --git a/config/locales/es/legislation.yml b/config/locales/es/legislation.yml
index 19a86e119..134372a70 100644
--- a/config/locales/es/legislation.yml
+++ b/config/locales/es/legislation.yml
@@ -112,8 +112,6 @@ es:
participation:
phase_not_open: Esta fase no está abierta
organizations: Las organizaciones no pueden participar en el debate
- signin: iniciar sesión
- signup: registrarte
unauthenticated: Necesitas %{signin} o %{signup} para participar en el debate.
verified_only: Solo los usuarios verificados pueden participar en el debate, %{verify_account}.
verify_account: verifica tu cuenta
diff --git a/spec/features/budgets/ballots_spec.rb b/spec/features/budgets/ballots_spec.rb
index 9d8e088ef..9b291112b 100644
--- a/spec/features/budgets/ballots_spec.rb
+++ b/spec/features/budgets/ballots_spec.rb
@@ -516,7 +516,7 @@ describe "Ballots" do
within("#budget_investment_#{investment.id}") do
find("div.ballot").hover
- expect(page).to have_content "You must Sign in or Sign up to continue."
+ expect(page).to have_content "You must sign in or sign up to continue."
expect(page).to have_selector(".in-favor a", visible: false)
end
end
diff --git a/spec/features/comments/budget_investments_spec.rb b/spec/features/comments/budget_investments_spec.rb
index 00d37efc1..53657137f 100644
--- a/spec/features/comments/budget_investments_spec.rb
+++ b/spec/features/comments/budget_investments_spec.rb
@@ -182,7 +182,7 @@ describe "Commenting Budget::Investments" do
create(:comment, commentable: investment)
visit budget_investment_path(investment.budget, investment)
- expect(page).to have_content "You must Sign in or Sign up to leave a comment"
+ expect(page).to have_content "You must sign in or sign up to leave a comment"
within("#comments") do
expect(page).not_to have_content "Write a comment"
expect(page).not_to have_content "Reply"
diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb
index 6f185928d..77088ef66 100644
--- a/spec/features/comments/debates_spec.rb
+++ b/spec/features/comments/debates_spec.rb
@@ -179,7 +179,7 @@ describe "Commenting debates" do
create(:comment, commentable: debate)
visit debate_path(debate)
- expect(page).to have_content "You must Sign in or Sign up to leave a comment"
+ expect(page).to have_content "You must sign in or sign up to leave a comment"
within("#comments") do
expect(page).not_to have_content "Write a comment"
expect(page).not_to have_content "Reply"
diff --git a/spec/features/comments/legislation_annotations_spec.rb b/spec/features/comments/legislation_annotations_spec.rb
index 29e162617..e905ffb07 100644
--- a/spec/features/comments/legislation_annotations_spec.rb
+++ b/spec/features/comments/legislation_annotations_spec.rb
@@ -214,7 +214,7 @@ describe "Commenting legislation questions" do
legislation_annotation.draft_version,
legislation_annotation)
- expect(page).to have_content "You must Sign in or Sign up to leave a comment"
+ expect(page).to have_content "You must sign in or sign up to leave a comment"
within("#comments") do
expect(page).not_to have_content "Write a comment"
expect(page).not_to have_content "Reply"
diff --git a/spec/features/comments/legislation_questions_spec.rb b/spec/features/comments/legislation_questions_spec.rb
index 43d919738..9f7968efc 100644
--- a/spec/features/comments/legislation_questions_spec.rb
+++ b/spec/features/comments/legislation_questions_spec.rb
@@ -186,7 +186,7 @@ describe "Commenting legislation questions" do
create(:comment, commentable: legislation_question)
visit legislation_process_question_path(legislation_question.process, legislation_question)
- expect(page).to have_content "You must Sign in or Sign up to leave a comment"
+ expect(page).to have_content "You must sign in or sign up to leave a comment"
within("#comments") do
expect(page).not_to have_content "Write a comment"
expect(page).not_to have_content "Reply"
diff --git a/spec/features/comments/polls_spec.rb b/spec/features/comments/polls_spec.rb
index 155ad1762..9f580cbb5 100644
--- a/spec/features/comments/polls_spec.rb
+++ b/spec/features/comments/polls_spec.rb
@@ -180,7 +180,7 @@ describe "Commenting polls" do
create(:comment, commentable: poll)
visit poll_path(poll)
- expect(page).to have_content "You must Sign in or Sign up to leave a comment"
+ expect(page).to have_content "You must sign in or sign up to leave a comment"
within("#comments") do
expect(page).not_to have_content "Write a comment"
expect(page).not_to have_content "Reply"
diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb
index 9308fecc0..96fa8ff13 100644
--- a/spec/features/comments/proposals_spec.rb
+++ b/spec/features/comments/proposals_spec.rb
@@ -178,7 +178,7 @@ describe "Commenting proposals" do
create(:comment, commentable: proposal)
visit proposal_path(proposal)
- expect(page).to have_content "You must Sign in or Sign up to leave a comment"
+ expect(page).to have_content "You must sign in or sign up to leave a comment"
within("#comments") do
expect(page).not_to have_content "Write a comment"
expect(page).not_to have_content "Reply"
diff --git a/spec/features/comments/topics_spec.rb b/spec/features/comments/topics_spec.rb
index ddecf8c39..67ee00d33 100644
--- a/spec/features/comments/topics_spec.rb
+++ b/spec/features/comments/topics_spec.rb
@@ -196,7 +196,7 @@ describe "Commenting topics from proposals" do
visit community_topic_path(community, topic)
- expect(page).to have_content "You must Sign in or Sign up to leave a comment"
+ expect(page).to have_content "You must sign in or sign up to leave a comment"
within("#comments") do
expect(page).not_to have_content "Write a comment"
expect(page).not_to have_content "Reply"
@@ -747,7 +747,7 @@ describe "Commenting topics from budget investments" do
visit community_topic_path(community, topic)
- expect(page).to have_content "You must Sign in or Sign up to leave a comment"
+ expect(page).to have_content "You must sign in or sign up to leave a comment"
within("#comments") do
expect(page).not_to have_content "Write a comment"
expect(page).not_to have_content "Reply"
diff --git a/spec/features/legislation/draft_versions_spec.rb b/spec/features/legislation/draft_versions_spec.rb
index 72b18fbfd..b7e23e4de 100644
--- a/spec/features/legislation/draft_versions_spec.rb
+++ b/spec/features/legislation/draft_versions_spec.rb
@@ -168,7 +168,7 @@ describe "Legislation Draft Versions" do
page.find(:css, ".legislation-annotatable").double_click
page.find(:css, ".annotator-adder button").click
expect(page).not_to have_css("#legislation_annotation_text")
- expect(page).to have_content "You must Sign in or Sign up to leave a comment."
+ expect(page).to have_content "You must sign in or sign up to leave a comment."
end
scenario "Create" do
diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb
index df60a0499..af8b61c5c 100644
--- a/spec/features/polls/polls_spec.rb
+++ b/spec/features/polls/polls_spec.rb
@@ -192,7 +192,7 @@ describe "Polls" do
visit poll_path(poll)
- expect(page).to have_content("You must Sign in or Sign up to participate")
+ expect(page).to have_content("You must sign in or sign up to participate")
expect(page).to have_link("Yes", href: new_user_session_path)
expect(page).to have_link("No", href: new_user_session_path)
end
diff --git a/spec/support/common_actions/votes.rb b/spec/support/common_actions/votes.rb
index 6eff866a8..9ab6b863a 100644
--- a/spec/support/common_actions/votes.rb
+++ b/spec/support/common_actions/votes.rb
@@ -1,11 +1,11 @@
module Votes
def expect_message_you_need_to_sign_in
- expect(page).to have_content "You must Sign in or Sign up to continue"
+ expect(page).to have_content "You must sign in or sign up to continue"
expect(page).to have_selector(".in-favor", visible: false)
end
def expect_message_you_need_to_sign_in_to_vote_comments
- expect(page).to have_content "You must Sign in or Sign up to vote"
+ expect(page).to have_content "You must sign in or sign up to vote"
expect(page).to have_selector(".participation-allowed", visible: false)
expect(page).to have_selector(".participation-not-allowed", visible: true)
end
From 2ccc283bb737f0e4052a3c8cbf7dcd094bdae93c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javi=20Mart=C3=ADn?=
Date: Tue, 1 Oct 2019 22:13:46 +0200
Subject: [PATCH 3/7] Use the same I18n key for "verify account" text
We were using several different keys, all of them having the same text.
---
app/views/budgets/index.html.erb | 3 +--
app/views/budgets/investments/_ballot.html.erb | 2 +-
app/views/budgets/investments/_sidebar.html.erb | 3 +--
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 | 2 +-
app/views/direct_messages/new.html.erb | 3 +--
app/views/legislation/proposals/_featured_votes.html.erb | 2 +-
app/views/legislation/proposals/_votes.html.erb | 2 +-
.../legislation/questions/_participation_not_allowed.html.erb | 2 +-
app/views/proposals/_featured_votes.html.erb | 2 +-
app/views/proposals/_votes.html.erb | 2 +-
config/locales/en/budgets.yml | 1 -
config/locales/en/general.yml | 4 +---
config/locales/en/legislation.yml | 1 -
config/locales/es/budgets.yml | 1 -
config/locales/es/general.yml | 4 +---
config/locales/es/legislation.yml | 1 -
19 files changed, 15 insertions(+), 26 deletions(-)
diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb
index 5d3cf11aa..cc55283a4 100644
--- a/app/views/budgets/index.html.erb
+++ b/app/views/budgets/index.html.erb
@@ -38,8 +38,7 @@
<% else %>
<%= t("budgets.investments.index.sidebar.verified_only",
- verify: link_to(t("budgets.investments.index.sidebar.verify_account"),
- verification_path)).html_safe %>
+ verify: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% end %>
<% else %>
diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb
index c21b2818e..df7856927 100644
--- a/app/views/budgets/investments/_ballot.html.erb
+++ b/app/views/budgets/investments/_ballot.html.erb
@@ -43,7 +43,7 @@
<% if reason.present? && !ballot.has_investment?(investment) %>
- <% verify_account = link_to(t("votes.verify_account"), verification_path) %>
+ <% 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,
diff --git a/app/views/budgets/investments/_sidebar.html.erb b/app/views/budgets/investments/_sidebar.html.erb
index 4f18054f4..4f3c3ee60 100644
--- a/app/views/budgets/investments/_sidebar.html.erb
+++ b/app/views/budgets/investments/_sidebar.html.erb
@@ -7,8 +7,7 @@
<% else %>
<%= t("budgets.investments.index.sidebar.verified_only",
- verify: link_to(t("budgets.investments.index.sidebar.verify_account"),
- verification_path)).html_safe %>
+ verify: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% end %>
<% end %>
diff --git a/app/views/budgets/investments/_votes.html.erb b/app/views/budgets/investments/_votes.html.erb
index 9c0aba6d4..f946d749c 100644
--- a/app/views/budgets/investments/_votes.html.erb
+++ b/app/views/budgets/investments/_votes.html.erb
@@ -33,7 +33,7 @@
<%= t("votes.budget_investments.#{reason}",
count: investment.group.max_votable_headings,
- verify_account: link_to(t("votes.verify_account"), verification_path),
+ 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),
supported_headings: (current_user && current_user.headings_voted_within_group(investment.group).map(&:name).sort.to_sentence)
diff --git a/app/views/budgets/show.html.erb b/app/views/budgets/show.html.erb
index c6fc56529..a602b076a 100644
--- a/app/views/budgets/show.html.erb
+++ b/app/views/budgets/show.html.erb
@@ -24,7 +24,7 @@
<% else %>
<%= t("budgets.investments.index.sidebar.verified_only",
- verify: link_to(t("budgets.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
+ verify: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% end %>
<% else %>
diff --git a/app/views/comments/_comment_tree.html.erb b/app/views/comments/_comment_tree.html.erb
index 33824d743..a22f78396 100644
--- a/app/views/comments/_comment_tree.html.erb
+++ b/app/views/comments/_comment_tree.html.erb
@@ -24,7 +24,7 @@
<% elsif require_verified_resident_for_commentable?(commentable, current_user) %>
- <%= t("comments.verified_only", verify_account: link_to(t("comments.verify_account"), verification_path)).html_safe %>
+ <%= t("comments.verified_only", verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% elsif allow_comments %>
<%= render "comments/form", { commentable: commentable,
diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb
index dd7c6e1ea..b85c43549 100644
--- a/app/views/debates/_votes.html.erb
+++ b/app/views/debates/_votes.html.erb
@@ -53,7 +53,7 @@
<%= t("votes.anonymous",
- verify_account: link_to(t("votes.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/direct_messages/new.html.erb b/app/views/direct_messages/new.html.erb
index 6e403d48f..513d4ab6d 100644
--- a/app/views/direct_messages/new.html.erb
+++ b/app/views/direct_messages/new.html.erb
@@ -38,8 +38,7 @@
<%= t("users.direct_messages.new.verified_only",
- verify_account: link_to(t("users.direct_messages.new.verify_account"),
- verification_path)).html_safe %>
+ verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% end %>
diff --git a/app/views/legislation/proposals/_featured_votes.html.erb b/app/views/legislation/proposals/_featured_votes.html.erb
index df99dfd95..ce43a87e4 100644
--- a/app/views/legislation/proposals/_featured_votes.html.erb
+++ b/app/views/legislation/proposals/_featured_votes.html.erb
@@ -23,7 +23,7 @@
<%= t("votes.verified_only",
- verify_account: link_to(t("votes.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/legislation/proposals/_votes.html.erb b/app/views/legislation/proposals/_votes.html.erb
index 6ce1b28f0..c770b2eb9 100644
--- a/app/views/legislation/proposals/_votes.html.erb
+++ b/app/views/legislation/proposals/_votes.html.erb
@@ -55,7 +55,7 @@
<%= t("legislation.proposals.not_verified",
- verify_account: link_to(t("votes.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/legislation/questions/_participation_not_allowed.html.erb b/app/views/legislation/questions/_participation_not_allowed.html.erb
index 269f7f859..2c7d85782 100644
--- a/app/views/legislation/questions/_participation_not_allowed.html.erb
+++ b/app/views/legislation/questions/_participation_not_allowed.html.erb
@@ -8,7 +8,7 @@
<%= t("legislation.questions.participation.verified_only",
- verify_account: link_to(t("legislation.questions.participation.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/proposals/_featured_votes.html.erb b/app/views/proposals/_featured_votes.html.erb
index 81caf134a..3b9feb832 100644
--- a/app/views/proposals/_featured_votes.html.erb
+++ b/app/views/proposals/_featured_votes.html.erb
@@ -23,7 +23,7 @@
<%= t("votes.verified_only",
- verify_account: link_to(t("votes.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/proposals/_votes.html.erb b/app/views/proposals/_votes.html.erb
index 427215ba5..bc6d2bd4e 100644
--- a/app/views/proposals/_votes.html.erb
+++ b/app/views/proposals/_votes.html.erb
@@ -30,7 +30,7 @@
<%= t("votes.verified_only",
- verify_account: link_to(t("votes.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml
index fa275e71c..688335670 100644
--- a/config/locales/en/budgets.yml
+++ b/config/locales/en/budgets.yml
@@ -95,7 +95,6 @@ en:
check_ballot_link: "check and confirm my ballot"
zero: You have not voted any investment project in this group.
verified_only: "To create a new budget investment %{verify}."
- verify_account: "verify your account"
create: "Create a budget investment"
not_logged_in: "To create a new budget investment you must %{sign_in} or %{sign_up}."
by_feasibility: By feasibility
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index a3e6d3662..71059b15b 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -41,7 +41,6 @@ en:
comments:
comments_closed: Comments are closed
verified_only: To participate %{verify_account}
- verify_account: verify your account
comment:
admin: Administrator
author: Author
@@ -860,6 +859,7 @@ en:
login_to_continue: "You must %{signin} or %{signup} to continue."
signin: "sign in"
signup: "sign up"
+ verify_account: "verify your account"
direct_messages:
new:
body_label: Message
@@ -868,7 +868,6 @@ en:
title: Send private message to %{receiver}
title_label: Title
verified_only: To send a private message %{verify_account}
- verify_account: verify your account
show:
receiver: Message sent to %{receiver}
show:
@@ -918,7 +917,6 @@ en:
organizations: Organizations are not permitted to vote
supports: Supports
verified_only: Only verified users can vote on proposals; %{verify_account}.
- verify_account: verify your account
budget_investments:
not_logged_in: You must %{signin} or %{signup} to continue.
not_verified: Only verified users can vote on investment projects; %{verify_account}.
diff --git a/config/locales/en/legislation.yml b/config/locales/en/legislation.yml
index f365297de..d4186dedf 100644
--- a/config/locales/en/legislation.yml
+++ b/config/locales/en/legislation.yml
@@ -115,7 +115,6 @@ en:
organizations: Organisations are not permitted to participate in the debate
unauthenticated: You must %{signin} or %{signup} to participate.
verified_only: Only verified users can participate, %{verify_account}.
- verify_account: verify your account
debate_phase_not_open: Debate phase has finished and answers are not accepted anymore
shared:
share: Share
diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml
index 8b18b9c3e..f780b103e 100644
--- a/config/locales/es/budgets.yml
+++ b/config/locales/es/budgets.yml
@@ -95,7 +95,6 @@ es:
check_ballot_link: "revisar y confirmar mis votos"
zero: Todavía no has votado ningún proyecto de gasto en este ámbito del presupuesto.
verified_only: "Para crear un nuevo proyecto de gasto %{verify}."
- verify_account: "verifica tu cuenta"
create: "Crear proyecto de gasto"
not_logged_in: "Para crear un nuevo proyecto de gasto debes %{sign_in} o %{sign_up}."
by_feasibility: Por viabilidad
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index 3db1f24af..f4e4a84fb 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -41,7 +41,6 @@ es:
comments:
comments_closed: Los comentarios están cerrados
verified_only: Para participar %{verify_account}
- verify_account: verifica tu cuenta
comment:
admin: Administrador
author: Autor
@@ -857,6 +856,7 @@ es:
login_to_continue: "Necesitas %{signin} o %{signup} para continuar."
signin: "iniciar sesión"
signup: "registrarte"
+ verify_account: "verifica tu cuenta"
direct_messages:
new:
body_label: Mensaje
@@ -865,7 +865,6 @@ es:
title: Enviar mensaje privado a %{receiver}
title_label: Título
verified_only: Para enviar un mensaje privado %{verify_account}
- verify_account: verifica tu cuenta
show:
receiver: Mensaje enviado a %{receiver}
show:
@@ -915,7 +914,6 @@ es:
organizations: Las organizaciones no pueden votar.
supports: Apoyos
verified_only: Las propuestas sólo pueden ser votadas por usuarios verificados, %{verify_account}.
- verify_account: verifica tu cuenta
budget_investments:
not_logged_in: Necesitas %{signin} o %{signup} para continuar.
not_verified: Los proyectos de gasto sólo pueden ser apoyadas por usuarios verificados, %{verify_account}.
diff --git a/config/locales/es/legislation.yml b/config/locales/es/legislation.yml
index 134372a70..a825d9fe4 100644
--- a/config/locales/es/legislation.yml
+++ b/config/locales/es/legislation.yml
@@ -114,7 +114,6 @@ es:
organizations: Las organizaciones no pueden participar en el debate
unauthenticated: Necesitas %{signin} o %{signup} para participar en el debate.
verified_only: Solo los usuarios verificados pueden participar en el debate, %{verify_account}.
- verify_account: verifica tu cuenta
debate_phase_not_open: La fase de debate previo ya ha finalizado y en este momento no se aceptan respuestas
shared:
share: Compartir
From f5d8badeb6e20bb836802acae6be68be72eafe5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javi=20Mart=C3=ADn?=
Date: Tue, 1 Oct 2019 21:28:38 +0200
Subject: [PATCH 4/7] Extract partial to show "login to comment" message
---
app/views/comments/_comment_tree.html.erb | 6 +-----
app/views/comments/_commentable_tree.html.erb | 9 ++-------
app/views/debates/_comments.html.erb | 9 ++-------
app/views/legislation/annotations/_form.html.erb | 6 +-----
app/views/legislation/proposals/_comments.html.erb | 9 ++-------
app/views/polls/_comments.html.erb | 9 ++-------
app/views/proposals/_comments.html.erb | 9 ++-------
app/views/shared/_login_to_comment.html.erb | 6 ++++++
app/views/topics/_comments.html.erb | 8 +-------
9 files changed, 19 insertions(+), 52 deletions(-)
create mode 100644 app/views/shared/_login_to_comment.html.erb
diff --git a/app/views/comments/_comment_tree.html.erb b/app/views/comments/_comment_tree.html.erb
index a22f78396..0a4c4ddc7 100644
--- a/app/views/comments/_comment_tree.html.erb
+++ b/app/views/comments/_comment_tree.html.erb
@@ -34,11 +34,7 @@
<% end %>
<% else %>
-
- <%= 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 %>
-
+ <%= render "shared/login_to_comment" %>
<% end %>
<% comment_tree.root_comments.each do |comment| %>
diff --git a/app/views/comments/_commentable_tree.html.erb b/app/views/comments/_commentable_tree.html.erb
index ca45f0f80..8ec0fb268 100644
--- a/app/views/comments/_commentable_tree.html.erb
+++ b/app/views/comments/_commentable_tree.html.erb
@@ -17,13 +17,8 @@
toggeable: false,
valuation: valuation } %>
<% else %>
-
-
-
- <%= 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 %>
-
+
+ <%= render "shared/login_to_comment" %>
<% end %>
<% @comment_tree.root_comments.each do |comment| %>
diff --git a/app/views/debates/_comments.html.erb b/app/views/debates/_comments.html.erb
index 15f0d18d2..aec0a1414 100644
--- a/app/views/debates/_comments.html.erb
+++ b/app/views/debates/_comments.html.erb
@@ -11,13 +11,8 @@
<% if user_signed_in? %>
<%= render "comments/form", { commentable: @debate, parent_id: nil, toggeable: false } %>
<% else %>
-
-
-
- <%= 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 %>
-
+
+ <%= render "shared/login_to_comment" %>
<% end %>
<% @comment_tree.root_comments.each do |comment| %>
diff --git a/app/views/legislation/annotations/_form.html.erb b/app/views/legislation/annotations/_form.html.erb
index dd48038ba..c843141f2 100644
--- a/app/views/legislation/annotations/_form.html.erb
+++ b/app/views/legislation/annotations/_form.html.erb
@@ -23,11 +23,7 @@
<%= f.hidden_field :ranges %>
<% end %>
<% else %>
-
- <%= 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 %>
-
+ <%= render "shared/login_to_comment" %>
<% end %>
diff --git a/app/views/legislation/proposals/_comments.html.erb b/app/views/legislation/proposals/_comments.html.erb
index 6ff14f477..a3b0c635e 100644
--- a/app/views/legislation/proposals/_comments.html.erb
+++ b/app/views/legislation/proposals/_comments.html.erb
@@ -6,13 +6,8 @@
<% if user_signed_in? %>
<%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %>
<% else %>
-
-
-
- <%= 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 %>
-
+
+ <%= render "shared/login_to_comment" %>
<% end %>
<% @comment_tree.root_comments.each do |comment| %>
diff --git a/app/views/polls/_comments.html.erb b/app/views/polls/_comments.html.erb
index 017684b02..5ac2dfb64 100644
--- a/app/views/polls/_comments.html.erb
+++ b/app/views/polls/_comments.html.erb
@@ -6,13 +6,8 @@
<% if user_signed_in? %>
<%= render "comments/form", { commentable: @poll, parent_id: nil, toggeable: false } %>
<% else %>
-
-
-
- <%= 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 %>
-
+
+ <%= render "shared/login_to_comment" %>
<% end %>
<% @comment_tree.root_comments.each do |comment| %>
diff --git a/app/views/proposals/_comments.html.erb b/app/views/proposals/_comments.html.erb
index 6ff14f477..a3b0c635e 100644
--- a/app/views/proposals/_comments.html.erb
+++ b/app/views/proposals/_comments.html.erb
@@ -6,13 +6,8 @@
<% if user_signed_in? %>
<%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %>
<% else %>
-
-
-
- <%= 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 %>
-
+
+ <%= render "shared/login_to_comment" %>
<% end %>
<% @comment_tree.root_comments.each do |comment| %>
diff --git a/app/views/shared/_login_to_comment.html.erb b/app/views/shared/_login_to_comment.html.erb
new file mode 100644
index 000000000..aa21f6cdf
--- /dev/null
+++ b/app/views/shared/_login_to_comment.html.erb
@@ -0,0 +1,6 @@
+
+ <%= 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 %>
+
diff --git a/app/views/topics/_comments.html.erb b/app/views/topics/_comments.html.erb
index c1e29af2c..a5ca165fe 100644
--- a/app/views/topics/_comments.html.erb
+++ b/app/views/topics/_comments.html.erb
@@ -13,14 +13,8 @@
<% if user_signed_in? %>
<%= render "comments/form", { commentable: @topic, parent_id: nil, toggeable: false } %>
<% else %>
-
-
- <%= 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 %>
-
+ <%= render "shared/login_to_comment" %>
<% end %>
-
<% end %>
From 9289a051c32d79149c8e1495a794054b83acb8d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javi=20Mart=C3=ADn?=
Date: Tue, 1 Oct 2019 21:32:13 +0200
Subject: [PATCH 5/7] Extract partial to show "sign in to vote" message
---
app/views/debates/_votes.html.erb | 6 +-----
app/views/legislation/proposals/_featured_votes.html.erb | 6 +-----
app/views/legislation/proposals/_votes.html.erb | 6 +-----
app/views/proposals/_featured_votes.html.erb | 6 +-----
app/views/proposals/_votes.html.erb | 6 +-----
app/views/shared/_login_to_vote.html.erb | 6 ++++++
6 files changed, 11 insertions(+), 25 deletions(-)
create mode 100644 app/views/shared/_login_to_vote.html.erb
diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb
index b85c43549..68b195f3f 100644
--- a/app/views/debates/_votes.html.erb
+++ b/app/views/debates/_votes.html.erb
@@ -58,11 +58,7 @@
<% elsif !user_signed_in? %>
-
- <%= 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 %>
-
+ <%= render "shared/login_to_vote" %>
<% end %>
diff --git a/app/views/legislation/proposals/_featured_votes.html.erb b/app/views/legislation/proposals/_featured_votes.html.erb
index ce43a87e4..b4ea6a2eb 100644
--- a/app/views/legislation/proposals/_featured_votes.html.erb
+++ b/app/views/legislation/proposals/_featured_votes.html.erb
@@ -27,11 +27,7 @@
<% elsif !user_signed_in? %>
-
- <%= t("votes.unauthenticated",
- signin: link_to(t("users.signin"), new_user_session_path),
- signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
-
+ <%= render "shared/login_to_vote" %>
<% end %>
<% if voted_for?(@featured_proposals_votes, proposal) %>
diff --git a/app/views/legislation/proposals/_votes.html.erb b/app/views/legislation/proposals/_votes.html.erb
index c770b2eb9..6bd1bed3f 100644
--- a/app/views/legislation/proposals/_votes.html.erb
+++ b/app/views/legislation/proposals/_votes.html.erb
@@ -60,11 +60,7 @@
<% elsif !user_signed_in? %>
-
- <%= 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 %>
-
+ <%= render "shared/login_to_vote" %>
<% end %>
diff --git a/app/views/proposals/_featured_votes.html.erb b/app/views/proposals/_featured_votes.html.erb
index 3b9feb832..b4ea6a2eb 100644
--- a/app/views/proposals/_featured_votes.html.erb
+++ b/app/views/proposals/_featured_votes.html.erb
@@ -27,11 +27,7 @@
<% elsif !user_signed_in? %>
-
- <%= 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 %>
-
+ <%= render "shared/login_to_vote" %>
<% end %>
<% if voted_for?(@featured_proposals_votes, proposal) %>
diff --git a/app/views/proposals/_votes.html.erb b/app/views/proposals/_votes.html.erb
index bc6d2bd4e..fabf00bae 100644
--- a/app/views/proposals/_votes.html.erb
+++ b/app/views/proposals/_votes.html.erb
@@ -36,11 +36,7 @@
<% elsif !user_signed_in? %>
-
- <%= 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 %>
-
+ <%= render "shared/login_to_vote" %>
<% end %>
diff --git a/app/views/shared/_login_to_vote.html.erb b/app/views/shared/_login_to_vote.html.erb
new file mode 100644
index 000000000..8349eab3e
--- /dev/null
+++ b/app/views/shared/_login_to_vote.html.erb
@@ -0,0 +1,6 @@
+
+ <%= 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 %>
+
From f8bd3d4f39897be87cc4ca9f8f8de28af1d65395 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javi=20Mart=C3=ADn?=
Date: Tue, 1 Oct 2019 23:11:08 +0200
Subject: [PATCH 6/7] Extract links to signin and signup to methods
---
app/helpers/links_helper.rb | 8 ++++++++
app/views/budgets/index.html.erb | 4 +---
app/views/budgets/investments/_ballot.html.erb | 6 ++----
app/views/budgets/investments/_votes.html.erb | 4 ++--
app/views/budgets/show.html.erb | 3 +--
app/views/comments/_votes.html.erb | 4 ++--
app/views/direct_messages/new.html.erb | 3 +--
app/views/legislation/annotations/_comments_box.html.erb | 3 +--
app/views/legislation/processes/_help_gif.html.erb | 3 +--
.../questions/_participation_not_allowed.html.erb | 3 +--
app/views/polls/_callout.html.erb | 4 ++--
app/views/shared/_login_to_comment.html.erb | 5 +----
app/views/shared/_login_to_vote.html.erb | 5 +----
app/views/topics/_informative_text.html.erb | 3 +--
14 files changed, 25 insertions(+), 33 deletions(-)
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 %>
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 7/7] 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) %>
- <% verify_account = link_to(t("users.verify_account"), verification_path) %>
<% my_heading = link_to(investment.heading.name,
budget_investments_path(budget_id: investment.budget_id,
heading_id: investment.heading_id)) %>
@@ -53,7 +52,7 @@
<%= t("budgets.ballots.reasons_for_not_balloting.#{reason}",
- verify_account: verify_account, signin: link_to_signin,
+ verify_account: link_to_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/_sidebar.html.erb b/app/views/budgets/investments/_sidebar.html.erb
index 4f3c3ee60..63d577241 100644
--- a/app/views/budgets/investments/_sidebar.html.erb
+++ b/app/views/budgets/investments/_sidebar.html.erb
@@ -7,7 +7,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 %>
<% end %>
diff --git a/app/views/budgets/investments/_votes.html.erb b/app/views/budgets/investments/_votes.html.erb
index d3bb650f1..9fca61f6e 100644
--- a/app/views/budgets/investments/_votes.html.erb
+++ b/app/views/budgets/investments/_votes.html.erb
@@ -33,7 +33,7 @@
<%= t("votes.budget_investments.#{reason}",
count: investment.group.max_votable_headings,
- verify_account: link_to(t("users.verify_account"), verification_path),
+ verify_account: link_to_verify_account,
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)
diff --git a/app/views/budgets/show.html.erb b/app/views/budgets/show.html.erb
index 86cb7fadb..0d1bf5779 100644
--- a/app/views/budgets/show.html.erb
+++ b/app/views/budgets/show.html.erb
@@ -24,7 +24,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/comments/_comment_tree.html.erb b/app/views/comments/_comment_tree.html.erb
index 0a4c4ddc7..9e95cc748 100644
--- a/app/views/comments/_comment_tree.html.erb
+++ b/app/views/comments/_comment_tree.html.erb
@@ -24,7 +24,7 @@
<% elsif require_verified_resident_for_commentable?(commentable, current_user) %>
- <%= t("comments.verified_only", verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
+ <%= t("comments.verified_only", verify_account: link_to_verify_account).html_safe %>
<% elsif allow_comments %>
<%= render "comments/form", { commentable: commentable,
diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb
index 68b195f3f..cb7cdf9f5 100644
--- a/app/views/debates/_votes.html.erb
+++ b/app/views/debates/_votes.html.erb
@@ -52,8 +52,7 @@
<% elsif user_signed_in? && !debate.votable_by?(current_user) %>
- <%= t("votes.anonymous",
- verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
+ <%= t("votes.anonymous", verify_account: link_to_verify_account).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/direct_messages/new.html.erb b/app/views/direct_messages/new.html.erb
index cfd03a460..fef4d84dc 100644
--- a/app/views/direct_messages/new.html.erb
+++ b/app/views/direct_messages/new.html.erb
@@ -37,7 +37,7 @@
<%= t("users.direct_messages.new.verified_only",
- verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to_verify_account).html_safe %>
<% end %>
diff --git a/app/views/legislation/proposals/_featured_votes.html.erb b/app/views/legislation/proposals/_featured_votes.html.erb
index b4ea6a2eb..090a095ea 100644
--- a/app/views/legislation/proposals/_featured_votes.html.erb
+++ b/app/views/legislation/proposals/_featured_votes.html.erb
@@ -22,8 +22,7 @@
<% elsif user_signed_in? && !proposal.votable_by?(current_user) %>
- <%= t("votes.verified_only",
- verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
+ <%= t("votes.verified_only", verify_account: link_to_verify_account).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/legislation/proposals/_votes.html.erb b/app/views/legislation/proposals/_votes.html.erb
index 6bd1bed3f..a2e9bedad 100644
--- a/app/views/legislation/proposals/_votes.html.erb
+++ b/app/views/legislation/proposals/_votes.html.erb
@@ -55,7 +55,7 @@
<%= t("legislation.proposals.not_verified",
- verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to_verify_account).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/legislation/questions/_participation_not_allowed.html.erb b/app/views/legislation/questions/_participation_not_allowed.html.erb
index da08ab9c0..9057fde1a 100644
--- a/app/views/legislation/questions/_participation_not_allowed.html.erb
+++ b/app/views/legislation/questions/_participation_not_allowed.html.erb
@@ -8,7 +8,7 @@
<%= t("legislation.questions.participation.verified_only",
- verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
+ verify_account: link_to_verify_account).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/proposals/_featured_votes.html.erb b/app/views/proposals/_featured_votes.html.erb
index b4ea6a2eb..090a095ea 100644
--- a/app/views/proposals/_featured_votes.html.erb
+++ b/app/views/proposals/_featured_votes.html.erb
@@ -22,8 +22,7 @@
<% elsif user_signed_in? && !proposal.votable_by?(current_user) %>
- <%= t("votes.verified_only",
- verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
+ <%= t("votes.verified_only", verify_account: link_to_verify_account).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/proposals/_votes.html.erb b/app/views/proposals/_votes.html.erb
index fabf00bae..f1801d732 100644
--- a/app/views/proposals/_votes.html.erb
+++ b/app/views/proposals/_votes.html.erb
@@ -29,8 +29,7 @@
- <%= t("votes.verified_only",
- verify_account: link_to(t("users.verify_account"), verification_path)).html_safe %>
+ <%= t("votes.verified_only", verify_account: link_to_verify_account).html_safe %>