aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rwxr-xr-xweb/reports.cgi14
-rwxr-xr-xweb/rss.cgi12
2 files changed, 17 insertions, 9 deletions
diff --git a/web/reports.cgi b/web/reports.cgi
index 9bc8ccf05..63ccd64bd 100755
--- a/web/reports.cgi
+++ b/web/reports.cgi
@@ -7,7 +7,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: reports.cgi,v 1.8 2007-08-24 23:48:47 matthew Exp $
+# $Id: reports.cgi,v 1.9 2007-08-25 00:17:30 matthew Exp $
use strict;
require 5.8.0;
@@ -44,13 +44,14 @@ sub main {
# Look up council name, if given
my $q_council = $q->param('council') || '';
- my ($one_council, $area_type);
+ my ($one_council, $area_type, $area_name);
if ($q_council =~ /\D/) {
(my $qc = $q_council) =~ s/ and / & /;
$qc = mySociety::MaPit::get_voting_area_by_name("$qc ", $mySociety::VotingArea::council_parent_types);
if (keys %$qc == 1) {
($one_council) = keys %$qc;
$area_type = $qc->{$one_council}->{type};
+ $area_name = $qc->{$one_council}->{name};
}
if (!$one_council) { # Given a false council name
print $q->redirect('/reports');
@@ -58,6 +59,8 @@ sub main {
}
} elsif ($q_council =~ /^\d+$/) {
$one_council = $q_council;
+ my $va_info = mySociety::MaPit::get_voting_area_info($q_council);
+ $area_name = $va_info->{name};
}
$all = 0 unless $one_council;
@@ -86,17 +89,20 @@ sub main {
return;
}
my $type = 'council_problems'; # Problems sent to a council
- my @params;
+ my (@params, %title_params);
+ $title_params{COUNCIL} = $area_name;
push @params, $one_council if $rss eq 'reports';
push @params, $ward ? $ward : $one_council;
if ($ward && $rss eq 'reports') {
$type = 'ward_problems'; # Problems sent to a council, restricted to a ward
+ $title_params{WARD} = $q_ward;
} elsif ($rss eq 'area') {
+ $title_params{NAME} = $ward ? $q_ward : $q_council;
$type = 'area_problems'; # Problems within an area
}
my $url = short_name($q_council);
$url .= '/' . short_name($q_ward) if $ward;
- mySociety::Alert::generate_rss($type, "/$url", @params);
+ mySociety::Alert::generate_rss($type, "/$url", \@params, \%title_params);
return;
}
diff --git a/web/rss.cgi b/web/rss.cgi
index aba53b1c0..c3b33f8a3 100755
--- a/web/rss.cgi
+++ b/web/rss.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: rss.cgi,v 1.16 2007-08-24 22:35:51 matthew Exp $
+# $Id: rss.cgi,v 1.17 2007-08-25 00:17:30 matthew Exp $
use strict;
require 5.8.0;
@@ -21,6 +21,7 @@ use Page;
use mySociety::Config;
use mySociety::DBHandle qw(dbh);
use mySociety::Alert;
+use mySociety::MaPit;
use mySociety::Web;
use mySociety::GeoUtil;
use mySociety::Gaze;
@@ -67,21 +68,22 @@ sub main {
$d = int($d*10+0.5)/10;
}
- mySociety::Alert::generate_rss($type, $qs, $e, $n, $d);
+ mySociety::Alert::generate_rss($type, $qs, [$e, $n, $d]);
} elsif ($type eq 'new_updates') {
my $id = $q->param('id');
my $qs = '?id='.$id;
- mySociety::Alert::generate_rss($type, $qs, $id);
+ mySociety::Alert::generate_rss($type, $qs, [$id]);
} elsif ($type eq 'new_problems') {
mySociety::Alert::generate_rss($type, '');
} elsif ($type eq 'council_problems') {
my $id = $q->param('id');
my $qs = '/'.$id;
- mySociety::Alert::generate_rss($type, $qs, $id);
+ mySociety::Alert::generate_rss($type, $qs, [$id]);
} elsif ($type eq 'area_problems') {
my $id = $q->param('id');
+ my $va_info = mySociety::MaPit::get_voting_area_info($id);
my $qs = '/'.$id;
- mySociety::Alert::generate_rss($type, $qs, $id);
+ mySociety::Alert::generate_rss($type, $qs, [$id], { NAME => $va_info->{name} });
} elsif ($type eq 'all_problems') {
mySociety::Alert::generate_rss($type, '');
} else {