diff options
Diffstat (limited to 'web')
-rwxr-xr-x | web/about.cgi | 4 | ||||
-rwxr-xr-x | web/alert.cgi | 4 | ||||
-rwxr-xr-x | web/confirm.cgi | 105 | ||||
-rwxr-xr-x | web/contact.cgi | 10 | ||||
-rw-r--r-- | web/css.css | 26 | ||||
-rwxr-xr-x | web/faq.cgi | 19 | ||||
-rwxr-xr-x | web/index.cgi | 80 | ||||
-rw-r--r-- | web/js.js | 2 | ||||
-rwxr-xr-x | web/photo.cgi | 4 | ||||
-rwxr-xr-x | web/report.cgi | 12 | ||||
-rwxr-xr-x | web/rss.cgi | 4 | ||||
-rw-r--r-- | web/xsl.xsl | 4 |
12 files changed, 153 insertions, 121 deletions
diff --git a/web/about.cgi b/web/about.cgi index a302eb3f0..82e6a234e 100755 --- a/web/about.cgi +++ b/web/about.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # about.cgi: -# About page for Neighbourhood Fix-It +# About page for FixMyStreet # # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: about.cgi,v 1.3 2007-06-01 14:24:41 matthew Exp $ +# $Id: about.cgi,v 1.4 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; diff --git a/web/alert.cgi b/web/alert.cgi index 050f3cf9b..d482d3513 100755 --- a/web/alert.cgi +++ b/web/alert.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # alert.cgi: -# Alert code for Neighbourhood Fix-It +# Alert code for FixMyStreet # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: alert.cgi,v 1.6 2007-06-01 14:24:41 matthew Exp $ +# $Id: alert.cgi,v 1.7 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; diff --git a/web/confirm.cgi b/web/confirm.cgi index 9c18726c7..cdc59236a 100755 --- a/web/confirm.cgi +++ b/web/confirm.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # confirm.cgi: -# Confirmation code for Neighbourhood Fix-It +# Confirmation code for FixMyStreet # # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: confirm.cgi,v 1.19 2007-06-01 14:24:41 matthew Exp $ +# $Id: confirm.cgi,v 1.20 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; @@ -43,53 +43,14 @@ sub main { my $id = mySociety::AuthToken::retrieve($type, $token); if ($id) { if ($type eq 'update') { - dbh()->do("update comment set state='confirmed' where id=? and state='unconfirmed'", {}, $id); - my ($email) = dbh()->selectrow_array("select email from comment where id=?", {}, $id); - my ($problem_id, $fixed) = dbh()->selectrow_array("select problem_id,mark_fixed from comment where id=?", {}, $id); - if ($fixed) { - dbh()->do("update problem set state='fixed', lastupdate = ms_current_timestamp() - where id=? and state='confirmed'", {}, $problem_id); - } else { - # Only want to refresh problem if not already fixed - dbh()->do("update problem set lastupdate = ms_current_timestamp() - where id=? and state='confirmed'", {}, $problem_id); - } - my $salt = unpack('h*', random_bytes(8)); - my $secret = scalar(dbh()->selectrow_array('select secret from secret')); - my $signed_email = sha1_hex("$problem_id-$email-$salt-$secret"); - $out = '<form action="/alert" method="post">'; - $out .= $q->p(sprintf(_('You have successfully confirmed your update and you can now <a href="%s">view it on the site</a>.'), "/?id=$problem_id#update_$id")); - my $signup = <<EOF; -<input type="hidden" name="signed_email" value="$salt,$signed_email"> -<input type="hidden" name="email" value="$email"> -<input type="hidden" name="id" value="$problem_id"> -<input type="hidden" name="type" value="updates"> -EOF - $signup .= '<input type="submit" value="' . _('sign up') . '">'; - $out .= $q->p(sprintf(_('You could also <a href="%s">subscribe to the RSS feed</a> of updates by other local people on this problem, or %s if you wish to receive updates by email.'), "/rss/$problem_id", $signup)); - $out .= '</form>'; + my $problem_id; + ($out, $problem_id) = confirm_update($q, $id); + my $email = dbh()->selectrow_array("select email from comment where id=?", {}, $id); + $out .= advertise_updates($q, $problem_id, $email); } elsif ($type eq 'problem') { - dbh()->do("update problem set state='confirmed', confirmed=ms_current_timestamp(), lastupdate=ms_current_timestamp() - where id=? and state='unconfirmed'", {}, $id); - my ($email, $council) = dbh()->selectrow_array("select email, council from problem where id=?", {}, $id); - my $salt = unpack('h*', random_bytes(8)); - my $secret = scalar(dbh()->selectrow_array('select secret from secret')); - my $signed_email = sha1_hex("$id-$email-$salt-$secret"); - $out = '<form action="/alert" method="post">'; - $out .= $q->p( - _('You have successfully confirmed your problem') - . ($council ? _(' and <strong>we will now send it to the council</strong>') : '') - . sprintf(_('. You can <a href="%s">view the problem on this site</a>.'), "/?id=$id") - ); - my $signup = <<EOF; -<input type="hidden" name="signed_email" value="$salt,$signed_email"> -<input type="hidden" name="email" value="$email"> -<input type="hidden" name="id" value="$id"> -<input type="hidden" name="type" value="updates"> -EOF - $signup .= '<input type="submit" value="' . _('sign up') . '">'; - $out .= $q->p(sprintf(_('You could also <a href="%s">subscribe to the RSS feed</a> of updates by other local people on this problem, or %s if you wish to receive updates by email.'), "/rss/$id", $signup)); - $out .= '</form>'; + $out = confirm_problem($q, $id); + my $email = dbh()->selectrow_array("select email from problem where id=?", {}, $id); + $out .= advertise_updates($q, $id, $email); } dbh()->commit(); } else { @@ -107,3 +68,51 @@ EOF } Page::do_fastcgi(\&main); +sub confirm_update { + my ($q, $id) = @_; + dbh()->do("update comment set state='confirmed' where id=? and state='unconfirmed'", {}, $id); + my ($problem_id, $fixed) = dbh()->selectrow_array("select problem_id,mark_fixed from comment where id=?", {}, $id); + if ($fixed) { + dbh()->do("update problem set state='fixed', lastupdate = ms_current_timestamp() + where id=? and state='confirmed'", {}, $problem_id); + } else { + # Only want to refresh problem if not already fixed + dbh()->do("update problem set lastupdate = ms_current_timestamp() + where id=? and state='confirmed'", {}, $problem_id); + } + my $out = '<form action="/alert" method="post">'; + $out .= $q->p(sprintf(_('You have successfully confirmed your update and you can now <a href="%s">view it on the site</a>.'), "/?id=$problem_id#update_$id")); + return ($problem_id, $out); +} + +sub confirm_problem { + my ($q, $id) = @_; + dbh()->do("update problem set state='confirmed', confirmed=ms_current_timestamp(), lastupdate=ms_current_timestamp() + where id=? and state='unconfirmed'", {}, $id); + my $council = dbh()->selectrow_array("select council from problem where id=?", {}, $id); + my $out = '<form action="/alert" method="post">'; + $out .= $q->p( + _('You have successfully confirmed your problem') + . ($council ? _(' and <strong>we will now send it to the council</strong>') : '') + . sprintf(_('. You can <a href="%s">view the problem on this site</a>.'), "/?id=$id") + ); + return $out; +} + +sub advertise_updates { + my ($q, $problem_id, $email) = @_; + my $salt = unpack('h*', random_bytes(8)); + my $secret = scalar(dbh()->selectrow_array('select secret from secret')); + my $signed_email = sha1_hex("$problem_id-$email-$salt-$secret"); + my $signup = <<EOF; +<input type="hidden" name="signed_email" value="$salt,$signed_email"> +<input type="hidden" name="email" value="$email"> +<input type="hidden" name="id" value="$problem_id"> +<input type="hidden" name="type" value="updates"> +EOF + $signup .= '<input type="submit" value="' . _('sign up') . '">'; + my $out = $q->p(sprintf(_('You could also <a href="%s">subscribe to the RSS feed</a> of updates by other local people on this problem, or %s if you wish to receive updates by email.'), "/rss/$problem_id", $signup)); + $out .= '</form>'; + return $out; +} + diff --git a/web/contact.cgi b/web/contact.cgi index 971b9793a..eaaadcf91 100755 --- a/web/contact.cgi +++ b/web/contact.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # contact.cgi: -# Contact page for Neighbourhood Fix-It +# Contact page for FixMyStreet # # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: contact.cgi,v 1.19 2007-06-01 14:24:41 matthew Exp $ +# $Id: contact.cgi,v 1.20 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; @@ -78,8 +78,8 @@ sub contact_submit { my $email = mySociety::Email::construct_email({ _body_ => "$message\n\n$postfix", From => [$input{email}, $input{name}], - To => [[mySociety::Config::get('CONTACT_EMAIL'), 'Neighbourhood Fix-It']], - Subject => 'NFI message: ' . $subject + To => [[mySociety::Config::get('CONTACT_EMAIL'), 'FixMyStreet']], + Subject => 'FMS message: ' . $subject }); my $result = mySociety::Util::send_email($email, $input{email}, mySociety::Config::get('CONTACT_EMAIL')); if ($result == mySociety::Util::EMAIL_SUCCESS) { @@ -128,7 +128,7 @@ sub contact_page { } else { $out .= <<EOF; <p>Please do <strong>not</strong> report problems through this form; messages go to -the team behind Neighbourhood Fix-It, not a council. To report a problem, +the team behind FixMyStreet, not a council. To report a problem, please <a href="/">go to the front page</a> and follow the instructions.</p> <p>We'd love to hear what you think about this site. Just fill in the form:</p> diff --git a/web/css.css b/web/css.css index 4fe06bf4b..5e4bf32c3 100644 --- a/web/css.css +++ b/web/css.css @@ -100,7 +100,13 @@ ul#error { color: #5e552b; } +#my { + color: #4e451b; + background-color: #e3d595; +} #beta { + color: #6e653b; + background-color: #e3d595; font-size: 50%; font-style: italic; } @@ -159,7 +165,7 @@ ul#error { font-size: 83%; border-top: solid 1px #5e552b; display: table; - margin: 1em 0 1em auto; + margin: 2em 0 1em auto; padding: 2px 4px; } @@ -169,7 +175,6 @@ ul#error { text-align: center; font-size: 150%; margin: 0 2em; - font-weight: bolder; } #postcodeForm { @@ -203,11 +208,6 @@ ul#error { margin-top: 0; } -#front_stats { - margin: 0.5em auto 0; - width: 20em; -} - #front_stats div { text-align: center; width: 5.5em; @@ -215,7 +215,7 @@ ul#error { -moz-border-radius: 0.5em; border-radius: 0.5em; float: left; - margin: 0 0.5em 1em; + margin: 0 1em 1em; } #front_stats div big { @@ -231,7 +231,7 @@ ul#error { margin-right: 0.25em; margin-bottom: 0.25em; } -#front_recent > h2:first-child { +#front_recent > h2:first-child, #front_intro > h2:first-child { margin-top: 0; } @@ -322,6 +322,14 @@ p#copyright { border: 0; } +#text_map { + margin-top: 0.5em; + margin-bottom: 0.5em; +} +#text_no_map { + margin-top: 0; +} + /* ol#current img { position: absolute; diff --git a/web/faq.cgi b/web/faq.cgi index 859a6d6ab..09884a549 100755 --- a/web/faq.cgi +++ b/web/faq.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # faq.cgi: -# FAQ page for Neighbourhood Fix-It +# FAQ page for FixMyStreet # # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: faq.cgi,v 1.20 2007-06-01 14:24:41 matthew Exp $ +# $Id: faq.cgi,v 1.21 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; @@ -30,8 +30,8 @@ sub faq { my $q = shift; my $out = $q->h1(_('Frequently Asked Questions')); $out .= $q->dl( - $q->dt(_('What is Neighbourhood Fix-It for?')), - $q->dd(_('Neighbourhood Fix-It is a site to help people report, view, + $q->dt(_('What is FixMyStreet for?')), + $q->dd(_('FixMyStreet is a site to help people report, view, or discuss local problems they’ve found to their local council by simply locating them on a map. It launched in beta early February 2007.')), @@ -50,7 +50,7 @@ council can then resolve the problem the way they normally would. Alternatively, you can discuss the problem on the website with others, and then together lobby the council to fix it, or fix it directly yourselves.')), $q->dt(_('Is it free?')), - $q->dd(_('The site is free to use, yes. Neighbourhood Fix-It is run + $q->dd(_('The site is free to use, yes. FixMyStreet is run by a registered charity, though, so if you want to make a contribution, <a href="https://secure.mysociety.org/donate/">please do</a>.')), ); @@ -87,17 +87,20 @@ about updates to a particular problem.')) ); $out .= $q->h2(_('Organisation Questions')); $out .= $q->dl( - $q->dt(_('Who built Neighbourhood Fix-It?')), + $q->dt(_('Who built FixMyStreet?')), $q->dd(_('This site was built by <a href="http://www.mysociety.org">mySociety</a>. mySociety is the project of a registered charity which has grown out of the community of volunteers who built sites like <a href="http://www.theyworkforyou.com/">TheyWorkForYou.com</a>. mySociety’s primary mission is to build Internet projects which give people simple, tangible benefits in the civic and community aspects of their lives. Our first project -was <a href="http://www.writetothem.com/">WriteToThem.com</a>, where you can write to any of your +was <a href="http://www.writetothem.com/">WriteToThem</a>, where you can write to any of your elected representatives, for free.')), $q->dt(_('Who pays for it?')), - $q->dd(_('Neighbourhood Fix-It was paid for via the Department for + $q->dd(_('FixMyStreet was paid for via the Department for Constitutional Affairs Innovations Fund.')), + $q->dt(_('<a name="nfi"></a>Wasn\'t this site called Neighbourhood Fix-It?')), + $q->dd(_('Yes, we changed the name mid June 2007. We decided +Neighbourhood Fix-It was a bit of a mouthful, hard to spell, and hard to publicise (does the URL have a dash in it or not?). The domain FixMyStreet became available recently, and everyone liked the name.')), $q->dt(_('Do you need any help with the project?')), $q->dd(_('Yes, we can use help in all sorts of ways, technical or non-technical. Please see our <a diff --git a/web/index.cgi b/web/index.cgi index 9f90dd334..eb45ffaeb 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # index.cgi: -# Main code for Neighbourhood Fix-It +# Main code for FixMyStreet # # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: index.cgi,v 1.138 2007-06-13 14:56:19 matthew Exp $ +# $Id: index.cgi,v 1.139 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; @@ -28,6 +28,7 @@ use Page; use mySociety::AuthToken; use mySociety::Config; use mySociety::DBHandle qw(dbh select_all); +use mySociety::Gaze; use mySociety::GeoUtil; use mySociety::Util; use mySociety::MaPit; @@ -87,8 +88,8 @@ sub front_page { my ($q, $error) = @_; my $pc_h = ent($q->param('pc') || ''); my $out = <<EOF; -<p id="expl">Report, view, or discuss local problems -like graffiti, fly tipping, broken paving slabs, or street lighting</p> +<p id="expl"><strong>Report, view, or discuss local problems</strong> +<br><small>(like graffiti, fly tipping, broken paving slabs, or street lighting)</small></p> EOF $out .= '<p id="error">' . $error . '</p>' if ($error); my $fixed = dbh()->selectrow_array("select count(*) from problem where state='fixed' and lastupdate>ms_current_timestamp()-'1 month'::interval"); @@ -103,22 +104,23 @@ EOF <div id="front_intro"> +<h2>How to report a problem</h2> + +<ol> +<li>Enter a nearby postcode, or street name and area +<li>Locate the problem on a map of the area +<li>Enter details of the problem +<li>We send it to the council on your behalf +</ol> + +<h2>FixMyStreet updates</h2> + <div id="front_stats"> <div><big>$new</big> reports in past week</div> <div><big>$fixed</big> fixed in past month</div> <div><big>$updates</big> problem updates</div> </div> -<p>Reports are sent directly to the local council. -Reporting a problem is very simple:</p> - -<ol> -<li>Enter a postcode or street name and area above; -<li>Locate the problem on a high-scale map; -<li>Enter details of the problem; -<li>Submit to the council. -</ol> - </div> <div id="front_recent"> @@ -403,7 +405,7 @@ If this is not the correct location, simply click on the map again. '; if ($details eq 'all') { $out .= '<li>All the details you provide here will be sent to <strong>' - . join('</strong> or <strong>', map { Page::canonicalise_council($areas_info->{$_}->{name}) } @$all_councils) + . join('</strong> or <strong>', map { $areas_info->{$_}->{name} } @$all_councils) . '</strong>. We show the subject and details of the problem on the site, along with your name if you give us permission.'; $out .= '<input type="hidden" name="council" value="' . join(',',@$all_councils) . '">'; @@ -415,9 +417,9 @@ If this is not the correct location, simply click on the map again. '; push @missing, $_ unless $councils{$_}; } my $n = @missing; - my $list = join(' or ', map { Page::canonicalise_council($areas_info->{$_}->{name}) } @missing); + my $list = join(' or ', map { $areas_info->{$_}->{name} } @missing); $out .= '<li>All the details you provide here will be sent to <strong>' - . join('</strong> or <strong>', map { Page::canonicalise_council($areas_info->{$_}->{name}) } @councils) + . join('</strong> or <strong>', map { $areas_info->{$_}->{name} } @councils) . '</strong>. We show the subject and details of the problem on the site, along with your name if you give us permission.'; $out .= ' We do <strong>not</strong> yet have details for the other council'; @@ -428,7 +430,7 @@ problems for $list and emailing it to us at <a href='mailto:$e'>$e</a>."; . '|' . join(',', @missing) . '">'; } else { my $e = mySociety::Config::get('CONTACT_EMAIL'); - my $list = join(' or ', map { Page::canonicalise_council($areas_info->{$_}->{name}) } @$all_councils); + my $list = join(' or ', map { $areas_info->{$_}->{name} } @$all_councils); my $n = @$all_councils; $out .= '<li>We do not yet have details for the council'; $out .= ($n>1) ? 's that cover' : ' that covers'; @@ -481,7 +483,7 @@ $category <li>Please do not be abusive — abusing your council devalues the service for all users. <li>Writing your message entirely in block capitals makes it hard to read, as does a lack of punctuation. -<li>Remember that Neighbourhood Fix-It is primarily for reporting physical +<li>Remember that FixMyStreet is primarily for reporting physical problems that can be fixed. If your problem is not appropriate for submission via this site remember that you can contact your council directly using their own website. @@ -515,15 +517,17 @@ sub display_location { return geocode_choice($error) if (ref($error) eq 'ARRAY'); return front_page($q, $error) if ($error); - my ($pins, $current_map, $current, $fixed) = map_pins($q, $x, $y); + my ($pins, $current_map, $current, $fixed, $dist) = map_pins($q, $x, $y); my $out = Page::display_map($q, x => $x, y => $y, type => 1, pins => $pins ); - $out .= '<h1>Click on the map to report a problem</h1>'; + $out .= '<h1>Problems in this area</h1>'; if (@errors) { $out .= '<ul id="error"><li>' . join('</li><li>', @errors) . '</li></ul>'; } my $skipurl = NewURL($q, 'submit_map'=>1, skipped=>1); $out .= <<EOF; -<p><small>If you cannot see a map – if you have images turned off, +<p id="text_map">To report a problem, simply <strong>click on the map</strong> at the correct location.</p> + +<p id="text_no_map"><small>If you cannot see a map – if you have images turned off, or are using a text only browser, for example – and you wish to report a problem, please <a href="$skipurl">skip this step</a> and we will ask you @@ -531,7 +535,7 @@ to describe the location of your problem instead.</small></p> EOF $out .= <<EOF; <div> -<h2>Recent problems reported on this map</h2> +<h2>Recent problems reported near here</h2> EOF my $list = ''; foreach (@$current_map) { @@ -545,7 +549,7 @@ EOF $out .= '<p>No problems have been reported yet.</p>'; } $out .= <<EOF; - <h2>Closest problems within 10km</h2> + <h2>Closest problems within ${dist}km</h2> <p><a href="/rss/$x,$y"><img align="right" src="/i/feed.png" width="16" height="16" title="RSS feed of recent local problems" alt="RSS feed" border="0"></a></p> EOF $list = ''; @@ -561,7 +565,7 @@ EOF $out .= '<p>No problems have been reported yet.</p>'; } $out .= <<EOF; - <h2>Recently fixed problems within 10km</h2> + <h2>Recently fixed problems within ${dist}km</h2> EOF $list = ''; foreach (@$fixed) { @@ -578,7 +582,7 @@ EOF $out .= Page::display_map_end(1); my %params = ( - rss => [ 'Recent local problems, Neighbourhood Fix-It', "/rss/$x,$y" ] + rss => [ 'Recent local problems, FixMyStreet', "/rss/$x,$y" ] ); return ($out, %params); @@ -623,6 +627,10 @@ sub display_problem { $out .= $q->p({align=>'right'}, $q->small($q->a({href => '/contact?id=' . $input{id}}, 'Offensive? Unsuitable? Tell us')) ); + + # Try and have pin near centre of map + $x_tile -= 1 if $x - $x_tile < 0.5; + $y_tile -= 1 if $y - $y_tile < 0.5; my $back = NewURL($q, id=>undef, x=>$x_tile, y=>$y_tile); $out .= '<p style="padding-bottom: 0.5em; border-bottom: dotted 1px #999999;" align="right"><a href="' . $back . '">More problems nearby</a></p>'; @@ -670,7 +678,7 @@ EOF $out .= Page::display_map_end(0); my %params = ( - rss => [ 'Updates to this problem, Neighbourhood Fix-It', "/rss/$input_h{id}" ], + rss => [ 'Updates to this problem, FixMyStreet', "/rss/$input_h{id}" ], title => $problem->{title} ); return ($out, %params); @@ -680,12 +688,12 @@ sub map_pins { my ($q, $x, $y) = @_; my $pins = ''; - my $min_e = Page::tile_to_os($x); - my $min_n = Page::tile_to_os($y); + my $min_e = Page::tile_to_os($x-1); + my $min_n = Page::tile_to_os($y-1); my $mid_e = Page::tile_to_os($x+1); my $mid_n = Page::tile_to_os($y+1); - my $max_e = Page::tile_to_os($x+2); - my $max_n = Page::tile_to_os($y+2); + my $max_e = Page::tile_to_os($x+3); + my $max_n = Page::tile_to_os($y+3); my $current_map = select_all( "select id,title,easting,northing from problem where state='confirmed' @@ -701,6 +709,10 @@ sub map_pins { $pins .= Page::display_pin($q, $px, $py, 'red', $count_prob++); } + my ($lat, $lon) = mySociety::GeoUtil::national_grid_to_wgs84($mid_e, $mid_n, 'G'); + my $dist = mySociety::Gaze::get_radius_containing_population($lat, $lon, 200000); + $dist = int($dist*10+0.5)/10; + # XXX: Change to only show problems with extract(epoch from ms_current_timestamp()-lastupdate) < 8 weeks # And somehow display/link to old problems somewhere else... my $current = []; @@ -708,7 +720,7 @@ sub map_pins { my $limit = 9 - @$current_map; $current = select_all( "select id, title, easting, northing, distance - from problem_find_nearby(?, ?, 10) as nearby, problem + from problem_find_nearby(?, ?, $dist) as nearby, problem where nearby.problem_id = problem.id and state = 'confirmed'" . (@ids ? ' and id not in (' . join(',' , @ids) . ')' : '') . " order by distance, created desc limit $limit", $mid_e, $mid_n); @@ -720,7 +732,7 @@ sub map_pins { } my $fixed = select_all( "select id, title, easting, northing, distance - from problem_find_nearby(?, ?, 10) as nearby, problem + from problem_find_nearby(?, ?, $dist) as nearby, problem where nearby.problem_id = problem.id and state='fixed' order by created desc limit 9", $mid_e, $mid_n); foreach (@$fixed) { @@ -728,7 +740,7 @@ sub map_pins { my $py = Page::os_to_px($_->{northing}, $y); $pins .= Page::display_pin($q, $px, $py, 'green', $count_fixed++); } - return ($pins, $current_map, $current, $fixed); + return ($pins, $current_map, $current, $fixed, $dist); } sub geocode_choice { @@ -1,6 +1,6 @@ /* * js.js - * Neighbourhood Fix-It JavaScript + * FixMyStreet JavaScript * * TODO * Investigate jQuery diff --git a/web/photo.cgi b/web/photo.cgi index afcfa4751..41e9221ef 100755 --- a/web/photo.cgi +++ b/web/photo.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # photo.cgi: -# Display a photo for Neighbourhood Fix-It +# Display a photo for FixMyStreet # # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: photo.cgi,v 1.4 2007-06-13 14:56:19 matthew Exp $ +# $Id: photo.cgi,v 1.5 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; diff --git a/web/report.cgi b/web/report.cgi index 947c1b105..753364745 100755 --- a/web/report.cgi +++ b/web/report.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # report.cgi: -# Display summary reports for Neighbourhood Fix-It +# Display summary reports for FixMyStreet # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: report.cgi,v 1.37 2007-06-15 09:34:45 francis Exp $ +# $Id: report.cgi,v 1.38 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; @@ -82,11 +82,11 @@ sub main { print '<table cellpadding="3" cellspacing="1" border="0">'; print '<tr><th>Name</th><th>New problems</th><th>Older problems</th> <th>Old problems,<br>state unknown</th><th>Recently fixed</th><th>Old fixed</th></tr>'; - foreach (sort { Page::canonicalise_council($areas_info->{$a}->{name}) cmp Page::canonicalise_council($areas_info->{$b}->{name}) } keys %councils) { + foreach (sort { $areas_info->{$a}->{name} cmp $areas_info->{$b}->{name} } keys %councils) { print '<tr align="center"'; print ' class="a"' if (++$c%2); print '><td align="left"><a href="report?council=' . $_ . '">' . - Page::canonicalise_council($areas_info->{$_}->{name}) . '</a></td>'; + $areas_info->{$_}->{name} . '</a></td>'; summary_cell(\@{$open{$_}{new}}); summary_cell(\@{$open{$_}{older}}); summary_cell(\@{$open{$_}{unknown}}); @@ -96,14 +96,14 @@ sub main { } print '</table>'; } else { - my $name = Page::canonicalise_council($areas_info->{$one_council}->{name}); + my $name = $areas_info->{$one_council}->{name}; if (!$name) { print Page::header($q, title=>"Summary reports"); print "Council with identifier " . ent($one_council). " not found. "; print $q->a({href => NewURL($q, all=>undef, council=>undef) }, 'Show all councils'); print "."; } else { - print Page::header($q, title=>"$name - Summary reports", rss => [ "Problems within $name, Neighbourhood Fix-It", "/rss/council/$one_council" ]); + print Page::header($q, title=>"$name - Summary reports", rss => [ "Problems within $name, FixMyStreet", "/rss/council/$one_council" ]); print $q->p( $q->a({href => "/rss/council/$one_council"}, '<img align="right" src="/i/feed.png" width="16" height="16" title="RSS feed" alt="RSS feed of problems in this council" border="0" hspace="4">'), 'This is a summary of all reports for one council. You can ' . diff --git a/web/rss.cgi b/web/rss.cgi index 804e69faf..46f669dff 100755 --- a/web/rss.cgi +++ b/web/rss.cgi @@ -1,12 +1,12 @@ #!/usr/bin/perl -w # rss.cgi: -# RSS for Neighbourhood Fix-It +# RSS for FixMyStreet # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: rss.cgi,v 1.7 2007-05-16 17:51:21 matthew Exp $ +# $Id: rss.cgi,v 1.8 2007-06-15 14:57:52 matthew Exp $ use strict; require 5.8.0; diff --git a/web/xsl.xsl b/web/xsl.xsl index 19e16c4a7..95eeb0a33 100644 --- a/web/xsl.xsl +++ b/web/xsl.xsl @@ -10,7 +10,7 @@ <link rel="stylesheet" href="/css.css"/> </head> <body> - <div id="header"><a href="/">Neighbourhood Fix-It</a></div> + <div id="header"><a href="/">FixMyStreet</a></div> <div id="wrapper"><div id="content"> <xsl:apply-templates select="rss/channel"/> </div></div> @@ -34,7 +34,7 @@ href="https://secure.mysociety.org/cvstrac/dir?d=mysociety/services/TilMa">code< <xsl:template match="channel"> <div id="rss_box"> <h1>What is this page?</h1> - <p>This is an RSS feed from the Neighbourhood Fix-It website. RSS feeds allow you to stay up to date with the latest changes and additions to the site. + <p>This is an RSS feed from the FixMyStreet website. RSS feeds allow you to stay up to date with the latest changes and additions to the site. To subscribe to it, you will need a News Reader or other similar device. <br/> <a href="http://news.bbc.co.uk/1/hi/help/3223484.stm#whatisrss"><strong>Help</strong>, I don't know what a news reader is and still don't know what this is about (from the BBC).</a></p> |