aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Page.pm13
-rwxr-xr-xweb/alert.cgi11
-rwxr-xr-xweb/index.cgi4
-rwxr-xr-xweb/questionnaire.cgi4
4 files changed, 18 insertions, 14 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 821091632..5f9779eaa 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.191 2009-10-19 16:27:02 louise Exp $
+# $Id: Page.pm,v 1.192 2009-10-20 09:14:43 louise Exp $
#
package Page;
@@ -780,8 +780,9 @@ sub display_problem_text {
foreach (split /\n{2,}/, $detail) {
$out .= '<p>' . ent($_) . '</p>';
}
-
- if ($problem->{photo}) {
+ my $cobrand = get_cobrand($q);
+ my $display_photos = Cobrand::allow_photo_display($cobrand);
+ if ($display_photos && $problem->{photo}) {
my $dims = Image::Size::html_imgsize(\$problem->{photo});
$out .= "<p align='center'><img alt='' $dims src='/photo?id=$problem->{id}'></p>";
}
@@ -791,7 +792,7 @@ sub display_problem_text {
# Display updates
sub display_problem_updates {
- my $id = shift;
+ my ($id, $q) = @_;
my $updates = select_all(
"select id, name, extract(epoch from created) as created, text,
mark_fixed, mark_open, (photo is not null) as has_photo
@@ -816,7 +817,9 @@ sub display_problem_updates {
foreach (split /\n{2,}/, $text) {
$out .= '<p>' . ent($_) . '</p>';
}
- if ($row->{has_photo}) {
+ my $cobrand = get_cobrand($q);
+ my $display_photos = Cobrand::allow_photo_display($cobrand);
+ if ($display_photos && $row->{has_photo}) {
$out .= '<p><img alt="" height=100 src="/photo?tn=1;c=' . $row->{id} . '"></p>';
}
$out .= '</div>';
diff --git a/web/alert.cgi b/web/alert.cgi
index 440e0cc33..017b821c9 100755
--- a/web/alert.cgi
+++ b/web/alert.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: alert.cgi,v 1.51 2009-10-13 09:45:57 louise Exp $
+# $Id: alert.cgi,v 1.52 2009-10-20 09:14:44 louise Exp $
use strict;
use Standard;
@@ -196,7 +196,7 @@ for the county council.')));
my $checked = '';
$checked = ' checked' if $q->param('feed') && $q->param('feed') eq "local:$x:$y";
my $cobrand_form_elements = Cobrand::form_elements($cobrand, 'alerts', $q);
- my $pics = Problems::recent_photos(5, $e, $n, $dist);
+ my $pics = Cobrand::recent_photos($cobrand, 5, $e, $n, $dist);
$pics = '<div id="alert_photos">' . $q->h2(_('Photos of recent nearby reports')) . $pics . '</div>' if $pics;
my $out = $q->h1(
@@ -287,12 +287,13 @@ within a certain distance of a particular location.'));
$out .= $q->p(_('To find out what local alerts we have for you, please enter your GB
postcode or street name and area:'), '<input type="text" name="pc" value="' . $input_h{pc} . '">
<input type="submit" value="' . _('Go') . '">');
- $out .= Cobrand::form_elements(Page::get_cobrand($q), 'alerts', $q);
+ my $cobrand = Page::get_cobrand($q);
+ $out .= Cobrand::form_elements($cobrand, 'alerts', $q);
$out .= '</form>';
return $out if $q->referer() && $q->referer() =~ /fixmystreet\.com/;
-
- my $recent_photos = Problems::recent_photos(10);
+ my $cobrand = Page::get_cobrand($q);
+ my $recent_photos = Cobrand::recent_photos($cobrand, 10);
$out .= '<div id="alert_recent">' . $q->h2(_('Some photos of recent reports')) . $recent_photos . '</div>' if $recent_photos;
return $out;
}
diff --git a/web/index.cgi b/web/index.cgi
index 8dc85453c..4fce19f13 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: index.cgi,v 1.298 2009-10-19 16:27:02 louise Exp $
+# $Id: index.cgi,v 1.299 2009-10-20 09:14:44 louise Exp $
use strict;
use Standard;
@@ -985,7 +985,7 @@ EOF
$out .= ' &nbsp; <a href="'. $rss_url .'"><img src="/i/feed.png" width="16" height="16" title="' . _('RSS feed') . '" alt="' . _('RSS feed of updates to this problem') . '" border="0" style="vertical-align: middle"></a>';
$out .= '</div>';
- $out .= Page::display_problem_updates($input{id});
+ $out .= Page::display_problem_updates($input{id}, $q);
$out .= '<div id="update_form">';
$out .= $q->h2(_('Provide an update'));
$out .= $q->p($q->small(_('Please note that updates are not sent to the council. If you leave your name it will be public. Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>')))
diff --git a/web/questionnaire.cgi b/web/questionnaire.cgi
index 4b91a1ab3..ad6e4104f 100755
--- a/web/questionnaire.cgi
+++ b/web/questionnaire.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: questionnaire.cgi,v 1.42 2009-09-28 10:34:21 louise Exp $
+# $Id: questionnaire.cgi,v 1.43 2009-10-20 09:14:44 louise Exp $
use strict;
use Standard;
@@ -186,7 +186,7 @@ sub display_questionnaire {
my $pins = Page::display_pin($q, $px, $py, $problem->{state} eq 'fixed'?'green':'red');
my $problem_text = Page::display_problem_text($q, $problem);
- my $updates = Page::display_problem_updates($problem->{id});
+ my $updates = Page::display_problem_updates($problem->{id}, $q);
my $out = '';
$out .= Page::display_map($q, x => $x_tile, y => $y_tile, pins => $pins,
px => $px, py => $py, pre => $problem_text, post => $updates );