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 @@ <% 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 @@
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) %> 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? %>
- + <%= 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? %> - + <%= 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? %>
- + <%= 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? %> - + <%= 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? %>
- + <%= 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 @@ + 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 @@
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 @@
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? %> <% elsif !@process.debate_phase.open? %>