Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update texts #180

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
</tr>
</thead>
<tbody>
<% consultation.questions.each do |question| %>
<% consultation.questions.published.each do |question| %>
<tr>
<td><%= strip_tags(translated_attribute(question.title)).truncate(200, separator: /\s/) %></td>
<td>
<% if question.votes.where(author: current_user).any? %>
<% user_response = question.responses.joins(:votes).find_by(votes: { author: current_user }) %>
<% if user_response %>
<p title="<%= translated_attribute(user_response.title) %>"><%= t("booleans.true") %></p>
<p title="<%= translated_attribute(user_response.title) %>"><%= t("action_delegator.questions.question_answered", scope: "decidim") %></p>
<% else %>
<%= link_to t("action_delegator.questions.question_not_answered", scope: "decidim"), decidim_consultations.question_path(question), class: "text-primary" %>
<%= link_to t("action_delegator.questions.question_not_answered", scope: "decidim"), decidim_consultations.question_path(question), class: "text-primary" %>
<% end %>
<% else %>
<%= link_to t("action_delegator.questions.question_not_answered", scope: "decidim"), decidim_consultations.question_path(question), class: "text-primary" %>
Expand Down
3 changes: 2 additions & 1 deletion config/locales/ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ ca:
modal_table_header_answer: Has respost?
modal_table_header_question: Pregunta
modal_votes_title: Els teus vots a "%{title}"
question_not_answered: No, ves-hi
question_not_answered: Vot pendent
question_answered: Ja votat
sms_message: El teu codi de verificació és %{code}
user_delegations:
index:
Expand Down
3 changes: 2 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ en:
modal_table_header_answer: Did you answer?
modal_table_header_question: Question
modal_votes_title: Your votes in "%{title}"
question_not_answered: No, take me there
question_answered: Already voted
question_not_answered: Vote pending
sms_message: Your verification code is %{code}
user_delegations:
index:
Expand Down
3 changes: 2 additions & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ es:
modal_table_header_answer: Has respondido?
modal_table_header_question: Pregunta
modal_votes_title: Tus votos a "%{title}"
question_not_answered: No, ir a la pregunta
question_not_answered: Voto pendiente
question_answered: Ya votado
sms_message: Su código de verificación es %{code}
user_delegations:
index:
Expand Down
14 changes: 8 additions & 6 deletions spec/system/consultation_question_vote_callout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
let(:organization) { create :organization, available_locales: [:en] }
let!(:consultation) { create :consultation, :published, organization: organization }
let!(:question) { create :question, consultation: consultation }
let!(:question2) { create :question, :unpublished, consultation: consultation }
let!(:hihglighted_question) { create :question, consultation: consultation, decidim_scope_id: consultation.decidim_highlighted_scope_id }
let!(:response1) { create :response, question: question }
let!(:response2) { create :response, question: question }
Expand All @@ -25,26 +26,27 @@
within "#consultations-questions-summary-modal" do
expect(page).to have_content("Did you answer?")
expect(page).to have_content("Your votes in \"#{consultation.title["en"]}\"")
expect(page).to have_link("No, take me there", href: decidim_consultations.question_path(question))
expect(page).to have_link("No, take me there", href: decidim_consultations.question_path(hihglighted_question))
expect(page).to have_link("Vote pending", href: decidim_consultations.question_path(question))
expect(page).to have_link("Vote pending", href: decidim_consultations.question_path(hihglighted_question))
expect(page).not_to have_link(href: decidim_consultations.question_path(question2))
end
end

it "changes the callout" do
expect(page).to have_content("You have answered 0 from a total of 2 questions")
click_link("Review the summary of your vote here")
within "#consultations-questions-summary-modal" do
expect(page).not_to have_content("Yes")
click_link("No, take me there", href: decidim_consultations.question_path(question))
expect(page).not_to have_content("Already voted")
click_link("Vote pending", href: decidim_consultations.question_path(question))
end
click_link("Vote")
click_button response1.title["en"]
click_button "Confirm"
expect(page).to have_content("You have answered 1 from a total of 2 questions")
click_link("Review the summary of your vote here")
within "#consultations-questions-summary-modal" do
expect(page).to have_content("Yes")
expect(page).to have_link("No, take me there", href: decidim_consultations.question_path(hihglighted_question))
expect(page).to have_content("Already voted")
expect(page).to have_link("Vote pending", href: decidim_consultations.question_path(hihglighted_question))
end
end
end
Expand Down
Loading