diff --git a/app/components/admin/action_component.html.erb b/app/components/admin/action_component.html.erb index 4fb3324e8..ad80e2f5d 100644 --- a/app/components/admin/action_component.html.erb +++ b/app/components/admin/action_component.html.erb @@ -1,5 +1,5 @@ <% if button? %> - <%= button_to(path, html_options) { text } %> + <%= button_to text, path, html_options %> <% else %> <%= link_to text, path, html_options %> <% end %> diff --git a/app/components/budgets/investments/ballot_component.html.erb b/app/components/budgets/investments/ballot_component.html.erb index 2f609e146..faceb03a1 100644 --- a/app/components/budgets/investments/ballot_component.html.erb +++ b/app/components/budgets/investments/ballot_component.html.erb @@ -10,15 +10,14 @@
<% end %> <% if investment.should_show_ballots? %> - <%= button_to budget_ballot_line_path(id: investment.id, + <%= button_to t("budgets.ballots.show.remove"), + budget_ballot_line_path(id: investment.id, budget_id: investment.budget_id, investments_ids: investment_ids), class: "button button-remove-support expanded", method: :delete, remote: true, - "aria-label": remove_vote_aria_label do %> - <%= t("budgets.ballots.show.remove") %> - <% end %> + "aria-label": remove_vote_aria_label %> <% end %> <% else %> @@ -29,16 +28,15 @@ <% end %> <% if investment.should_show_ballots? %> - <%= button_to budget_ballot_lines_path(investment_id: investment.id, + <%= button_to t("budgets.investments.investment.add"), + budget_ballot_lines_path(investment_id: investment.id, budget_id: investment.budget_id, investments_ids: investment_ids), class: "button button-support expanded", title: t("budgets.investments.investment.support_title"), method: :post, remote: true, - "aria-label": vote_aria_label do %> - <%= t("budgets.investments.investment.add") %> - <% end %> + "aria-label": vote_aria_label %> <% end %> <% end %> diff --git a/app/components/budgets/investments/votes_component.html.erb b/app/components/budgets/investments/votes_component.html.erb index 015e520c9..1d86737db 100644 --- a/app/components/budgets/investments/votes_component.html.erb +++ b/app/components/budgets/investments/votes_component.html.erb @@ -12,13 +12,12 @@ <%= t("budgets.investments.votes.already_supported") %> <% if feature?(:remove_investments_supports) %> - <%= button_to remove_support_path, + <%= button_to t("budgets.investments.votes.remove_support"), + remove_support_path, class: "button button-remove-support expanded", method: "delete", remote: true, - "aria-label": remove_support_aria_label do %> - <%= t("budgets.investments.votes.remove_support") %> - <% end %> + "aria-label": remove_support_aria_label %> <% end %> <% else %> diff --git a/app/components/polls/questions/answers_component.html.erb b/app/components/polls/questions/answers_component.html.erb index c73247ec2..c9fc65343 100644 --- a/app/components/polls/questions/answers_component.html.erb +++ b/app/components/polls/questions/answers_component.html.erb @@ -2,23 +2,21 @@ <% if can?(:answer, question) && !question.poll.voted_in_booth?(current_user) %> <% question_answers.each do |question_answer| %> <% if already_answered?(question_answer) %> - <%= button_to question_answer_path(question, user_answer(question_answer)), + <%= button_to question_answer.title, + question_answer_path(question, user_answer(question_answer)), method: :delete, remote: true, title: t("poll_questions.show.voted", answer: question_answer.title), class: "button answered", - "aria-pressed": true do %> - <%= question_answer.title %> - <% end %> + "aria-pressed": true %> <% else %> - <%= button_to answer_question_path(question, answer: question_answer.title), + <%= button_to question_answer.title, + answer_question_path(question, answer: question_answer.title), remote: true, title: t("poll_questions.show.vote_answer", answer: question_answer.title), class: "button secondary hollow", "aria-pressed": false, - disabled: disable_answer?(question_answer) do %> - <%= question_answer.title %> - <% end %> + disabled: disable_answer?(question_answer) %> <% end %> <% end %> <% elsif !user_signed_in? %> diff --git a/app/components/proposals/votes_component.html.erb b/app/components/proposals/votes_component.html.erb index c96200e00..612052103 100644 --- a/app/components/proposals/votes_component.html.erb +++ b/app/components/proposals/votes_component.html.erb @@ -7,14 +7,13 @@ <%= t("proposals.proposal.already_supported") %> <% else %> - <%= button_to vote_url, + <%= button_to t("proposals.proposal.support"), + vote_url, class: "button button-support small expanded", title: t("proposals.proposal.support_title"), method: "post", remote: true, - "aria-label": support_aria_label do %> - <%= t("proposals.proposal.support") %> - <% end %> + "aria-label": support_aria_label %> <% end %> diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb index b13ef5ed1..39df8d8fd 100644 --- a/config/initializers/new_framework_defaults_7_0.rb +++ b/config/initializers/new_framework_defaults_7_0.rb @@ -11,7 +11,7 @@ # `button_to` view helper will render `