diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-28 16:25:04 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-28 16:25:04 +0100 |
commit | 25edf88cf3cfae0320b3b8cefca39464f85d4a91 (patch) | |
tree | 7869c053ae741fca94d7b05f62830a826845c59e | |
parent | 85a3050d6e5e0f7f0bd9d3c827533f5d84d0b396 (diff) |
List updates on Your Reports (for #127), and a map too (#124).
-rw-r--r-- | perllib/FixMyStreet/App/Controller/My.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 2 | ||||
-rw-r--r-- | templates/web/default/my/my.html | 14 | ||||
-rw-r--r-- | web/css/core.css | 5 | ||||
-rw-r--r-- | web/css/core.scss | 5 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 6 |
7 files changed, 37 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm index 8cb807e09..74f7a6d52 100644 --- a/perllib/FixMyStreet/App/Controller/My.pm +++ b/perllib/FixMyStreet/App/Controller/My.pm @@ -25,6 +25,9 @@ sub my : Path : Args(0) { $c->detach( '/auth/redirect' ) unless $c->user; + # Even though front end doesn't yet have it, have it on this page, it's better! + FixMyStreet::Map::set_map_class( 'FMS' ); + my $pins = []; my $problems = {}; foreach my $problem ( $c->user->problems ) { @@ -39,6 +42,10 @@ sub my : Path : Args(0) { } $c->stash->{problems} = $problems; + my @updates = $c->user->comments->search( { + state => 'confirmed', + } )->all; + $c->stash->{updates} = \@updates; FixMyStreet::Map::display_map( $c, diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 864415b4c..4ea572093 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -405,7 +405,8 @@ sub uri { $uri = URI->new( $uri ); $uri->query_param( zoom => 3 ) if $uri->query_param('lat') && !$uri->query_param('zoom'); - $uri->query_param( map => $map_class ); # FIXME Only on /around, /report? + + # $uri->query_param( map => $map_class ); # FIXME Only on /around, /report? return $uri; } diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index a5a2dd9f0..c54ee8f3b 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 © Crown copyright and database right 2010. Microsoft'); + return _('Map contains Ordnance Survey data © Crown copyright and database right 2010.<br>© 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. © AND, Navteq, Ordnance Survey.'); } sub get_quadkey { diff --git a/templates/web/default/my/my.html b/templates/web/default/my/my.html index 4393316c5..08b6a6693 100644 --- a/templates/web/default/my/my.html +++ b/templates/web/default/my/my.html @@ -1,5 +1,4 @@ [% - pre_map = '<h2>' _ loc('Your latest problem') _ '</h2>'; PROCESS "maps/${map.type}.html" IF c.user.problems; INCLUDE 'header.html', title = loc('Your Reports') %] @@ -31,6 +30,17 @@ INCLUDE problem; END %] +[% FOREACH u IN updates %] + [% IF loop.first %]<h2>[% loc('Your updates') %]</h2><ul>[% END %] + <li>“[% u.text | html %]” + – <a href="[% c.uri_for( '/report', u.problem_id ) %]#update_[% u.id %]">[% u.problem.title | html %]</a>. + <em class="council_sent_info"> + [% tprintf( loc("Added %s"), prettify_epoch( u.confirmed_local.epoch, 'date' ) ) %] + </em> + </li> + [% "</ul>" IF loop.last %] +[% END %] + </div> [% INCLUDE 'footer.html' %] @@ -38,7 +48,7 @@ END %] [% BLOCK problem %] [% "<ul>" IF loop.first %] - <li><a href="[% c.uri_for( '/report', p.id ) %]">[% p.title | html %]</a> + <li><a href="[% c.uri_for( '/report', p.id ) %]">[% p.title | html %]</a>. <em class="council_sent_info"> [% IF p.whensent %] [% tprintf( loc("Reported %s to %s"), prettify_epoch( p.confirmed_local.epoch, 'date' ), p.body(c) ) %] diff --git a/web/css/core.css b/web/css/core.css index 576437251..a67c54f17 100644 --- a/web/css/core.css +++ b/web/css/core.css @@ -377,6 +377,11 @@ margin-top: 2em; } +.olControlAttribution { + bottom: 3px !important; + left: 3px; +} + @media print { #mysociety #map_box { float: none; diff --git a/web/css/core.scss b/web/css/core.scss index 246a33167..74e62f481 100644 --- a/web/css/core.scss +++ b/web/css/core.scss @@ -507,6 +507,11 @@ $map_width: 500px; } +.olControlAttribution { + bottom: 3px !important; + left: 3px; +} + // Printing, SCSS doesn't handle @media nesting @media print { diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index c3c3b994e..75bce80d3 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -1,5 +1,6 @@ function set_map_config(perm) { fixmystreet.controls = [ + new OpenLayers.Control.Attribution(), new OpenLayers.Control.ArgParser(), new OpenLayers.Control.Navigation(), perm, @@ -9,6 +10,9 @@ function set_map_config(perm) { } 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>', + initialize: function(name, options) { var url = []; options = OpenLayers.Util.extend({ @@ -18,7 +22,7 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { transitionEffect: "resize", sphericalMercator: true, buffer: 0, - attribution: "© Microsoft / OS 2010" + //attribution: "© Microsoft / OS 2010" }, options); var newArguments = [name, url, options]; OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArguments); |