From cd6cf3bda11f3615853a1ffcd0c9e2d47d2cce13 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 13 Oct 2017 12:41:33 +0200 Subject: [PATCH] uses default rails helper to disable submit button --- app/views/officing/voters/_can_vote.html.erb | 4 +++- config/locales/en/officing.yml | 2 ++ config/locales/es/officing.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/officing/voters/_can_vote.html.erb b/app/views/officing/voters/_can_vote.html.erb index b953946ce..b5c9663ac 100644 --- a/app/views/officing/voters/_can_vote.html.erb +++ b/app/views/officing/voters/_can_vote.html.erb @@ -10,7 +10,9 @@ html: { id: "new_officing_voter" } do |f| %> <%= f.hidden_field :poll_id, value: poll.id %> <%= f.hidden_field :user_id, value: @user.id %> - <%= f.submit t("officing.voters.show.submit"), class: "button success expanded" %> + <%= f.submit t("officing.voters.show.submit"), + class: "button success expanded", + data: { disable_with: t("officing.voters.can_vote.submit_disable_with") } %> <% end %> diff --git a/config/locales/en/officing.yml b/config/locales/en/officing.yml index 378b87b15..e51e03510 100644 --- a/config/locales/en/officing.yml +++ b/config/locales/en/officing.yml @@ -64,3 +64,5 @@ en: error_already_voted: Has already participated in this poll submit: Confirm vote success: "Vote introduced!" + can_vote: + submit_disable_with: "WAIT, confirming vote" diff --git a/config/locales/es/officing.yml b/config/locales/es/officing.yml index 354b59710..c23b42568 100644 --- a/config/locales/es/officing.yml +++ b/config/locales/es/officing.yml @@ -64,3 +64,5 @@ es: error_already_voted: "Ya ha participado en esta votación." submit: Confirmar voto success: "¡Voto introducido!" + can_vote: + submit_disable_with: "ESPERA, confirmando voto" \ No newline at end of file