Merge pull request #2616 from consul/show_votes_associated_to_signatures
Show count of votes associated to verified signatures
This commit is contained in:
@@ -21,6 +21,7 @@ class Admin::SignatureSheetsController < Admin::BaseController
|
||||
|
||||
def show
|
||||
@signature_sheet = SignatureSheet.find(params[:id])
|
||||
@voted_signatures = Vote.where(signature: @signature_sheet.signatures.verified).count
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
<%= t("admin.signature_sheets.show.verified",
|
||||
count: @signature_sheet.signatures.verified.count ) %>
|
||||
</strong>
|
||||
<br />
|
||||
<strong>
|
||||
<%= t("admin.signature_sheets.show.voted",
|
||||
count: @voted_signatures) %>
|
||||
</strong>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="unverified_signatures" class="callout alert">
|
||||
|
||||
@@ -1437,6 +1437,10 @@ en:
|
||||
one: "There is %{count} invalid signature"
|
||||
other: "There are %{count} invalid signatures"
|
||||
unverified_error: (Not verified by Census)
|
||||
voted:
|
||||
zero: "There is no votes created from the verified signatures."
|
||||
one: "There is %{count} vote created from the verified signatures."
|
||||
other: "There is %{count} votes created from verified signatures."
|
||||
loading: "There are still signatures that are being verified by the Census, please refresh the page in a few moments"
|
||||
stats:
|
||||
show:
|
||||
|
||||
@@ -1436,6 +1436,10 @@ es:
|
||||
one: "Hay %{count} firma inválida"
|
||||
other: "Hay %{count} firmas inválidas"
|
||||
unverified_error: (No verificadas por el Padrón)
|
||||
voted:
|
||||
zero: "No hay votos asociados con las firmas verificadas."
|
||||
one: "Hay %{count} voto asociado a las firmas verificadas."
|
||||
other: "Hay %{count} votos asociados a las firmas verificadas."
|
||||
loading: "Aún hay firmas que se están verificando por el Padrón, por favor refresca la página en unos instantes"
|
||||
stats:
|
||||
show:
|
||||
|
||||
@@ -39,10 +39,13 @@ describe "Signature sheets" do
|
||||
|
||||
select "Citizen proposal", from: "signature_sheet_signable_type"
|
||||
fill_in "signature_sheet_signable_id", with: proposal.id
|
||||
fill_in "signature_sheet_document_numbers", with: "12345678Z, 99999999Z"
|
||||
fill_in "signature_sheet_document_numbers", with: "12345678Z, 1234567L, 99999999Z"
|
||||
click_button "Create signature sheet"
|
||||
|
||||
expect(page).to have_content "Signature sheet created successfully"
|
||||
expect(page).to have_content "There is 1 valid signature"
|
||||
expect(page).to have_content "There is 1 vote created from the verified signatures"
|
||||
expect(page).to have_content "There are 2 invalid signatures"
|
||||
|
||||
visit proposal_path(proposal)
|
||||
|
||||
@@ -58,10 +61,13 @@ describe "Signature sheets" do
|
||||
|
||||
select "Investment", from: "signature_sheet_signable_type"
|
||||
fill_in "signature_sheet_signable_id", with: investment.id
|
||||
fill_in "signature_sheet_document_numbers", with: "12345678Z, 99999999Z"
|
||||
fill_in "signature_sheet_document_numbers", with: "12345678Z, 1234567L, 99999999Z"
|
||||
click_button "Create signature sheet"
|
||||
|
||||
expect(page).to have_content "Signature sheet created successfully"
|
||||
expect(page).to have_content "There is 1 valid signature"
|
||||
expect(page).to have_content "There is 1 vote created from the verified signatures"
|
||||
expect(page).to have_content "There are 2 invalid signatures"
|
||||
|
||||
visit budget_investment_path(budget, investment)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user