aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-02-29 09:25:20 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-02-29 09:25:20 +0000
commitd69defaee6e4a3d594737a42ea7390034fe0dbfb (patch)
treeb8c68befd7f8278b5b8bd530d4bfc65eae57b575
parent108e3c53e8fc6a9e2a9d9c1151647f049225ed96 (diff)
parentcecb11c2a73f7f86fc27914bcaee80e0454802c2 (diff)
Merge remote branch 'github/supercool' into supercool
Conflicts: web/cobrands/fixmystreet/base.scss web/js/map-OpenLayers.js
-rwxr-xr-xtemplates/web/fixmystreet/around/display_location.html5
-rw-r--r--web/cobrands/fixmystreet/base.scss94
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js16
-rw-r--r--web/cobrands/fixmystreet/images/sprite.pngbin139196 -> 138129 bytes
-rw-r--r--web/cobrands/fixmystreet/layout.scss20
-rw-r--r--web/js/map-bing-ol.js2
6 files changed, 131 insertions, 6 deletions
diff --git a/templates/web/fixmystreet/around/display_location.html b/templates/web/fixmystreet/around/display_location.html
index db0a2d4c0..f955386e2 100755
--- a/templates/web/fixmystreet/around/display_location.html
+++ b/templates/web/fixmystreet/around/display_location.html
@@ -54,11 +54,10 @@
<a id='hide_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => 1 } ) %]'>[% loc('Hide pins') %]</a>
[% END %]
[% IF c.cobrand.country == 'GB' || c.cobrand.country == 'NO' %]
- |
[% IF c.req.params.all_pins %]
- <a id='all_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => undef, all_pins => undef } ) %]'>[% loc('Hide stale reports') %]</a>
+ <a id='all_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => undef, all_pins => undef } ) %]'>[% loc('Hide old reports') %]</a>
[% ELSE %]
- <a id='all_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => undef, all_pins => 1 } ) %]'>[% loc('Include stale reports') %]</a>
+ <a id='all_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => undef, all_pins => 1 } ) %]'>[% loc('Include old reports') %]</a>
[% END %]
[% END %]
</p>
diff --git a/web/cobrands/fixmystreet/base.scss b/web/cobrands/fixmystreet/base.scss
index 3ef5b4546..46f5dfa4f 100644
--- a/web/cobrands/fixmystreet/base.scss
+++ b/web/cobrands/fixmystreet/base.scss
@@ -894,18 +894,110 @@ a:hover.button-left {
}
}
+// map stuff
#map_box{
+ @extend .full-width;
background: #333;
height: 10em;
- @extend .full-width;
margin-bottom: 1em;
overflow: hidden;
+ position: relative;
#map {
width:100%;
height:100%;
}
}
+// OpenLayers fix for navigation being top right
+.olControlPanZoom {
+ width:48px;
+ right: 1em !important;
+ top: 1em !important;
+ left: auto !important;
+}
+
+// Openlayers map controls (overrides)
+#OpenLayers\.Control\.PanZoom_6_panup,
+#OpenLayers\.Control\.PanZoom_6_pandown,
+#OpenLayers\.Control\.PanZoom_6_panleft,
+#OpenLayers\.Control\.PanZoom_6_panright,
+#OpenLayers\.Control\.PanZoom_6_zoomin,
+#OpenLayers\.Control\.PanZoom_6_zoomout {
+ text-indent:-999999px;
+ background:url(images/sprite.png) no-repeat;
+}
+#OpenLayers\.Control\.PanZoom_6_zoomworld {
+ display:none !important;
+ visibility:none !important;
+}
+
+#OpenLayers\.Control\.PanZoom_6_panup {
+ background-position:-25px -218px;
+ left:15px !important;
+ top:0 !important;
+}
+#OpenLayers\.Control\.PanZoom_6_pandown {
+ background-position:-25px -248px;
+ left:15px !important;
+ top:36px !important;
+}
+#OpenLayers\.Control\.PanZoom_6_panleft {
+ background-position:-10px -233px;
+ width:24px !important;
+ left:0px !important;
+ top:18px !important;
+}
+#OpenLayers\.Control\.PanZoom_6_panright {
+ background-position:-34px -233px;
+ width:24px !important;
+ left:24px !important;
+ top:18px !important;
+}
+#OpenLayers\.Control\.PanZoom_6_zoomin {
+ background-position:-25px -280px;
+ height:22px !important;
+ left:15px !important;
+ top:70px !important;
+}
+#OpenLayers\.Control\.PanZoom_6_zoomout {
+ background-position:-25px -298px;
+ height:22px !important;
+ left:15px !important;
+ top:92px !important;
+}
+
+//hide pins, show old reports etc
+#sub_map_links {
+ position: absolute;
+ left: 0;
+ right:0;
+ bottom: 0;
+ z-index: 1000;
+ background:#333;
+ margin:0;
+ a {
+ @include inline-block;
+ font-size:0.6875em;
+ color:#fff;
+ padding:0.6em 3em 0.5em 1em;
+ background:url(images/sprite.png) right -4066px no-repeat;
+ &#hide_pins_link {
+ background-position:right -3976px;
+ }
+ &#all_pins_link {
+ background-position:right -4022px;
+ }
+ &#map_permalink {
+ background-position:right -4070px;
+ }
+ }
+}
+
+//copyright attribution
+#OpenLayers\.Control\.Attribution_3 {
+ bottom:2em !important;
+}
+
/* Drag is only present in noscript form. XXX Copy from core. */
#drag {
input, img {
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index fa46656e9..9c390b1da 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -327,4 +327,18 @@ $(function(){
});
// $('.mobile .nicetable tr.heading > td.title').css({'min-width':'300px'});
// $('.mobile .nicetable tr > td.data').css({'max-width':'12%'});
-});
+
+ /*
+ * Map controls prettiness
+ */
+ //add links container (if its not there)
+ if($('#sub_map_links').length === 0){
+ $('<p id="sub_map_links" />').insertAfter($('#map'));
+ }
+
+ //add permalink
+ $('#sub_map_links').append('<a href="#" id="map_permalink">Permalink</a>');
+
+ //open/close toggle button on desk
+ $('#sub_map_links').prepend('<span id="map_links_toggle">&nbsp;</span>');
+}); \ No newline at end of file
diff --git a/web/cobrands/fixmystreet/images/sprite.png b/web/cobrands/fixmystreet/images/sprite.png
index a27fc9d84..aff028314 100644
--- a/web/cobrands/fixmystreet/images/sprite.png
+++ b/web/cobrands/fixmystreet/images/sprite.png
Binary files differ
diff --git a/web/cobrands/fixmystreet/layout.scss b/web/cobrands/fixmystreet/layout.scss
index 685ced34f..139540ac7 100644
--- a/web/cobrands/fixmystreet/layout.scss
+++ b/web/cobrands/fixmystreet/layout.scss
@@ -440,6 +440,26 @@ body.twothirdswidthpage {
z-index:1;
}
+// Pull OpenLayers navigation down a bit
+.olControlPanZoom {
+ top: 5em !important;
+}
+
+#sub_map_links {
+ left:auto;
+ bottom:auto;
+ top:14em;
+ #map_links_toggle {
+ display:block;
+ position:absolute;
+ left:-1em;
+ background:#000;
+ width:1em;
+ height:100%;
+ @include border-radius(0.25em 0 0 0.25em);
+ }
+}
+
// log in bit, pokes above the .content div
#user-meta{
display:block;
diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js
index 4d01563a3..2786f63cf 100644
--- a/web/js/map-bing-ol.js
+++ b/web/js/map-bing-ol.js
@@ -9,7 +9,7 @@ function set_map_config(perm) {
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.ArgParser(),
new OpenLayers.Control.Navigation({ zoomWheelEnabled: false }),
- new OpenLayers.Control.Permalink(),
+ new OpenLayers.Control.Permalink('map_permalink'),
new OpenLayers.Control.PanZoomFMS()
];
}