From 49796403f800a41e00dcf24eaacf474c1990640f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Verg=C3=A9s?= Date: Thu, 2 Nov 2023 11:51:28 +0100 Subject: [PATCH] fix modal title --- .../decidim_awesome/voting/voting_cards_proposal/show.erb | 2 +- .../voting/voting_cards_proposal/vote_block_for.erb | 2 +- config/locales/en.yml | 2 +- spec/system/voting_cards_spec.rb | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb b/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb index 775081370..a20af3cda 100644 --- a/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +++ b/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb @@ -11,7 +11,7 @@ voted_for?(0) ? t("decidim.decidim_awesome.voting.voting_cards.abstained") : proposal.manifest.label_for(0), proposal_vote_path(0), link_options(0).merge({ - title: t("decidim.decidim_awesome.voting.voting_cards.voting_for", type: proposal.manifest.label_for(0)), + title: t("decidim.decidim_awesome.voting.voting_cards.voting_for", proposal: translated_attribute(proposal.title), type: proposal.manifest.label_for(0)), class: "button expanded vote-action abstain-button small #{classes_for(0)}" }) %> <% end %> diff --git a/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/vote_block_for.erb b/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/vote_block_for.erb index 6f65b69d3..abdf51ebb 100644 --- a/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/vote_block_for.erb +++ b/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/vote_block_for.erb @@ -8,7 +8,7 @@ **link_options(weight) do %> <%= proposal.manifest.label_for(weight) %> <%= content_tag :svg, role: "img" do - content_tag(:title, t("decidim.decidim_awesome.voting.voting_cards.voting_for", type: proposal.manifest.label_for(weight))) + + content_tag(:title, t("decidim.decidim_awesome.voting.voting_cards.voting_for", proposal: translated_attribute(proposal.title), type: proposal.manifest.label_for(weight))) + content_tag(:use, "", "href" => svg_path(weight)) end %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 05b06705f..d707c61c7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -527,7 +527,7 @@ en: skip: Check here to skip this window in the future vote_button: Click to vote voted: Voted - voting_for: My vote is "%{type}" + voting_for: My vote is on "%{proposal}" is "%{type}" weights: a: A g: G diff --git a/spec/system/voting_cards_spec.rb b/spec/system/voting_cards_spec.rb index a05a37ffd..7a4473591 100644 --- a/spec/system/voting_cards_spec.rb +++ b/spec/system/voting_cards_spec.rb @@ -55,7 +55,7 @@ click_link "Abstain" within ".vote_proposal_modal" do - expect(page).to have_content('My vote is "Abstain"') + expect(page).to have_content("My vote on \"#{proposals_title}\" is \"Abstain\"") expect(page).to have_content("Please read the election rules carefully to understand how your vote will be used by #{organization.name}") click_button "Cancel" end @@ -64,7 +64,7 @@ click_link color end within ".vote_proposal_modal" do - expect(page).to have_content("My vote is \"#{color}\"") + expect(page).to have_content("My vote on \"#{proposals_title}\" is \"#{color}\"") click_button "Cancel" end end