aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/httpd.conf3
-rw-r--r--db/alert_types.sql29
-rwxr-xr-xweb/rss.cgi6
3 files changed, 30 insertions, 8 deletions
diff --git a/conf/httpd.conf b/conf/httpd.conf
index 91b832b8e..5b4d3eea1 100644
--- a/conf/httpd.conf
+++ b/conf/httpd.conf
@@ -20,7 +20,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org
#
-# $Id: httpd.conf,v 1.10 2007-05-04 14:36:55 matthew Exp $
+# $Id: httpd.conf,v 1.11 2007-05-14 18:20:41 matthew Exp $
DirectoryIndex index.cgi
@@ -35,6 +35,7 @@ RewriteRule ^/[Qq]/([0-9A-Za-z]{16}).*$ /questionnaire.cgi?token=$1
RewriteRule ^/rss/([0-9]+)$ /rss.cgi?type=new_updates;id=$1 [QSA]
RewriteRule ^/rss/([0-9]+),([0-9]+)$ /rss.cgi?type=local_problems;x=$1;y=$2 [QSA]
+RewriteRule ^/rss/council/([0-9]+)$ /rss.cgi?type=council_problems;id=$1 [QSA]
RewriteRule ^/rss/problems$ /rss.cgi?type=new_problems [QSA]
RewriteRule ^/report/([0-9]+)$ /?id=$1 [QSA]
diff --git a/db/alert_types.sql b/db/alert_types.sql
index 5e69f5b97..26ef3c265 100644
--- a/db/alert_types.sql
+++ b/db/alert_types.sql
@@ -1,24 +1,41 @@
insert into alert_type
-(ref, head_sql_query, head_table, head_title, head_link, head_description,
- item_table, item_where, item_order, item_title, item_link, item_description, template)
+(ref, head_sql_query, head_table,
+ head_title, head_link, head_description,
+ item_table, item_where, item_order,
+ item_title, item_link, item_description, template)
values ('new_updates', 'select * from problem where id=?', 'problem',
'Updates on {{title}}', '/', 'Updates on {{title}}',
'comment', 'comment.state=\'confirmed\'', 'created desc',
'Update by {{name}}', '/?id={{problem_id}}#comment_{{id}}', '{{text}}', 'alert-update');
insert into alert_type
-(ref, head_sql_query, head_table, head_title, head_link, head_description,
- item_table, item_where, item_order, item_title, item_link, item_description, template)
+(ref, head_sql_query, head_table,
+ head_title, head_link, head_description,
+ item_table, item_where, item_order,
+ item_title, item_link, item_description, template)
values ('new_problems', '', '',
'New problems on Neighbourhood Fix-It', '/', 'The latest problems reported by users',
'problem', 'problem.state in (\'confirmed\', \'fixed\')', 'created desc',
'{{title}}', '/?id={{id}}', '{{detail}}', 'alert-problem');
insert into alert_type
-(ref, head_sql_query, head_table, head_title, head_link, head_description,
- item_table, item_where, item_order, item_title, item_link, item_description, template)
+(ref, head_sql_query, head_table,
+ head_title, head_link, head_description,
+ item_table, item_where, item_order,
+ item_title, item_link, item_description, template)
values ('local_problems', '', '',
'New local problems on Neighbourhood Fix-It', '/', 'The latest local problems reported by users',
'problem_find_nearby(?, ?, 10) as nearby,problem', 'nearby.problem_id = problem.id and problem.state in (\'confirmed\', \'fixed\')', 'created desc',
'{{title}}', '/?id={{id}}', '{{detail}}', 'alert-problem');
+insert into alert_type
+(ref, head_sql_query, head_table,
+ head_title, head_link, head_description,
+ item_table, item_where, item_order,
+ item_title, item_link, item_description, template)
+values ('council_problems', '', '',
+ 'New local problems on Neighbourhood Fix-It', '/report', 'The latest local problems reported by users',
+ 'problem', 'problem.state in (\'confirmed\', \'fixed\') and council=?', 'created desc',
+ '{{title}}', '/?id={{id}}', '{{detail}}', 'alert-problem'
+);
+
diff --git a/web/rss.cgi b/web/rss.cgi
index a35f70f50..650aa7d28 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.4 2007-05-09 11:18:36 matthew Exp $
+# $Id: rss.cgi,v 1.5 2007-05-14 18:20:42 matthew Exp $
use strict;
require 5.8.0;
@@ -50,6 +50,10 @@ sub main {
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 = 'council='.$id;
+ mySociety::Alert::generate_rss($type, $qs, $id);
} else {
throw Error::Simple('Unknown alert type') unless $type;
}