aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/crontab.ugly4
-rw-r--r--perllib/Page.pm4
-rw-r--r--perllib/Problems.pm7
-rwxr-xr-xweb/ajax.cgi10
-rwxr-xr-xweb/index.cgi9
-rwxr-xr-xweb/rss.cgi3
6 files changed, 23 insertions, 14 deletions
diff --git a/conf/crontab.ugly b/conf/crontab.ugly
index 69654f2a7..c446ca602 100644
--- a/conf/crontab.ugly
+++ b/conf/crontab.ugly
@@ -16,12 +16,12 @@ MAILTO=cron-!!(*= $site *)!!@mysociety.org
2 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-alerts.lock /data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/send-alerts || echo "stalled?"
0,30 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-questionnaires.lock /data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/send-questionnaires-eha || echo "stalled?"
-!!(* } elsif ($hostname eq 'tea' && !$staging) { *)!!
+!!(* } elsif ($vhost eq 'cities.fixmystreet.com') { *)!!
2,7,12,17,22,27,32,37,42,47,52,57 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock /data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/send-reports || echo "stalled?"
33 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-alerts.lock /data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/send-alerts || echo "stalled?"
5,35 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-questionnaires.lock /data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/send-questionnaires || echo "stalled?"
-!!(* } elsif (($hostname eq "cake" && !$staging) || ($staging && $vhost eq 'matthew.fixmystreet.com')) { *)!!
+!!(* } elsif (($vhost eq 'www.fixmystreet.com') || ($vhost eq 'matthew.fixmystreet.com')) { *)!!
5,10,15,20,25,30,35,40,45,50,55 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock /data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/send-reports || echo "stalled?"
0 0-8,10,11,13,14,16,17,19-23 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock /data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/send-reports || echo "stalled?"
0 9,12,15,18 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/send-reports --verbose" || echo "stalled?"
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 917fc6991..817a56761 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -444,7 +444,7 @@ EOF
}
sub prettify_epoch {
- my ($q, $s) = @_;
+ my ($q, $s, $short) = @_;
my $cobrand = get_cobrand($q);
my $cobrand_datetime = Cobrand::prettify_epoch($cobrand, $s);
return $cobrand_datetime if ($cobrand_datetime);
@@ -455,6 +455,8 @@ sub prettify_epoch {
$tt = "$tt " . _('today');
} elsif (strftime('%Y %U', @s) eq strftime('%Y %U', @t)) {
$tt = "$tt, " . strftime('%A', @s);
+ } elsif ($short) {
+ $tt = "$tt, " . strftime('%e %b %Y', @s);
} elsif (strftime('%Y', @s) eq strftime('%Y', @t)) {
$tt = "$tt, " . strftime('%A %e %B %Y', @s);
} else {
diff --git a/perllib/Problems.pm b/perllib/Problems.pm
index 788074e37..1556b7724 100644
--- a/perllib/Problems.pm
+++ b/perllib/Problems.pm
@@ -176,7 +176,9 @@ sub around_map {
$limit_clause = " limit $limit";
}
mySociety::Locale::in_gb_locale { select_all(
- "select id,title,easting,northing,state from problem
+ "select id,title,easting,northing,state,
+ extract(epoch from confirmed) as time
+ from problem
where state in ('confirmed', 'fixed')
and easting>=? and easting<? and northing>=? and northing<? " .
($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') .
@@ -189,7 +191,8 @@ sub around_map {
sub nearby {
my ($dist, $ids, $limit, $mid_e, $mid_n, $interval) = @_;
mySociety::Locale::in_gb_locale { select_all(
- "select id, title, easting, northing, distance, state
+ "select id, title, easting, northing, distance, state,
+ extract(epoch from confirmed) as time
from problem_find_nearby(?, ?, $dist) as nearby, problem
where nearby.problem_id = problem.id " .
($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') .
diff --git a/web/ajax.cgi b/web/ajax.cgi
index fa722f02e..69c389765 100755
--- a/web/ajax.cgi
+++ b/web/ajax.cgi
@@ -50,8 +50,8 @@ sub main {
all_pins => undef,
no_pins => undef), $q);
$list .= '<li><a href="' . $link . '">';
- $list .= ent($_->{title});
- $list .= '</a>';
+ $list .= ent($_->{title}) . '</a> <small>(';
+ $list .= Page::prettify_epoch($q, $_->{time}, 1) . ')</small>';
$list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$list .= '</li>';
}
@@ -59,6 +59,7 @@ sub main {
$list = '';
foreach (@$around_map) {
+ my $dist = int($_->{distance}/100+.5)/10;
$link = Cobrand::url($cobrand, NewURL($q, -retain => 1,
-url => '/report/' . $_->{id},
pc => undef,
@@ -69,8 +70,9 @@ sub main {
all_pins => undef,
no_pins => undef), $q);
$list .= '<li><a href="' . $link . '">';
- $list .= ent($_->{title}) . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>';
- $list .= '</a>';
+ $list .= ent($_->{title}) . '</a> <small>(';
+ $list .= Page::prettify_epoch($q, $_->{time}, 1) . ', ';
+ $list .= $dist . 'km)</small>';
$list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$list .= '</li>';
}
diff --git a/web/index.cgi b/web/index.cgi
index 83b3b421c..e503f50ba 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -820,8 +820,8 @@ sub display_location {
my $report_url = NewURL($q, -retain => 1, -url => '/report/' . $_->{id}, pc => undef, x => undef, 'y' => undef);
$report_url = Cobrand::url($cobrand, $report_url, $q);
$on_list .= '<li><a href="' . $report_url . '">';
- $on_list .= ent($_->{title});
- $on_list .= '</a>';
+ $on_list .= ent($_->{title}) . '</a> <small>(';
+ $on_list .= Page::prettify_epoch($q, $_->{time}, 1) . ')</small>';
$on_list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$on_list .= '</li>';
}
@@ -834,8 +834,9 @@ sub display_location {
$around_list .= '<li><a href="' . $report_url . '">';
my $dist = int($_->{distance}/100+0.5);
$dist = $dist / 10;
- $around_list .= ent($_->{title}) . ' <small>(' . $dist . 'km)</small>';
- $around_list .= '</a>';
+ $around_list .= ent($_->{title}) . '</a> <small>(';
+ $around_list .= Page::prettify_epoch($q, $_->{time}, 1) . ', ';
+ $around_list .= $dist . 'km)</small>';
$around_list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$around_list .= '</li>';
push @pins, [ $_->{easting}, $_->{northing}, $_->{state} eq 'fixed' ? 'green' : 'red' ];
diff --git a/web/rss.cgi b/web/rss.cgi
index a716d93e9..8885af249 100755
--- a/web/rss.cgi
+++ b/web/rss.cgi
@@ -76,7 +76,8 @@ sub rss_local_problems {
$state = 'all' unless $state =~ /^(all|open|fixed)$/;
# state is getting lost in the redirects. Add it on to the end as a query
- my $state_qs = "?state=$state" unless $state eq 'all';
+ my $state_qs = '';
+ $state_qs = "?state=$state" unless $state eq 'all';
$state = 'confirmed' if $state eq 'open';