aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM/StreetView.pm1
-rw-r--r--perllib/FixMyStreet/TestMech.pm2
-rw-r--r--t/app/controller/report_display.t10
-rw-r--r--t/app/controller/report_updates.t22
-rw-r--r--templates/web/barnet/header.html5
-rw-r--r--templates/web/default/maps/openlayers.html6
-rw-r--r--templates/web/default/report/display.html16
-rw-r--r--templates/web/default/report/new/fill_in_details_form.html7
-rw-r--r--templates/web/fiksgatami/header.html7
-rw-r--r--templates/web/lichfielddc/header.html5
-rw-r--r--templates/web/southampton/header.html5
-rw-r--r--web/css/_main.scss8
-rw-r--r--web/css/core.scss113
-rw-r--r--web/js/map-OpenLayers.js2
-rw-r--r--web/js/map-bing-ol.js30
-rw-r--r--web/js/map-streetview.js2
17 files changed, 197 insertions, 46 deletions
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index 2e40bfde3..d5edac763 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -21,7 +21,7 @@ sub map_template {
}
sub copyright {
- return _('Map contains Ordnance Survey data &copy; Crown copyright and database right 2010.<br>&copy; 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. &copy; AND, Navteq, Ordnance Survey.');
+ return '';
}
sub get_quadkey {
diff --git a/perllib/FixMyStreet/Map/OSM/StreetView.pm b/perllib/FixMyStreet/Map/OSM/StreetView.pm
index 141c2e328..8fe4744a4 100644
--- a/perllib/FixMyStreet/Map/OSM/StreetView.pm
+++ b/perllib/FixMyStreet/Map/OSM/StreetView.pm
@@ -24,7 +24,6 @@ sub base_tile_url {
}
sub copyright {
- return _('Map contains Ordnance Survey data &copy; Crown copyright and database right 2010.');
}
1;
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index 1391254b6..185b59daa 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -364,7 +364,7 @@ sub extract_problem_banner {
my $mech = shift;
my $result = scraper {
- process 'div#side > p', id => '@id', text => 'TEXT';
+ process 'div#side > p.banner', id => '@id', text => 'TEXT';
}
->scrape( $mech->response );
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t
index a70d5b9e9..c7455a99b 100644
--- a/t/app/controller/report_display.t
+++ b/t/app/controller/report_display.t
@@ -193,8 +193,8 @@ for my $test (
description => 'new report',
date => DateTime->now,
state => 'confirmed',
- banner_id => '',
- banner_text => '',
+ banner_id => undef,
+ banner_text => undef,
fixed => 0
},
{
@@ -293,8 +293,10 @@ for my $test (
$mech->get_ok("/report/$report_id");
is $mech->uri->path, "/report/$report_id", "at /report/$report_id";
my $banner = $mech->extract_problem_banner;
- $banner->{text} =~ s/^ //g;
- $banner->{text} =~ s/ $//g;
+ if ( $banner->{text} ) {
+ $banner->{text} =~ s/^ //g;
+ $banner->{text} =~ s/ $//g;
+ }
is $banner->{id}, $test->{banner_id}, 'banner id';
is $banner->{text}, $test->{banner_text}, 'banner text';
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index 4469d4003..5719b13e3 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -749,8 +749,8 @@ for my $test (
changed => {
update => 'Update from a registered user'
},
- initial_banner => '',
- endstate_banner => '',
+ initial_banner => undef,
+ endstate_banner => undef,
alert => 0,
anonymous => 0,
},
@@ -775,8 +775,8 @@ for my $test (
changed => {
update => 'Update from a registered user'
},
- initial_banner => '',
- endstate_banner => '',
+ initial_banner => undef,
+ endstate_banner => undef,
alert => 0,
anonymous => 1,
},
@@ -800,8 +800,8 @@ for my $test (
changed => {
update => 'Update from a registered user'
},
- initial_banner => '',
- endstate_banner => '',
+ initial_banner => undef,
+ endstate_banner => undef,
alert => 1,
anonymous => 0,
},
@@ -825,7 +825,7 @@ for my $test (
changed => {
update => 'Update from a registered user'
},
- initial_banner => '',
+ initial_banner => undef,
endstate_banner => ' This problem has been fixed. ',
alert => 1,
anonymous => 0,
@@ -926,7 +926,7 @@ foreach my $test (
fixed => 1,
},
changed => { update => 'Update from owner' },
- initial_banner => '',
+ initial_banner => undef,
initial_state => 'confirmed',
alert => 1, # we signed up for alerts before, do not unsign us
anonymous => 0,
@@ -981,7 +981,7 @@ foreach my $test (
fixed => 1,
},
changed => { update => 'Update from owner' },
- initial_banner => '',
+ initial_banner => undef,
initial_state => 'confirmed',
alert => 1, # we signed up for alerts before, do not unsign us
anonymous => 0,
@@ -1098,7 +1098,7 @@ for my $test (
fixed => 1,
},
changed => { update => 'Update from owner' },
- initial_banner => '',
+ initial_banner => undef,
alert => 1, # we signed up for alerts before, do not unsign us
anonymous => 0,
answered => 0,
@@ -1119,7 +1119,7 @@ for my $test (
fixed => 1,
},
changed => { update => 'Update from owner' },
- initial_banner => '',
+ initial_banner => undef,
alert => 1, # we signed up for alerts before, do not unsign us
anonymous => 0,
answered => 1,
diff --git a/templates/web/barnet/header.html b/templates/web/barnet/header.html
index 8270154ab..654e3d83c 100644
--- a/templates/web/barnet/header.html
+++ b/templates/web/barnet/header.html
@@ -1,5 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="[% lang_code %]">
+<!--[if lt IE 7]><html class="ie6 oldie" lang="[% lang_code %]"><![endif]-->
+<!--[if IE 7]> <html class="ie7 oldie" lang="[% lang_code %]"><![endif]-->
+<!--[if IE 8]> <html class="ie8 oldie" lang="[% lang_code %]"><![endif]-->
+<!--[if gt IE 8]><!--><html lang="[% lang_code %]"><!--<![endif]-->
<head>
<link rel="stylesheet" type="text/css" href="/cobrands/barnet/css/basic.css">
diff --git a/templates/web/default/maps/openlayers.html b/templates/web/default/maps/openlayers.html
index 3cf615306..41e1c40d6 100644
--- a/templates/web/default/maps/openlayers.html
+++ b/templates/web/default/maps/openlayers.html
@@ -47,9 +47,9 @@ var fixmystreet = {
<div id="pins">[% FOR pin IN map.pins %][% INCLUDE pin %][% END %]</div>
[% INCLUDE compass %]
</noscript></div>
- <p id="copyright">
- [% map.copyright %]
- </p>
+ [% IF map.copyright %]
+ <p id="copyright">[% map.copyright %]</p>
+ [% END %]
[% BLOCK compass %]
diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html
index ae0404df8..aeff140fe 100644
--- a/templates/web/default/report/display.html
+++ b/templates/web/default/report/display.html
@@ -10,17 +10,10 @@
[% map_html %]
-[% IF c.cobrand.country == 'GB' %]
-<p id='sub_map_links'>
- <a href="http://maps.google.co.uk/maps?output=embed&amp;z=16&amp;q=
- [%- problem.title _ ' - ' _ c.cobrand.base_url_for_emails _ '/report/' _ problem.id | uri -%]
-@[% short_latitude %],[% short_longitude %]">View on Google Maps</a></p>
-[% END %]
-
</div>
<div id="side">
-[% IF banner %]
+[% IF banner.id %]
<p class="banner" id="[% banner.id %]">
[% banner.text %]
</p>
@@ -156,6 +149,8 @@
<input type="password" name="password_sign_in" id="password_sign_in" value="" size="25">
</p>
+ <div class="fieldset">
+
<p>
<input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]>
<label class="n" for="remember_me">
@@ -167,6 +162,8 @@
<input type="submit" name="submit_sign_in" value="[% loc('Post') %]">
</p>
+ </div>
+
</div>
<div id="form_sign_in_no">
@@ -180,7 +177,6 @@
<label for="password_register">[% loc('Enter a new password:') %]</label>
<input type="password" name="password_register" id="password_register" value="" size="25">
</div>
- </div>
<p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p>
@@ -188,6 +184,8 @@
<input type="submit" name="submit_register" value="[% loc('Post') %]">
</p>
+ </div>
+
</div>
</div>
diff --git a/templates/web/default/report/new/fill_in_details_form.html b/templates/web/default/report/new/fill_in_details_form.html
index 395007782..633dc0b11 100644
--- a/templates/web/default/report/new/fill_in_details_form.html
+++ b/templates/web/default/report/new/fill_in_details_form.html
@@ -137,6 +137,8 @@
<input type="password" name="password_sign_in" id="password_sign_in" value="" size="25">
</p>
+ <div class="fieldset">
+
<p>
<input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]>
<label class="n" for="remember_me">
@@ -148,6 +150,8 @@
<input type="submit" name="submit_sign_in" value="[% loc('Submit') %]">
</p>
+ </div>
+
</div>
<div id="form_sign_in_no">
@@ -161,7 +165,6 @@
<label for="password_register">[% loc('Enter a new password:') %]</label>
<input type="password" name="password_register" id="password_register" value="" size="25">
</div>
- </div>
<p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p>
@@ -169,6 +172,8 @@
<input type="submit" name="submit_register" value="[% loc('Submit') %]">
</p>
+ </div>
+
</div>
</div>
diff --git a/templates/web/fiksgatami/header.html b/templates/web/fiksgatami/header.html
index 0e78bfc43..d53f4cb58 100644
--- a/templates/web/fiksgatami/header.html
+++ b/templates/web/fiksgatami/header.html
@@ -1,5 +1,8 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="[% lang_code %]">
+<!doctype html>
+<!--[if lt IE 7]><html class="ie6 oldie" lang="[% lang_code %]"><![endif]-->
+<!--[if IE 7]> <html class="ie7 oldie" lang="[% lang_code %]"><![endif]-->
+<!--[if IE 8]> <html class="ie8 oldie" lang="[% lang_code %]"><![endif]-->
+<!--[if gt IE 8]><!--><html lang="[% lang_code %]"><!--<![endif]-->
<head>
<link rel="stylesheet" type="text/css" href="[% version('/css/core.css') %]">
diff --git a/templates/web/lichfielddc/header.html b/templates/web/lichfielddc/header.html
index e17e22b9d..863ef1c1d 100644
--- a/templates/web/lichfielddc/header.html
+++ b/templates/web/lichfielddc/header.html
@@ -1,5 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="[% lang_code %]">
+<!--[if lt IE 7]><html class="ie6 oldie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="[% lang_code %]" lang="[% lang_code %]"><![endif]-->
+<!--[if IE 7]> <html class="ie7 oldie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="[% lang_code %]" lang="[% lang_code %]"><![endif]-->
+<!--[if IE 8]> <html class="ie8 oldie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="[% lang_code %]" lang="[% lang_code %]"><![endif]-->
+<!--[if gt IE 8]><!--><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="[% lang_code %]" lang="[% lang_code %]"><!--<![endif]-->
<head>
<link rel="stylesheet" type="text/css" href="[% version('/css/core.css') %]">
diff --git a/templates/web/southampton/header.html b/templates/web/southampton/header.html
index 648027d8c..7b0f77e88 100644
--- a/templates/web/southampton/header.html
+++ b/templates/web/southampton/header.html
@@ -1,5 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!--[if lt IE 7]><html class="ie6 oldie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="[% lang_code %]" lang="[% lang_code %]"><![endif]-->
+<!--[if IE 7]> <html class="ie7 oldie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="[% lang_code %]" lang="[% lang_code %]"><![endif]-->
+<!--[if IE 8]> <html class="ie8 oldie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="[% lang_code %]" lang="[% lang_code %]"><![endif]-->
+<!--[if gt IE 8]><!--><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="[% lang_code %]" lang="[% lang_code %]"><!--<![endif]-->
<head>
<link rel="stylesheet" type="text/css" href="[% version('/css/core.css') %]">
<link rel="stylesheet" type="text/css" href="/cobrands/southampton/style.css" />
diff --git a/web/css/_main.scss b/web/css/_main.scss
index d74d70ceb..383e099a1 100644
--- a/web/css/_main.scss
+++ b/web/css/_main.scss
@@ -29,7 +29,7 @@ h2 {
select, input, textarea {
font-size: 99%;
- max-width: 99%;
+ max-width: 95%;
}
#mysociety {
@@ -214,6 +214,12 @@ select, input, textarea {
#header {
font-size: 150%;
}
+ h1 {
+ font-size: 140%;
+ }
+ h2 {
+ font-size: 130%;
+ }
#navigation {
position: static;
border-top: solid 2px $header_colour;
diff --git a/web/css/core.scss b/web/css/core.scss
index 6186f8965..895a8826b 100644
--- a/web/css/core.scss
+++ b/web/css/core.scss
@@ -88,6 +88,7 @@ $map_width: 500px;
label {
float: none;
padding-right: 0;
+ margin-top: 0;
}
#submit {
@@ -163,7 +164,7 @@ $map_width: 500px;
fieldset, .fieldset {
border: none;
- padding: 0.5em;
+ margin: 0.5em;
div {
margin-top: 2px;
clear: left;
@@ -186,8 +187,11 @@ $map_width: 500px;
cursor: hand;
}
+ /* Lots of defaults to override small screen CSS */
#questionnaire label, #alerts label {
float: none;
+ margin-top: 0;
+ display: inline;
}
.confirmed {
@@ -241,12 +245,6 @@ $map_width: 500px;
/* Drag is only present in noscript form */
#drag {
- position: absolute;
- width: $map_width;
- height: $map_width;
- right: 0;
- top: 0;
-
input, img {
position: absolute;
border: none;
@@ -538,6 +536,7 @@ $map_width: 500px;
.olControlAttribution {
bottom: 3px !important;
left: 3px;
+ color: #222222;
}
.olControlPermalink {
bottom: 3px !important;
@@ -621,6 +620,106 @@ $map_width: 500px;
margin-bottom: 1em;
}
+ fieldset, .fieldset {
+ margin: 1em;
+ }
+
+ label {
+ margin-top: 1em;
+ display: block;
+ float: none;
+ text-align: left;
+ padding-right: 0;
+ width: auto;
+ }
+ .fieldset div.checkbox, #problem_submit {
+ padding-left: 0;
+ }
+ .fieldset div.checkbox label, label.n {
+ display: inline;
+ }
+
+ #rss_list {
+ float: none;
+ width: auto;
+ }
+ #rss_buttons {
+ float: none;
+ width: auto;
+ text-align: left;
+ }
+ }
+}
+
+@media all and (max-width: 750px) {
+ $map_width: 365px;
+ #mysociety {
+ #map_box {
+ padding-left: 10px;
+ width: $map_width + 2px;
+ }
+ #map {
+ width: $map_width;
+ height: $map_width;
+ }
+ .banner {
+ margin-right: $map_width + 20px;
+ }
+ #text_map_arrow {
+ right: -18px;
+ border-width: 16px 9px;
+ }
+ }
+}
+
+@media all and (max-width: 580px) {
+ $map_width: 235px;
+ #mysociety {
+ #map_box {
+ width: $map_width + 2px;
+ }
+ #map {
+ width: $map_width;
+ height: $map_width;
+ }
+ .banner {
+ margin-right: $map_width + 20px;
+ }
+ }
+}
+
+@media all and (max-width: 320px) {
+ #mysociety {
+ #map_box {
+ padding-left: 0;
+ float: none;
+ width: 100%;
+ }
+ #map {
+ width: 99%;
+ }
+
+ .banner {
+ margin-right: 0;
+ clear: both;
+ margin-top: 1em;
+ }
+ #text_map {
+ padding: 0.25em 0.5em;
+ font-size: 100%;
+ -moz-border-radius-topleft: 0;
+ -moz-border-radius-bottomleft: 1em;
+ -moz-border-radius-bottomright: 1em;
+ -webkit-border-top-left-radius: 0;
+ -webkit-border-bottom-left-radius: 1em;
+ -webkit-border-bottom-right-radius: 1em;
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 1em;
+ border-bottom-right-radius: 1em;
+ }
+ #text_map_arrow {
+ display: none;
+ }
}
}
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index d3914a128..0f9974222 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -49,6 +49,7 @@ $(function(){
fixmystreet.drag.deactivate();
$('#side-form').hide();
$('#side').show();
+ $('#sub_map_links').show();
fixmystreet.page = 'around';
});
@@ -317,6 +318,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
});
$('#side-form').show();
$('#side').hide();
+ $('#sub_map_links').hide();
fixmystreet.page = 'new';
location.hash = 'report';
}
diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js
index 032ac1e89..391f837c6 100644
--- a/web/js/map-bing-ol.js
+++ b/web/js/map-bing-ol.js
@@ -4,14 +4,40 @@ function set_map_config(perm) {
new OpenLayers.Control.ArgParser(),
new OpenLayers.Control.Navigation(),
perm,
+ //new OpenLayers.Control.ZoomPanel()
new OpenLayers.Control.PanZoomFMS()
];
fixmystreet.map_type = OpenLayers.Layer.Bing;
}
OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
- attribution: '<a href="http://www.bing.com/maps/">' +
- '<img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>',
+ attributionTemplate: '${logo}${copyrights}',
+
+ setMap: function() {
+ OpenLayers.Layer.XYZ.prototype.setMap.apply(this, arguments);
+ this.updateAttribution();
+ this.map.events.register("moveend", this, this.updateAttribution);
+ },
+
+ updateAttribution: function() {
+ var z = this.map.getZoom() + this.zoomOffset;
+ var copyrights;
+ var logo = '';
+ if (z >= 16) {
+ copyrights = 'Contains Ordnance Survey data &copy; Crown copyright and database right 2010';
+ } else {
+ logo = '<a href="http://www.bing.com/maps/"><img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>';
+ copyrights = '&copy; 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. &copy; AND, Navteq, Ordnance Survey';
+ }
+ this.attribution = OpenLayers.String.format(this.attributionTemplate, {
+ logo: logo,
+ copyrights: copyrights
+ });
+ this.map && this.map.events.triggerEvent("changelayer", {
+ layer: this,
+ property: "attribution"
+ });
+ },
initialize: function(name, options) {
var url = [];
diff --git a/web/js/map-streetview.js b/web/js/map-streetview.js
index cfd595b95..99fdca983 100644
--- a/web/js/map-streetview.js
+++ b/web/js/map-streetview.js
@@ -44,6 +44,8 @@ OpenLayers.Util.onImageLoadError = function() {
* - <OpenLayers.Layer.XYZ>
*/
OpenLayers.Layer.StreetView = OpenLayers.Class(OpenLayers.Layer.XYZ, {
+ attribution: 'Map contains Ordnance Survey data &copy; Crown copyright and database right 2010.',
+
/**
* Constructor: OpenLayers.Layer.StreetView
*