aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm41
-rw-r--r--perllib/FixMyStreet/Cobrand/Southampton.pm1
-rw-r--r--templates/web/default/admin/report_edit.html5
-rw-r--r--templates/web/default/report/updates.html12
-rw-r--r--templates/web/emptyhomes/index.html6
-rw-r--r--web/i/appstore.pngbin0 -> 6680 bytes
-rw-r--r--web/js/map-OpenLayers.js6
7 files changed, 62 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index a34737844..c988b23c1 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -572,6 +572,9 @@ sub report_edit : Path('report_edit') : Args(1) {
elsif ( $c->req->param('banuser') ) {
$c->forward('ban_user');
}
+ elsif ( $c->req->param('rotate_photo') ) {
+ $c->forward('rotate_photo');
+ }
elsif ( $c->req->param('submit') ) {
$c->forward('check_token');
@@ -1161,6 +1164,31 @@ sub check_email_for_abuse : Private {
return 1;
}
+=head2 rotate_photo
+
+Rotate a photo 90 degrees left or right
+
+=cut
+
+sub rotate_photo : Private {
+ my ( $self, $c ) =@_;
+
+ my $direction = $c->req->param('rotate_photo');
+
+ return unless $direction =~ /Left/ or $direction =~ /Right/;
+
+ my $photo = _rotate_image( $c->stash->{problem}->photo, $direction =~ /Left/ ? -90 : 90 );
+
+ if ( $photo ) {
+ $c->stash->{rotated} = 1;
+ $c->stash->{problem}->photo( $photo );
+ $c->stash->{problem}->update();
+ }
+
+ return 1;
+}
+
+
=head2 check_page_allowed
Checks if the current catalyst action is in the list of allowed pages and
@@ -1207,6 +1235,19 @@ sub trim {
return $e;
}
+sub _rotate_image {
+ my ($photo, $direction) = @_;
+ use Image::Magick;
+ my $image = Image::Magick->new;
+ $image->BlobToImage($photo);
+ my $err = $image->Rotate($direction);
+ return 0 if $err;
+ my @blobs = $image->ImageToBlob();
+ undef $image;
+ return $blobs[0];
+}
+
+
=head1 AUTHOR
Struan Donald
diff --git a/perllib/FixMyStreet/Cobrand/Southampton.pm b/perllib/FixMyStreet/Cobrand/Southampton.pm
index bd461f5e2..213dd533b 100644
--- a/perllib/FixMyStreet/Cobrand/Southampton.pm
+++ b/perllib/FixMyStreet/Cobrand/Southampton.pm
@@ -64,6 +64,7 @@ sub all_councils_report {
sub disambiguate_location {
return {
+ town => 'Southampton',
centre => '50.913822,-1.400493',
span => '0.084628,0.15701',
bounds => [ '50.871508,-1.478998', '50.956136,-1.321988' ],
diff --git a/templates/web/default/admin/report_edit.html b/templates/web/default/admin/report_edit.html
index 470ad311a..79207192d 100644
--- a/templates/web/default/admin/report_edit.html
+++ b/templates/web/default/admin/report_edit.html
@@ -43,6 +43,11 @@
[% IF problem.photo %]
[% photo = problem.get_photo_params %]
<li><img alt="" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %][% photo.url %]">
+<br>
+[% IF rotated %]Photo may be cached. View image directly to check<br>[% END %]
+<input type="submit" name="rotate_photo" value="Rotate Left" />
+<input type="submit" name="rotate_photo" value="Rotate Right" />
+<br>
<input type="checkbox" id="remove_photo" name="remove_photo" value="1">
<label for="remove_photo">[% loc("Remove photo (can't be undone!)") %]</label></li>
[% END %]
diff --git a/templates/web/default/report/updates.html b/templates/web/default/report/updates.html
index 803ed197e..4fd3c75d4 100644
--- a/templates/web/default/report/updates.html
+++ b/templates/web/default/report/updates.html
@@ -18,18 +18,18 @@
[%- ", " _ tprintf(loc( 'marked as %s' ), update.meta_problem_state) IF update.problem_state %]
</em></p>
- [% IF c.cobrand.allow_update_reporting %]
- <p>
- <a rel="nofollow" class="unsuitable-problem" href="[% c.uri_for( '/contact?id=' _ update.problem_id _ ';update_id' _ update.id ) %]">[% loc('Offensive? Unsuitable? Tell us') %]</a>
- </p>
- [% END %]
-
</div>
<div class="update-text">
[% add_links( update.text ) | html_para %]
[% INCLUDE 'report/photo.html' object=update %]
+
+ [% IF c.cobrand.allow_update_reporting %]
+ <p align="right">
+ <small><a rel="nofollow" class="unsuitable-problem" href="[% c.uri_for( '/contact', { id => update.problem_id, update_id => update.id } ) %]">[% loc('Offensive? Unsuitable? Tell us') %]</a></small>
+ </p>
+ [% END %]
</div>
</div>
[% '</div>' IF loop.last %]
diff --git a/templates/web/emptyhomes/index.html b/templates/web/emptyhomes/index.html
index 0206bbff0..a4661c256 100644
--- a/templates/web/emptyhomes/index.html
+++ b/templates/web/emptyhomes/index.html
@@ -11,12 +11,12 @@ empty homes TV series <strong>The Great British Property Scandal</strong>!</p>
<p>The series will highlight the nearly two million British families who don’t
have adequate housing, and the million-odd homes lying empty across the UK.</p>
-<ul style="font-size: 125%; line-height: 2">
+<ul style="font-size: 125%;">
<li><a href="http://www.channel4.com/programmes/the-great-british-property-scandal/articles/report-an-empty">Report an empty property</a></li>
-<li><a href="http://cy.reportemptyhomes.com/">Rhoi gwybod am eiddo gwag</a></li>
+<li style="margin-bottom: 1em"><a href="http://cy.reportemptyhomes.com/">Rhoi gwybod am eiddo gwag</a></li>
-<!-- <li><strong>Download the iPhone app</strong> from the App Store.</li> -->
+<li><a href="http://itunes.apple.com/gb/app/empty-homes-spotter/id482550587?mt=8"><img src="/i/appstore.png" hspace="5" alt="" align="right">Download the iPhone app</a> from the App Store.</li>
</ul>
diff --git a/web/i/appstore.png b/web/i/appstore.png
new file mode 100644
index 000000000..3e97c3688
--- /dev/null
+++ b/web/i/appstore.png
Binary files differ
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index b911b7c71..c8bdb85df 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -308,6 +308,12 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
fixmystreet_activate_drag();
}
fixmystreet_update_pin(lonlat);
+ // check to see if markers are visible. We click the
+ // link so that it updates the text in case they go
+ // back
+ if ( ! fixmystreet.markers.getVisibility() ) {
+ $('#hide_pins_link').click();
+ }
if (fixmystreet.page == 'new') {
return;
}