minor fixes

pull/73/head
Pierre-Louis Guhur 4 years ago
parent 82f6833493
commit c525296011

@ -64,7 +64,7 @@
"to": "au", "to": "au",
"Grades": "Mentions", "Grades": "Mentions",
"Voters' list": "Listes des électeurs", "Voters' list": "Listes des électeurs",
"Graph": "Grahique", "Graph": "Graphique",
"Preference profile": "Profil de mérites", "Preference profile": "Profil de mérites",
"Results of the election:": "Résultats de l'élection" "Results of the election:": "Résultats de l'élection"
} }

@ -52,7 +52,7 @@ class Result extends Component {
resultsToState = response => { resultsToState = response => {
const candidates = response.map(c => ({ const candidates = response.map(c => ({
id: c.id, id: c.id,
label: c.name, name: c.name,
profile: c.profile, profile: c.profile,
grade: c.grade, grade: c.grade,
score: c.score score: c.score
@ -96,8 +96,6 @@ class Result extends Component {
}; };
componentDidMount() { componentDidMount() {
// FIXME we should better handling logs
// get details of the election // get details of the election
const electionSlug = this.props.match.params.slug; const electionSlug = this.props.match.params.slug;
if (electionSlug === "dev") { if (electionSlug === "dev") {
@ -196,11 +194,12 @@ class Result extends Component {
<h1>{t("Results of the election:")}</h1> <h1>{t("Results of the election:")}</h1>
<ol> <ol>
{candidates.map((candidate, i) => { {candidates.map((candidate, i) => {
console.log(candidate);
return ( return (
<li key={i} className="mt-2"> <li key={i} className="mt-2">
<span className="mt-2 ml-2">{candidate.name}</span> <span className="mt-2 ml-2">{candidate.name}</span>
<span className="badge badge-dark mr-2 mt-2 ml-2"> <span className="badge badge-dark mr-2 mt-2 ml-2">
{candidate.score}% {candidate.score.toFixed(3)}%
</span> </span>
<span <span
className="badge badge-light mr-2 mt-2" className="badge badge-light mr-2 mt-2"

Loading…
Cancel
Save