feat(result): add number of vote #34

pull/73/head
Clement G 4 years ago
parent d80879f069
commit 3811bcb6e5

@ -1,7 +1,7 @@
{
"Homepage": " Homepage ",
"Source code": "Quellcode",
"Who are we": "Wer wir sind",
"Who are we?": "Wer wir sind?",
"BetterVote": " BetterVote",
"Voting platform": "Wahlplattform",
"Majority Judgment": " Mehrheitswahl ",
@ -51,5 +51,6 @@
"Your participation was recorded with success!": " Ihre Teilnahme wurde gespeichert!",
"Thanks for your participation.": " Vielen Dank für Ihre Teilnahme.",
"Support us !" : "Unterstützen Sie uns!",
"PayPal - The safer, easier way to pay online!" : "PayPal - Die sicherere und einfachere Art, online zu bezahlen!"
"PayPal - The safer, easier way to pay online!" : "PayPal - Die sicherere und einfachere Art, online zu bezahlen!",
"Number of votes:" : "Anzahl der Stimmen:"
}

@ -1,7 +1,7 @@
{
"Homepage": "Homepage",
"Source code": "Source code",
"Who are we": "Who are we",
"Who are we?": "Who are we?",
"BetterVote": "BetterVote",
"Voting platform": "Voting platform",
"Majority Judgment": "Majority Judgment",
@ -79,6 +79,6 @@
"You seem to have already voted.": "You seem to have already voted.",
"The parameters of the election are incorrect.": "The parameters of the election are incorrect.",
"Support us !" : "Support us !",
"PayPal - The safer, easier way to pay online!" : "PayPal - The safer, easier way to pay online!"
"PayPal - The safer, easier way to pay online!" : "PayPal - The safer, easier way to pay online!",
"Number of votes:" : "Number of votes:"
}

@ -1,7 +1,7 @@
{
"Homepage": "Página de inicio",
"Source code": "Código fuente",
"Who are we": "Quiénes somos",
"Who are we?": "¿Quiénes somos?",
"BetterVote": "VotarMejor",
"Voting platform": "Plataforma de votación",
"Majority Judgment": "Juicio Mayoritario",
@ -79,5 +79,6 @@
"You seem to have already voted.": "__STRING_NOT_TRANSLATED__",
"The parameters of the election are incorrect.": "__STRING_NOT_TRANSLATED__",
"Support us !" : "¡Apóyanos!",
"PayPal - The safer, easier way to pay online!" : "PayPal - ¡La forma más segura y fácil de pagar en línea!"
"PayPal - The safer, easier way to pay online!" : "PayPal - ¡La forma más segura y fácil de pagar en línea!",
"Number of votes:" : "Número de votos:"
}

@ -1,7 +1,7 @@
{
"Homepage": "Accueil",
"Source code": "Code source",
"Who are we": "Qui sommes-nous",
"Who are we?": "Qui sommes-nous ?",
"BetterVote": "MieuxVoter",
"Voting platform": "Plateforme de vote",
"Majority Judgment": "Jugement Majoritaire",
@ -79,5 +79,6 @@
"You seem to have already voted.": "Il semble que vous ayez déjà voté.",
"The parameters of the election are incorrect.": "Les paramètres de l'élection sont incorrects.",
"Support us !" : "Soutenez-nous !",
"PayPal - The safer, easier way to pay online!" : "PayPal - Le moyen le plus sûr et le plus simple de payer en ligne !"
"PayPal - The safer, easier way to pay online!" : "PayPal - Le moyen le plus sûr et le plus simple de payer en ligne !",
"Number of votes:" : "Nombre de votes :"
}

@ -22,7 +22,7 @@ class Footer extends Component {
<span className="m-2">-</span>
<a href="https://github.com/MieuxVoter" target="_blank" rel="noopener noreferrer" style={linkStyle}>{t("Source code")}</a>
<span className="m-2">-</span>
<a href="https://mieuxvoter.fr/" target="_blank" rel="noopener noreferrer" style={linkStyle} >{t("Who are we")}</a>
<a href="https://mieuxvoter.fr/" target="_blank" rel="noopener noreferrer" style={linkStyle} >{t("Who are we?")}</a>
<div className="mt-3">
<Paypal />
</div>

@ -35,6 +35,7 @@ class Result extends Component {
collapseProfiles: false,
electionGrades: i18nGrades(),
errorMessage: "",
numVotes:"..."
};
}
@ -60,7 +61,7 @@ class Result extends Component {
numVotes: c.num_votes
}));
console.log(response);
this.setState(state => ({ candidates: candidates }));
this.setState(state => ({ candidates: candidates, numVotes : candidates[0].numVotes }));
return response;
};
@ -196,6 +197,8 @@ class Result extends Component {
<Row className="mt-5">
<Col>
<h1>{t("Results of the election:")}</h1>
<h5><small>{t("Number of votes:")}{" "+this.state.numVotes}</small></h5>
<hr className="mb-5"/>
<ol>
{candidates.map((candidate, i) => {
console.log(candidate);

Loading…
Cancel
Save