diff --git a/pledge-update/page_renderer.php b/pledge-update/page_renderer.php index 773a33a..f7ce2dc 100644 --- a/pledge-update/page_renderer.php +++ b/pledge-update/page_renderer.php @@ -1,7 +1,7 @@ renderPledgePage($councilData, $candidateData, $mediaData); +$councils = []; +foreach ($pledgeCandidates as $key => $candidate) { + $councils[] = $candidate['Council']; +} +$councils = array_unique($councils); +asort($councils); + +//print_r($councils); + +$pageContent = $renderer->renderPledgePage($councils, $pledgeCandidates); if ($pageContent === null) { exit(2); diff --git a/pledge-update/template.php b/pledge-update/template.php index a0cea5c..fe326a3 100644 --- a/pledge-update/template.php +++ b/pledge-update/template.php @@ -5,9 +5,6 @@ function sluggify($input) { } $surveyLink = "Streets People Love Pledge and Survey"; -if (isset($config["survey"])) { - $surveyLink = $config["survey"]; -} ?> @@ -27,12 +24,10 @@ if (isset($config["survey"])) { 1) { - $wardsDescription = $config['councilName'] . " is divided into " . $wardCount . " wards:"; - } else { - $wardsDescription = $config['councilName'] . " is unsubdivided and does not contain any wards."; + if ($councilCount > 1) { + $wardsDescription = "Candidates from " . $councilCount . " wards have taken the pledge:"; } ?> @@ -41,39 +36,33 @@ if (isset($config["survey"])) {
- - -