aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rwxr-xr-xweb/alert.cgi22
-rw-r--r--web/cobrands/fiksgatami/css.css63
-rwxr-xr-xweb/faq.cgi12
-rwxr-xr-xweb/index.cgi14
-rw-r--r--web/js/map-OpenStreetMap.js39
-rwxr-xr-xweb/questionnaire.cgi14
-rwxr-xr-xweb/reports.cgi3
-rwxr-xr-xweb/rss.cgi1
8 files changed, 132 insertions, 36 deletions
diff --git a/web/alert.cgi b/web/alert.cgi
index e2a4efaac..dd4676644 100755
--- a/web/alert.cgi
+++ b/web/alert.cgi
@@ -90,9 +90,6 @@ sub alert_list {
};
}
- # truncate the lat,lon for nicer urls
- ( $lat, $lon ) = map { Utils::truncate_coordinate($_) } ( $lat, $lon );
-
return FixMyStreet::Geocode::list_choices($error, '/alert', $q) if ref($error) eq 'ARRAY';
return alert_front_page($q, $error) if $error;
@@ -105,6 +102,9 @@ sub alert_list {
$pretty_pc =~ s/ / /;
}
+ # truncate the lat,lon for nicer urls
+ ( $lat, $lon ) = map { Utils::truncate_coordinate($_) } ( $lat, $lon );
+
my $errors = '';
$errors = '<ul class="error"><li>' . join('</li><li>', @errors) . '</li></ul>' if @errors;
@@ -296,9 +296,9 @@ feed, or enter your email address to subscribe to an email alert.'));
EOF
my $rss_feed;
if ($pretty_pc_text) {
- $rss_feed = Cobrand::url($cobrand, "/rss/pc/$pretty_pc_text/", $q);
+ $rss_feed = Cobrand::url($cobrand, "/rss/pc/$pretty_pc_text", $q);
} else {
- $rss_feed = Cobrand::url($cobrand, "/rss/l/$lat,$lon/", $q);
+ $rss_feed = Cobrand::url($cobrand, "/rss/l/$lat,$lon", $q);
}
my $default_link = Cobrand::url($cobrand, "/alert?type=local;feed=local:$lat:$lon", $q);
@@ -307,10 +307,10 @@ EOF
$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_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);
+ 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>)
@@ -437,8 +437,8 @@ sub alert_rss {
$url .= "?" . $extra_params if ($extra_params);
print $q->redirect($url);
return;
- } elsif ($feed =~ /^local:(\d+):(\d+)$/) {
- $url = $base_url . '/rss/n/' . $1 . ',' . $2;
+ } elsif ($feed =~ /^local:([\d\.-]+):([\d\.-]+)$/) {
+ $url = $base_url . '/rss/l/' . $1 . ',' . $2;
$url .= "?" . $extra_params if ($extra_params);
print $q->redirect($url);
return;
diff --git a/web/cobrands/fiksgatami/css.css b/web/cobrands/fiksgatami/css.css
index 8029e6698..4db2a94e6 100644
--- a/web/cobrands/fiksgatami/css.css
+++ b/web/cobrands/fiksgatami/css.css
@@ -1,3 +1,64 @@
#front_stats div {
- width: 6em;
+ width: 6.5em;
}
+
+body {
+ font-family: Helmet, Freesans, "Helvetica Neue", Arial, sans-serif;
+}
+
+a:link {
+ color: #215d93;
+}
+a:visited {
+ color: #518dc3;
+}
+a:hover, a:active {
+ color: #cc0000;
+}
+
+blockquote {
+ border-left: solid 4px #1a4f7f;
+}
+
+.a {
+ color: #000000;
+ background-color: #a9cff1;
+}
+
+#header {
+ padding: 0.1em 0.5em 0.15em;
+ border-bottom: solid 2px #1a4f7f;
+ background-color: #99bfe1;
+ color: #1a4f7f;
+}
+
+#my {
+ color: #0a3f6f;
+ background-color: #99bfe1;
+}
+
+#header a:link, #header a:visited {
+ color: #1a4f7f;
+ background-color: #99bfe1;
+}
+
+#navigation a:link, #navigation a:visited {
+ color: #1a4f7f;
+}
+#navigation a:hover, #navigation a:active {
+ background-color: #1a4f7f;
+ color: #99bfe1;
+}
+
+#footer {
+ border-top: solid 1px #1a4f7f;
+}
+
+#postcodeForm {
+ background-color: #99bfe1;
+}
+
+#front_stats div {
+ background-color: #99bfe1;
+}
+
diff --git a/web/faq.cgi b/web/faq.cgi
index 2046f6955..4d9c7413a 100755
--- a/web/faq.cgi
+++ b/web/faq.cgi
@@ -16,16 +16,8 @@ my $lastmodified = (stat $0)[9];
sub main {
my $q = shift;
print Page::header($q, title=>_('Frequently Asked Questions'));
- if ($q->{site} eq 'emptyhomes') {
- my $lang = $mySociety::Locale::lang;
- if ($lang eq 'cy') {
- print File::Slurp::read_file("$FindBin::Bin/../templates/website/faq-eha.cy.html");
- } else {
- print File::Slurp::read_file("$FindBin::Bin/../templates/website/faq-eha.html");
- }
- } else {
- print File::Slurp::read_file("$FindBin::Bin/../templates/website/faq.html");
- }
+ my $lang = $mySociety::Locale::lang;
+ print Page::template_include("faq-$lang", $q, Page::template_root($q));
print Page::footer($q);
}
Page::do_fastcgi(\&main, $lastmodified);
diff --git a/web/index.cgi b/web/index.cgi
index 7e177e0a2..8fab1d079 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -12,9 +12,9 @@ use Utils;
use Encode;
use Error qw(:try);
use File::Slurp;
-use LWP::Simple;
use RABX;
use CGI::Carp;
+use POSIX qw(strcoll);
use URI::Escape;
# use Carp::Always;
@@ -118,7 +118,7 @@ sub front_page {
my $cobrand_form_elements = Cobrand::form_elements($cobrand, 'postcodeForm', $q);
my $form_action = Cobrand::url($cobrand, '/', $q);
my $question = Cobrand::enter_postcode_text($cobrand, $q);
- $question = _("Enter a nearby GB postcode, or street name and area:")
+ $question = _("Enter a nearby GB postcode, or street name and area")
unless $question;
my %params = ('context' => 'front-page');
$params{status_code} = $status_code if $status_code;
@@ -127,7 +127,7 @@ sub front_page {
pc_h => $pc_h,
cobrand_form_elements => $cobrand_form_elements,
form_action => $form_action,
- question => $question,
+ question => "$question:",
);
my $cobrand_front_page = Page::template_include('front-page', $q, Page::template_root($q), %vars);
return ($cobrand_front_page, %params) if $cobrand_front_page;
@@ -165,7 +165,7 @@ EOF
}
my $activate = _("Go");
$out .= <<EOF;
-<label for="pc">$question</label>
+<label for="pc">$question:</label>
&nbsp;<input type="text" name="pc" value="$pc_h" id="pc" size="10" maxlength="200">
&nbsp;<input type="submit" value="$activate" id="submit">
$cobrand_form_elements
@@ -552,7 +552,7 @@ please specify the closest point on land.')) unless %$all_councils;
my $categories = select_all("select area_id, category from contacts
where deleted='f' and area_id in (" . join(',', keys %$all_councils) . ')');
if ($q->{site} ne 'emptyhomes') {
- @$categories = sort { $a->{category} cmp $b->{category} } @$categories;
+ @$categories = sort { strcoll($a->{category}, $b->{category}) } @$categories;
foreach (@$categories) {
$council_ok{$_->{area_id}} = 1;
next if $_->{category} eq _('Other');
@@ -638,7 +638,7 @@ If this is not the correct location, simply click on the map again. '));
$vars{page_heading} = $q->h1(_('Reporting a problem'));
if ($details eq 'all') {
- my $council_list = join('</strong> or <strong>', map { $_->{name} } values %$all_councils);
+ my $council_list = join('</strong>' . _(' or ') . '<strong>', map { $_->{name} } values %$all_councils);
if ($q->{site} eq 'emptyhomes'){
$vars{text_help} = '<p>' . sprintf(_('All the information you provide here will be sent to <strong>%s</strong>.
On the site, we will show the subject and details of the problem, plus your
@@ -945,7 +945,7 @@ sub display_location {
my $rss_url;
if ($pc_h) {
- $rss_url = "/rss/pc/" . URI::Escape::uri_escape($pc_h);
+ $rss_url = "/rss/pc/" . URI::Escape::uri_escape_utf8($pc_h);
} else {
$rss_url = "/rss/l/$short_lat,$short_lon";
}
diff --git a/web/js/map-OpenStreetMap.js b/web/js/map-OpenStreetMap.js
index c5aa318b0..6e350537a 100644
--- a/web/js/map-OpenStreetMap.js
+++ b/web/js/map-OpenStreetMap.js
@@ -4,7 +4,7 @@ YAHOO.util.Event.onContentReady('map', function() {
new OpenLayers.Control.ArgParser(),
//new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.Navigation(),
- new OpenLayers.Control.PanZoom()
+ new OpenLayers.Control.PanZoomFMS()
],
displayProjection: new OpenLayers.Projection("EPSG:4326")
});
@@ -50,6 +50,43 @@ YAHOO.util.Event.onContentReady('map', function() {
});
+/* Overridding the buttonDown function of PanZoom so that it does
+ zoomTo(0) rather than zoomToMaxExtent()
+*/
+OpenLayers.Control.PanZoomFMS = OpenLayers.Class(OpenLayers.Control.PanZoom, {
+ buttonDown: function (evt) {
+ if (!OpenLayers.Event.isLeftClick(evt)) {
+ return;
+ }
+
+ switch (this.action) {
+ case "panup":
+ this.map.pan(0, -this.getSlideFactor("h"));
+ break;
+ case "pandown":
+ this.map.pan(0, this.getSlideFactor("h"));
+ break;
+ case "panleft":
+ this.map.pan(-this.getSlideFactor("w"), 0);
+ break;
+ case "panright":
+ this.map.pan(this.getSlideFactor("w"), 0);
+ break;
+ case "zoomin":
+ this.map.zoomIn();
+ break;
+ case "zoomout":
+ this.map.zoomOut();
+ break;
+ case "zoomworld":
+ this.map.zoomTo(0);
+ break;
+ }
+
+ OpenLayers.Event.stop(evt);
+ }
+});
+
OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
defaultHandlerOptions: {
'single': true,
diff --git a/web/questionnaire.cgi b/web/questionnaire.cgi
index 1eb62d03e..fdb1c08a4 100755
--- a/web/questionnaire.cgi
+++ b/web/questionnaire.cgi
@@ -305,9 +305,10 @@ EOF
(please note it will not be sent to the council). For example, what was
your experience of getting the problem fixed?'));
if ($allow_photo_upload) {
- $vars{photo_input} = <<EOF;
+ my $photo = _('Photo:');
+ $vars{photo_input} = <<EOF;
<div id="fileupload_normalUI">
-<label for="form_photo">Photo:</label>
+<label for="form_photo">$photo</label>
<input type="file" name="photo" id="form_photo">
</div>
EOF
@@ -318,14 +319,17 @@ EOF
);
$vars{another_yes} = $another{yes};
$vars{another_no} = $another{no};
+ my $another_qn = _('Would you like to receive another questionnaire in 4 weeks, reminding you to check the status?');
+ my $yes = _('Yes');
+ my $no = _('No');
$vars{another_questionnaire} = <<EOF if $q->{site} ne 'emptyhomes';
<div id="another_qn">
-<p>Would you like to receive another questionnaire in 4 weeks, reminding you to check the status?</p>
+<p>$another_qn</p>
<p>
<input type="radio" name="another" id="another_yes" value="Yes"$another{yes}>
-<label for="another_yes">Yes</label>
+<label for="another_yes">$yes</label>
<input type="radio" name="another" id="another_no" value="No"$another{no}>
-<label for="another_no">No</label>
+<label for="another_no">$no</label>
</p>
</div>
EOF
diff --git a/web/reports.cgi b/web/reports.cgi
index f0ecf9c7a..784c52917 100755
--- a/web/reports.cgi
+++ b/web/reports.cgi
@@ -12,6 +12,7 @@
use strict;
use Standard;
use Encode;
+use POSIX qw(strcoll);
use URI::Escape;
use FixMyStreet::Alert;
use mySociety::MaPit;
@@ -201,7 +202,7 @@ sub main {
print '<th>' . _('Old problems,<br>state unknown') . '</th>';
}
print '<th>' . _('Recently fixed') . '</th><th>' . _('Older fixed') . '</th></tr>';
- foreach (sort { $areas_info->{$a}->{name} cmp $areas_info->{$b}->{name} } keys %$areas_info) {
+ foreach (sort { strcoll($areas_info->{$a}->{name}, $areas_info->{$b}->{name}) } keys %$areas_info) {
next if mySociety::Config::get('COUNTRY') eq 'NO' && $_ eq 301; # Only want one Oslo
print '<tr align="center"';
++$c;
diff --git a/web/rss.cgi b/web/rss.cgi
index 1ca2a1fe2..1273a2a5e 100755
--- a/web/rss.cgi
+++ b/web/rss.cgi
@@ -108,6 +108,7 @@ sub rss_local_problems {
$error = shift;
};
if ($error) {
+ print $q->redirect(-location => "$base/alert");
return '';
} else {
( $lat, $lon ) = map { Utils::truncate_coordinate($_) } ( $lat, $lon );