Compare commits
17 Commits
council_20
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 35812791f5 | |||
| 72c7413195 | |||
|
|
2cf3d0bd26 | ||
|
|
babf8f81b6 | ||
|
|
1e3e4a99e6 | ||
|
|
60a33194e1 | ||
|
|
d8684760e5 | ||
|
|
1735d52781 | ||
|
|
675058201a | ||
|
|
05b0898979 | ||
|
|
c172222e15 | ||
|
|
5e3d22de3e | ||
|
|
9b9c1a6869 | ||
|
|
f5f04d01eb | ||
|
|
0bddcb7520 | ||
|
|
608ed0f92c | ||
|
|
2a0ba8eed2 |
@@ -42,21 +42,23 @@ match_lga($candidate_data, $lga_list);
|
||||
foreach ($candidate_data as $key => $candidate) {
|
||||
$score = 0;
|
||||
|
||||
if ($candidate['Pledge'] === "y") $score++;
|
||||
if ($candidate['q0'] === "Yes") $score++;
|
||||
if ($candidate['q1'] === "Yes") $score++;
|
||||
if ($candidate['q2'] === "Yes") $score++;
|
||||
if ($candidate['q3'] === "Yes") $score++;
|
||||
if ($candidate['q4'] === "Yes") $score++;
|
||||
if ($candidate['q7'] === "Yes") $score++;
|
||||
|
||||
$candidate_data[$key]['Score'] = $score;
|
||||
|
||||
$candidate_data[$key]['Pledge'] = $candidate['q4'];
|
||||
}
|
||||
|
||||
$header = ["Ward", "Candidate Name", "Rating", "Pledge", "Picture"];
|
||||
$header = ["Candidate Name", "Rating", "Pledge", "Picture"];
|
||||
|
||||
/* Generate candidates-generic.csv */
|
||||
foreach ($lga_list as $lga) {
|
||||
$lga_candidates = array_filter($candidate_data, function ($candidate) use ($lga) {
|
||||
return $candidate['match_lga'] === $lga['slug'];
|
||||
return $candidate['match_division'] === $lga['slug'];
|
||||
});
|
||||
|
||||
if (count($lga_candidates) === 0) continue;
|
||||
@@ -91,7 +93,6 @@ foreach ($lga_list as $lga) {
|
||||
}
|
||||
|
||||
$lines[] = [
|
||||
$candidate['match_ward'],
|
||||
$candidate['Name'],
|
||||
$candidate['Score'],
|
||||
$candidate['Pledge'],
|
||||
|
||||
@@ -42,7 +42,7 @@ $image_map = [];
|
||||
foreach ($candidate_data as $candidate) {
|
||||
if (strlen($candidate['photo_url'])) {
|
||||
$map['url'] = $candidate['photo_url'];
|
||||
$map['match_lga'] = $candidate['match_lga'];
|
||||
$map['match_division'] = $candidate['match_division'];
|
||||
$image_map[$candidate['Photo']] = $map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,19 +10,11 @@ function parse_generic_csv($generic_csv) {
|
||||
$is_question = false;
|
||||
foreach ($headers as $key => $value) {
|
||||
/* Override key name for questions */
|
||||
if ($value === "Verified") {
|
||||
$is_question = false;
|
||||
}
|
||||
|
||||
if (strstr($value, "candidate photo")) $value = "Photo";
|
||||
if (strstr($value, "In which Local Government Area")) $value = "LGA";
|
||||
if (strstr($value, "In which Ward")) $value = "Ward";
|
||||
if (strstr($value, "In which federal Division are")) continue;
|
||||
if (strstr($value, "In which Federal Division are")) $value = "Division";
|
||||
if (strstr($value, "Political Party")) $value = "Party";
|
||||
|
||||
if ($value === "Pledge") {
|
||||
if (strstr($data[$key], "I pledge")) $data[$key] = "y";
|
||||
else $data[$key] = "n";
|
||||
}
|
||||
if (strstr($value, "Protected bike lanes provide")) continue;
|
||||
|
||||
if ($value === "Photo") {
|
||||
$candidate['photo_url'] = $data[$key];
|
||||
@@ -35,7 +27,7 @@ function parse_generic_csv($generic_csv) {
|
||||
$candidate[$value] = $data[$key];
|
||||
}
|
||||
|
||||
if ($value === "Pledge") {
|
||||
if ($value === "Party") {
|
||||
$is_question = true;
|
||||
}
|
||||
}
|
||||
@@ -54,8 +46,9 @@ function match_lga(&$candidate_data, $lga_list) {
|
||||
foreach ($candidate_data as &$candidate) {
|
||||
/* Match user typed LGA/Ward to our database */
|
||||
$max_score = 0;
|
||||
$match_lga = null;
|
||||
foreach ($lga_list as $lga) {
|
||||
$aa = preg_split("/[^a-z]/", strtolower($candidate['LGA']));
|
||||
$aa = preg_split("/[^a-z]/", strtolower($candidate['Division']));
|
||||
$bb = preg_split("/[^a-z]/", $lga['slug']);
|
||||
|
||||
$score_sum = 0;
|
||||
@@ -73,6 +66,7 @@ function match_lga(&$candidate_data, $lga_list) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$max_score = 0;
|
||||
foreach ($match_lga['wardNames'] as $ward) {
|
||||
similar_text(strtolower($ward), strtolower($candidate['Ward']), $score);
|
||||
@@ -81,9 +75,14 @@ function match_lga(&$candidate_data, $lga_list) {
|
||||
$match_ward = $ward;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$candidate['match_lga'] = $match_lga['slug'];
|
||||
$candidate['match_ward'] = $match_ward;
|
||||
if ($match_lga === null) {
|
||||
$candidate['match_division'] = "no_match";
|
||||
} else {
|
||||
$candidate['match_division'] = $match_lga['slug'];
|
||||
}
|
||||
//$candidate['match_ward'] = $match_ward;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
GENERIC_SURVEY=../generic-survey/responses.csv
|
||||
IMAGES=../generic-survey/images
|
||||
|
||||
DATA_PATH="../spl-data"
|
||||
DATA_PATH="../spl-data/federal_2025"
|
||||
|
||||
echo "Fetching latest responses to generic survey."
|
||||
rm -f $GENERIC_SURVEY # Force re-fetch
|
||||
rclone -v copyto --drive-export-formats csv 'bikewest:spl_generic_survey_2024/Streets People Love council election candidate pledge and survey (Responses).csv' $GENERIC_SURVEY
|
||||
rclone -v copyto --drive-export-formats csv 'bikewest:spl_generic_survey_federal_2025/Streets People Love Federal Election candidate pledge (Responses).csv' $GENERIC_SURVEY
|
||||
|
||||
config_files=()
|
||||
for folder in "$DATA_PATH"/*; do
|
||||
@@ -47,7 +47,12 @@ for key in $(jq -r 'keys[]' <<< $image_map) ; do
|
||||
;;
|
||||
esac
|
||||
|
||||
lga=$(jq -r ".[\"$key\"][\"match_lga\"]" <<< $image_map)
|
||||
lga=$(jq -r ".[\"$key\"][\"match_division\"]" <<< $image_map)
|
||||
|
||||
if [ ! -d $"$DATA_PATH/$lga" ] ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
dst="$DATA_PATH/$lga/$key$suffix"
|
||||
|
||||
if [ -f $dst ] ; then
|
||||
@@ -55,7 +60,11 @@ for key in $(jq -r 'keys[]' <<< $image_map) ; do
|
||||
fi
|
||||
|
||||
echo "Resizing $dst"
|
||||
convert $IMAGES/$key -resize 400x400 $dst
|
||||
if command -v magick >/dev/null 2>&1; then
|
||||
magick $IMAGES/$key -resize 400x400 $dst
|
||||
else
|
||||
convert $IMAGES/$key -resize 400x400 $dst
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Generating candidates-generic.csv files."
|
||||
|
||||
@@ -21,6 +21,13 @@ foreach ($candidates_files as $file) {
|
||||
$lgas_with_data[] = basename(dirname($file));
|
||||
}
|
||||
|
||||
print('<!-- wp:paragraph -->' . "\n");
|
||||
print('<p>The Streets People Love campaign has created scorecards for candidates in the 2025 federal election. Scorecards have been generated based on a candidate\'s engagement with the Streets People Love campaign, their commitment to our pledge, their responses to a survey and input from campaign members located in the division in which they are running.</p>' . "\n");
|
||||
print('<!-- /wp:paragraph -->' . "\n");
|
||||
print('<!-- wp:paragraph -->' . "\n");
|
||||
print('<p>Can\'t see a candidate you know is running? Candidates who don\'t take our survey won\'t appear on this page. Feel free to send your local candidates the <a href="https://forms.gle/CeGbJF11SUkATjfN8">Streets People Love Pledge and Survey</a> and let them know it\'s important to local residents that they do take part, so that we can vote for those who want to build the streets people love.</p>' . "\n");
|
||||
print('<!-- /wp:paragraph -->' . "\n");
|
||||
|
||||
print('<!-- wp:list --> <ul class="wp-block-list">' . "\n");
|
||||
|
||||
foreach ($lga_files as $config_file) {
|
||||
@@ -41,7 +48,7 @@ foreach ($lga_files as $config_file) {
|
||||
print('<!-- wp:list-item {"style":{"typography":{"fontStyle":"normal","fontWeight":"');
|
||||
print($font_weight . '"}}} -->' . "\n");
|
||||
print('<li style="font-style:normal;font-weight:' . $font_weight . '">');
|
||||
print('<a href="' . $config['slug'] . '">' . $config['councilName'] . "</a></li>\n");
|
||||
print('<a href="' . $config['slug'] . '">' . $config['divisionName'] . "</a></li>\n");
|
||||
print('<!-- /wp:list-item -->' . "\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
# The folder containing data for each council.
|
||||
# Includes the list of candidates and any media.
|
||||
DATA_PATH="../spl-data"
|
||||
DATA_PATH="../spl-data/federal_2025"
|
||||
|
||||
# Controls the flags that are passed to every usage of the wp command.
|
||||
#WP_FLAGS="--allow-root --path=/var/www/html"
|
||||
@@ -23,7 +23,7 @@ function create_or_update_page() {
|
||||
media_inputs+=("$file")
|
||||
fi
|
||||
done
|
||||
for file in "$DATA_PATH"/*.{jpeg,jpg,png,gif}.json; do
|
||||
for file in "$DATA_PATH"/../*.{jpeg,jpg,png,gif}.json; do
|
||||
if test -f "$file"; then
|
||||
media_inputs+=("$file")
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
# The folder containing data for each council.
|
||||
# Includes the list of candidates and any media.
|
||||
DATA_PATH="../spl-data"
|
||||
DATA_PATH="../spl-data/federal_2025"
|
||||
|
||||
# Iterate over folders in data path
|
||||
candidates_files=()
|
||||
@@ -22,4 +22,4 @@ done
|
||||
content=$(php lga-page.php --candidates-files "${candidates_files[*]}" \
|
||||
--lga-files "${lga_files[*]}")
|
||||
|
||||
echo "$content" | wp post update 465 -
|
||||
echo "$content" | wp post update 245813 -
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
# The folder containing data for each council.
|
||||
# Includes the list of candidates and any media.
|
||||
DATA_PATH="../spl-data"
|
||||
DATA_PATH="../spl-data/federal_2025"
|
||||
DEFAULT_IMAGE="../spl-data/default.png.json"
|
||||
|
||||
# Iterate over folders in data path
|
||||
@@ -22,4 +22,4 @@ done
|
||||
content=$(php pledge-update/pledge-page.php --candidates-files "${candidates_files[*]}" \
|
||||
--default-image $DEFAULT_IMAGE)
|
||||
|
||||
echo "$content" | wp post update 12106 -
|
||||
echo "$content" | wp post update 245816 -
|
||||
|
||||
2
map-generator/dist/main.js
vendored
2
map-generator/dist/main.js
vendored
File diff suppressed because one or more lines are too long
11
map-generator/shptojson/Makefile
Normal file
11
map-generator/shptojson/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
SHPFILE := ../../../spl-data/federal_2025/aec_data/E_VIC24_region.shp
|
||||
SHAPELIB := ../../../lib/shapelib-1.6.0
|
||||
|
||||
../federal_2025_boundaries.json: $(SHPFILE) shptojson
|
||||
LD_LIBRARY_PATH=$(SHAPELIB)/.libs ./shptojson $(SHPFILE) > $@
|
||||
|
||||
CFLAGS := -I $(SHAPELIB)
|
||||
LDFLAGS := -L $(SHAPELIB)/.libs
|
||||
|
||||
shptojson: shptojson.c
|
||||
gcc -Wall $(CFLAGS) $(LDFLAGS) -lshp $< -o $@
|
||||
142
map-generator/shptojson/shptojson.c
Normal file
142
map-generator/shptojson/shptojson.c
Normal file
@@ -0,0 +1,142 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Project: Shapelib
|
||||
* Purpose: Sample application for dumping contents of a shapefile to
|
||||
* the terminal in human readable form.
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 1999, Frank Warmerdam
|
||||
*
|
||||
* SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
|
||||
******************************************************************************
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "shapefil.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int nPrecision = 15;
|
||||
int first;
|
||||
const char *divison_name;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Display a usage message. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
if (argc != 2)
|
||||
{
|
||||
printf("Usage: shptojson shp_file\n");
|
||||
exit(1);
|
||||
}
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Open the passed shapefile. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
SHPHandle hSHP = SHPOpen(argv[1], "rb");
|
||||
DBFHandle hDBF = DBFOpen(argv[1], "rb");
|
||||
if (hSHP == NULL || hDBF == NULL)
|
||||
{
|
||||
printf("Unable to open:%s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Print out the file bounds. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
int nEntities;
|
||||
int nShapeType;
|
||||
double adfMinBound[4];
|
||||
double adfMaxBound[4];
|
||||
SHPGetInfo(hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound);
|
||||
|
||||
fprintf(stderr, "Shapefile Type: %s # of Shapes: %d\n\n",
|
||||
SHPTypeName(nShapeType), nEntities);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Skim over the list of shapes, printing all the vertices. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
printf("[\n");
|
||||
for (int i = 0; i < nEntities; i++)
|
||||
{
|
||||
SHPObject *psShape = SHPReadObject(hSHP, i);
|
||||
|
||||
if (psShape == NULL)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Unable to read shape %d, terminating object reading.\n",
|
||||
i);
|
||||
break;
|
||||
}
|
||||
|
||||
divison_name = DBFReadStringAttribute(hDBF, i, 1);
|
||||
fprintf(stderr, "shape %s has %i parts\n", divison_name, psShape->nParts);
|
||||
|
||||
printf(" {\n");
|
||||
printf(" \"electorateId\": \"%08i\",\n", i);
|
||||
printf(" \"electorateName\": \"%s\",\n", divison_name);
|
||||
printf(" \"electorateType\": \"Division\",\n");
|
||||
printf(" \"parentElectorateName\": \"%s\",\n", divison_name);
|
||||
printf(" \"boundaryJson\": \"{\\\"type\\\": ");
|
||||
|
||||
if (psShape->nParts != 1)
|
||||
{
|
||||
printf("\\\"MultiPolygon\\\",\\\"coordinates\\\":[[[");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\\\"Polygon\\\",\\\"coordinates\\\":[[");
|
||||
}
|
||||
|
||||
first = 1;
|
||||
for (int j = 0, iPart = 1; j < psShape->nVertices; j++)
|
||||
{
|
||||
if (iPart < psShape->nParts && psShape->panPartStart[iPart] == j)
|
||||
{
|
||||
iPart++;
|
||||
printf("]],[[");
|
||||
}
|
||||
else if (!first)
|
||||
{
|
||||
printf(",");
|
||||
}
|
||||
first = 0;
|
||||
printf("[%.*g,%.*g]", nPrecision, psShape->padfX[j],
|
||||
nPrecision, psShape->padfY[j]);
|
||||
}
|
||||
|
||||
if (i == (nEntities-1))
|
||||
{
|
||||
if (psShape->nParts != 1)
|
||||
{
|
||||
printf("]]]}\"\n }\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("]]}\"\n }\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (psShape->nParts != 1)
|
||||
{
|
||||
printf("]]]}\"\n },\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("]]}\"\n },\n");
|
||||
}
|
||||
}
|
||||
|
||||
SHPDestroyObject(psShape);
|
||||
}
|
||||
printf("]\n");
|
||||
|
||||
SHPClose(hSHP);
|
||||
DBFClose(hDBF);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -32,7 +32,7 @@ map.on('load', () => {
|
||||
|
||||
map.addImage('blue-circle', image);
|
||||
|
||||
fetch("wards_withboundaries.json")
|
||||
fetch("federal_2025_boundaries.json")
|
||||
.then(response => {
|
||||
response.json()
|
||||
.then((wardData) => {
|
||||
@@ -117,7 +117,7 @@ map.on('load', () => {
|
||||
//
|
||||
// The 2024 set of boundaries only uses 2 MultiPolygon objects (Cathedral in Murrindindi Shire Council and Island in Bass Coast Shire Council)
|
||||
// Luckily, the second polygon for both objects results in a good label placement.
|
||||
centrePoint = polylabel(featureCollection.features[0].geometry.coordinates[1], 0.000001);
|
||||
centrePoint = polylabel(featureCollection.features[0].geometry.coordinates[0], 0.000001);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ function sluggify($input) {
|
||||
return strtolower(str_replace(' ', '-', $input));
|
||||
}
|
||||
|
||||
$surveyLink = "<a href=\"https://forms.gle/gnDNyBiVC64tDo2Y7\">Streets People Love Pledge and Survey</a>";
|
||||
$surveyLink = "<a href=\"https://forms.gle/CeGbJF11SUkATjfN8\">Streets People Love Pledge and Survey</a>";
|
||||
if (isset($config["survey"])) {
|
||||
$surveyLink = $config["survey"];
|
||||
}
|
||||
@@ -18,7 +18,7 @@ if (isset($config["survey"])) {
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<p>The Streets People Love campaign has created scorecards for candidates in the 2024 council elections. Scorecards have been generated based on a candidate's engagement with the Streets People Love campaign, their commitment to our pledge, their responses to a survey and input from campaign members located in the local government area in which they are running.</p>
|
||||
<p>The Streets People Love campaign has created scorecards for candidates in the 2025 federal election. Scorecards have been generated based on a candidate's engagement with the Streets People Love campaign, their commitment to our pledge, their responses to a survey and input from campaign members located in the division in which they are running.</p>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
@@ -35,20 +35,16 @@ if (isset($config["survey"])) {
|
||||
|
||||
<?php
|
||||
|
||||
$wardCount = count($config['wardNames']);
|
||||
$wardCount = 1; //count($config['wardNames']);
|
||||
|
||||
if ($wardCount > 1) {
|
||||
$wardsDescription = $config['councilName'] . " is divided into " . $wardCount . " wards:";
|
||||
$wardsDescription = $config['divisionName'] . " is divided into " . $wardCount . " wards:";
|
||||
} else {
|
||||
$wardsDescription = $config['councilName'] . " is unsubdivided and does not contain any wards.";
|
||||
$wardsDescription = $config['divisionName'] . " is unsubdivided and does not contain any wards.";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<p><?php echo $wardsDescription; ?></p>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<?php if (isset($media["map.jpg"])): ?>
|
||||
<!-- wp:image {"id":<?php echo $media["map.jpg"]['id']; ?>,"width":"550px","sizeSlug":"full","linkDestination":"media","className":"is-style-default"} -->
|
||||
<figure class="wp-block-image size-full is-resized is-style-default"><a href="<?php echo $media["map.jpg"]['url']; ?>" target="_blank" rel="noreferrer noopener"><img src="<?php echo $media["map.jpg"]['url']; ?>" alt="" class="wp-image-<?php echo $media["map.jpg"]['id']; ?>" style="width:550px"/></a></figure>
|
||||
@@ -106,37 +102,32 @@ if (isset($config["survey"])) {
|
||||
$groupNames = $config['groupNames'];
|
||||
$propertyOnCandidate = 'Group';
|
||||
} else {
|
||||
$groupNames = $config['wardNames'];
|
||||
$groupNames = ['N/A']; // $config['wardNames'];
|
||||
$propertyOnCandidate = 'Ward';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php foreach ($groupNames as $index => $groupName): ?>
|
||||
<!-- wp:heading {"level":3,"className":"is-style-default"} -->
|
||||
<?php $groupSlug = sluggify($groupName); ?>
|
||||
<h3 class="wp-block-heading is-style-default" id="<?php echo $groupSlug; ?>"><a style="text-decoration: none;" href="#<?php echo $groupSlug; ?>"><?php echo htmlspecialchars($groupName); ?></a></h3>
|
||||
<!-- /wp:heading -->
|
||||
|
||||
<?php
|
||||
$groupCandidates = array_filter($candidates, function ($candidate) use ($groupName, $propertyOnCandidate) {
|
||||
return isset($candidate[$propertyOnCandidate]) &&
|
||||
strtolower($candidate[$propertyOnCandidate]) === strtolower($groupName);
|
||||
});
|
||||
|
||||
usort($groupCandidates, function($a, $b) {
|
||||
usort($candidates, function($a, $b) {
|
||||
if ($a == $b) {
|
||||
return 0;
|
||||
}
|
||||
return (((int) $a['Rating']) < ((int) $b['Rating'])) ? 1 : -1;
|
||||
});
|
||||
|
||||
if (count($groupCandidates) > 0):
|
||||
if (count($candidates) > 0):
|
||||
?>
|
||||
|
||||
<?php
|
||||
$columnCount = 4;
|
||||
|
||||
$chunkedWardCandidates = array_chunk($groupCandidates, $columnCount);
|
||||
$chunkedWardCandidates = array_chunk($candidates, $columnCount);
|
||||
?>
|
||||
|
||||
<?php foreach($chunkedWardCandidates as $chunk): ?>
|
||||
@@ -203,7 +194,7 @@ if (isset($config["survey"])) {
|
||||
<?php else: ?>
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<p>No candidates in this ward have completed the survey. Send your local candidates the <?php echo $surveyLink; ?> and ask them to take part so that local residents can vote for the candidates who want to build the streets people love.</p>
|
||||
<p>No candidates in this division have completed the survey. Send your local candidates the <?php echo $surveyLink; ?> and ask them to take part so that local residents can vote for the candidates who want to build the streets people love.</p>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -15,11 +15,11 @@ $candidate_data = parse_pledge_data(explode(" ", $candidates_files), null);
|
||||
|
||||
/* Select people who have taken the pledge (and have an image) */
|
||||
$pledgeCandidates = array_filter($candidate_data, function ($candidate) {
|
||||
return $candidate['Pledge'] === 'y' && $candidate['Picture'] !== "";
|
||||
return $candidate['Pledge'] === 'Yes' && $candidate['Picture'] !== "";
|
||||
});
|
||||
|
||||
/* Select 9 random candidates */
|
||||
$pledgeKeys = array_rand($pledgeCandidates, 9);
|
||||
$pledgeKeys = array_rand($pledgeCandidates, min(count($pledgeCandidates), 9));
|
||||
shuffle($pledgeKeys);
|
||||
|
||||
$i = 0;
|
||||
|
||||
@@ -61,7 +61,7 @@ function parse_pledge_data($candidates_files, $default_image) {
|
||||
if (!empty($elected_data) && array_key_exists($name_slug, $elected_data)) {
|
||||
$candidate['Elected'] = $elected_data[$name_slug]['Elected'];
|
||||
}
|
||||
$candidate['Council'] = $config['councilName'];
|
||||
$candidate['Council'] = $config['divisionName'];
|
||||
$candidate['Path'] = dirname($file);
|
||||
$media_desc = $candidate['Path']."/".
|
||||
$candidate['Picture'].".json";
|
||||
|
||||
@@ -32,7 +32,7 @@ $candidate_data = parse_pledge_data(explode(" ", $candidates_files), $default_im
|
||||
|
||||
/* Select people who have taken the pledge */
|
||||
$pledgeCandidates = array_filter($candidate_data, function ($candidate) {
|
||||
return $candidate['Pledge'] === 'y';
|
||||
return $candidate['Pledge'] === 'Yes';
|
||||
});
|
||||
|
||||
$renderer = new SPLPageRenderer();
|
||||
|
||||
@@ -5,15 +5,15 @@ function sluggify($input) {
|
||||
?>
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<p>The Streets People Love campaign offers council candidates the opportunity to take the following pledge:</p>
|
||||
<p>The Streets People Love campaign offers federal candidates the opportunity to take the following pledge:</p>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:paragraph {"style":{"color":{"background":"#10B5B0"}}} -->
|
||||
<p class="has-background" style="background-color:#10B5B0">If elected Councillor, I pledge to allocate budget and street space to build streets people love, and ensure that residents of all ages and abilities can safely move around our council area, irrespective of whether they choose to walk, cycle, wheel, use public transport or drive.</p>
|
||||
<p class="has-background" style="background-color:#10B5B0">If elected, I pledge to vote for a national Active Transport Infrastructure Program that invests $400 million annually, equivalent to $15 per person, for the duration of the <a href="https://www.betterstreets.org.au/2025-federal-election">United Nations Decade of Sustainable Transport</a>, from 2026 to 2035.</p>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<p>Candidates from these councils have taken the pledge:</p>
|
||||
<p>Candidates from these divisions have taken the pledge:</p>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<?php
|
||||
@@ -44,9 +44,9 @@ $councilCount = count($councils);
|
||||
<!-- wp:list {"style":{"spacing":{"margin":{"top":"0","right":"0","bottom":"0","left":"0"}}}} -->
|
||||
<ul style="margin-top:0;margin-right:0;margin-bottom:0;margin-left:0" class="wp-block-list">
|
||||
|
||||
<?php foreach($councilChunks[$columnIdx] as $councilName): ?>
|
||||
<?php foreach($councilChunks[$columnIdx] as $divisionName): ?>
|
||||
<!-- wp:list-item -->
|
||||
<li><a href="#<?php echo sluggify($councilName); ?>"><?php echo $councilName; ?></a></li>
|
||||
<li><a href="#<?php echo sluggify($divisionName); ?>"><?php echo $divisionName; ?></a></li>
|
||||
<!-- /wp:list-item -->
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#wp post create --post_type=page --post_title="test_pledge" movie-homepage
|
||||
#wp post update 1803 ../spl-data/movie-homepage
|
||||
|
||||
DATA_PATH="../spl-data"
|
||||
DATA_PATH="../spl-data/federal_2025"
|
||||
|
||||
candidates_files=()
|
||||
for folder in "$DATA_PATH"/*; do
|
||||
|
||||
Reference in New Issue
Block a user