aboutsummaryrefslogtreecommitdiffstats
path: root/web/alert.cgi
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@fury.ukcod.org.uk>2011-02-21 11:19:22 +0000
committerMatthew Somerville <matthew@fury.ukcod.org.uk>2011-02-21 11:19:22 +0000
commita375628603ffe50e4a96b4eacbe8606927b970ea (patch)
tree2bfd86381ebc8fb73db3b332d7589ce21ad1a4e8 /web/alert.cgi
parent6722cb5711e23a0e801e415bb3928adf7eafaec8 (diff)
parent2ac9ea17dba28894cb3453da417a1648b026a2aa (diff)
Merge branch 'master' of ssh://matthew@git.mysociety.org/data/git/public/fixmystreet
Diffstat (limited to 'web/alert.cgi')
-rwxr-xr-xweb/alert.cgi19
1 files changed, 14 insertions, 5 deletions
diff --git a/web/alert.cgi b/web/alert.cgi
index 8924d97f5..fba7ef5d7 100755
--- a/web/alert.cgi
+++ b/web/alert.cgi
@@ -97,8 +97,11 @@ sub alert_list {
return alert_front_page($q, $error) if $error;
my $pretty_pc = $input_h{pc};
+ my $pretty_pc_text;# This one isnt't getting the nbsp.
if (mySociety::PostcodeUtil::is_valid_postcode($input{pc})) {
$pretty_pc = mySociety::PostcodeUtil::canonicalise_postcode($input{pc});
+ $pretty_pc_text = $pretty_pc;
+ $pretty_pc_text =~ s/ //g;
$pretty_pc =~ s/ /&nbsp;/;
}
@@ -291,17 +294,23 @@ feed, or enter your email address to subscribe to an email alert.'));
<input type="radio" name="feed" id="local:$lat:$lon" value="local:$lat:$lon"$checked>
<label for="local:$lat:$lon">$rss_label</label>
EOF
- my $rss_feed = Cobrand::url($cobrand, "/rss/l/$lat,$lon", $q);
+ my $rss_feed;
+ if ($pretty_pc_text) {
+ $rss_feed = Cobrand::url($cobrand, "/rss/pc/$pretty_pc_text/", $q);
+ } else {
+ $rss_feed = Cobrand::url($cobrand, "/rss/l/$lat,$lon/", $q);
+ }
+
my $default_link = Cobrand::url($cobrand, "/alert?type=local;feed=local:$lat:$lon", $q);
my $rss_details = _('(a default distance which covers roughly 200,000 people)');
$out .= $rss_details;
$out .= " <a href='$rss_feed'><img src='/i/feed.png' width='16' height='16' title='"
. _('RSS feed of nearby problems') . "' alt='" . _('RSS feed') . "' border='0'></a>";
$out .= '</p> <p id="rss_local_alt">' . _('(alternatively the RSS feed can be customised, within');
- my $rss_feed_2k = Cobrand::url($cobrand, "/rss/l/$lat,$lon/2", $q);
- my $rss_feed_5k = Cobrand::url($cobrand, "/rss/l/$lat,$lon/5", $q);
- my $rss_feed_10k = Cobrand::url($cobrand, "/rss/l/$lat,$lon/10", $q);
- my $rss_feed_20k = Cobrand::url($cobrand, "/rss/l/$lat,$lon/20", $q);
+ my $rss_feed_2k = Cobrand::url($cobrand, $rss_feed.'2', $q);
+ my $rss_feed_5k = Cobrand::url($cobrand, $rss_feed.'5', $q);
+ my $rss_feed_10k = Cobrand::url($cobrand, $rss_feed.'10', $q);
+ my $rss_feed_20k = Cobrand::url($cobrand, $rss_feed.'20', $q);
$out .= <<EOF;
<a href="$rss_feed_2k">2km</a> / <a href="$rss_feed_5k">5km</a>
/ <a href="$rss_feed_10k">10km</a> / <a href="$rss_feed_20k">20km</a>)