aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm10
-rw-r--r--templates/web/default/admin/report_edit.html7
-rw-r--r--templates/web/default/admin/update_edit.html7
-rw-r--r--web/cobrands/sass/_layout.scss42
4 files changed, 36 insertions, 30 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 64b38d99f..9c0018f38 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -770,9 +770,13 @@ sub report_edit : Path('report_edit') : Args(1) {
$problem->user( $user );
}
+ # Deal with photos
if ( $c->req->param('remove_photo') ) {
$problem->photo(undef);
}
+ if ( $new_state eq 'hidden' ) {
+ unlink glob FixMyStreet->path_to( 'web', 'photo', $problem->id . '.*' );
+ }
if ( $problem->is_visible() and $old_state eq 'unconfirmed' ) {
$problem->confirmed( \'ms_current_timestamp()' );
@@ -915,7 +919,7 @@ sub update_edit : Path('update_edit') : Args(1) {
$update->name( $c->req->param('name') || '' );
$update->text( $c->req->param('text') );
$update->anonymous( $c->req->param('anonymous') );
- $update->state( $c->req->param('state') );
+ $update->state( $new_state );
if ( $c->req->param('email') ne $update->user->email ) {
my $user =
@@ -935,6 +939,10 @@ sub update_edit : Path('update_edit') : Args(1) {
}
}
+ if ( $new_state eq 'hidden' ) {
+ unlink glob FixMyStreet->path_to( 'web', 'photo', 'c', $update->id . '.*' );
+ }
+
$update->update;
$c->stash->{status_message} = '<p><em>' . _('Updated!') . '</em></p>';
diff --git a/templates/web/default/admin/report_edit.html b/templates/web/default/admin/report_edit.html
index db9ca7317..12560fdf3 100644
--- a/templates/web/default/admin/report_edit.html
+++ b/templates/web/default/admin/report_edit.html
@@ -80,7 +80,12 @@
[% IF problem.photo %]
[% photo = problem.get_photo_params %]
-<li><img alt="" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %][% photo.url %]">
+<li><img alt="Photo of this report" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %]
+ [%~ IF problem.photo.length == 40 ~%]
+ /photo/[% problem.photo %].temp.jpeg
+ [%~ ELSE ~%]
+ [% photo.url %]
+ [%~ END %]">
<br>
<input type="submit" name="rotate_photo" value="[% loc('Rotate Left') %]">
<input type="submit" name="rotate_photo" value="[% loc('Rotate Right') %]">
diff --git a/templates/web/default/admin/update_edit.html b/templates/web/default/admin/update_edit.html
index 0f69a78fa..5ffce8bc4 100644
--- a/templates/web/default/admin/update_edit.html
+++ b/templates/web/default/admin/update_edit.html
@@ -52,7 +52,12 @@
[% IF update.photo %]
[% photo = update.get_photo_params %]
-<li><img alt="" height="[% photo.height %]" width="[% photo.width %]" src="[% photo.url %]">
+<li><img alt="Photo of this update" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %]
+ [%~ IF update.photo.length == 40 ~%]
+ /photo/[% update.photo %].temp.jpeg
+ [%~ ELSE ~%]
+ [% photo.url %]
+ [%~ END ~%]">
<input type="checkbox" id="remove_photo" name="remove_photo" value="1">
<label for="remove_photo" class="inline">[% loc("Remove photo (can't be undone!)") %]</label></li>
[% END %]
diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss
index 9ebe149cc..38b805829 100644
--- a/web/cobrands/sass/_layout.scss
+++ b/web/cobrands/sass/_layout.scss
@@ -204,9 +204,7 @@ h1 {
// The narrow single column box
.content {
width: 27em;
- margin-top: 3em;
- margin-bottom: -1em;
- margin-left: 0.5em;
+ margin: 3em 0.5em -1em;
padding: 1em 1em 3em;
background: #fff;
color: #222;
@@ -217,7 +215,7 @@ h1 {
// If no box-shadow, just want a boring black border to stand it out from the map.
border: 1px solid #666;
//take off margins so we line up properly
- margin: 0 0 0 0.5em;
+ margin: 0 0.5em;
}
}
@@ -249,8 +247,6 @@ body.mappage {
}
#user-meta {
max-width: none;
- left: 0;
- margin-left: 1em;
}
}
.ie6, .ie7 {
@@ -298,10 +294,7 @@ body.mappage {
// full width page
body.fullwidthpage {
.content {
- width: 57em;
- }
- .intro {
- width:40em;
+ width: auto;
}
}
// two thirds width page, also has option for a sidebar which can be sticky or not
@@ -534,13 +527,13 @@ body.twothirdswidthpage {
#user-meta{
display:block;
position: relative;
- max-width: 57em;
- margin:0 auto;
- left: 1em;
+ max-width: 60em;
+ margin: 0 auto;
p {
@include inline-block;
- position:absolute;
- top:1em;
+ position: absolute;
+ top: 1em;
+ left: 1em;
height:2em;
padding:0.25em 6em 0.5em 0.5em;
@include box-shadow(rgba(0, 0, 0, 0.6) 0px 0px 4px 1px);
@@ -566,11 +559,10 @@ body.twothirdswidthpage {
}
}
.ie6 #user-meta {
- width:57em; //ie6 doesn't like max-width
+ width: 60em; //ie6 doesn't like max-width
}
-
// Wraps around #key-tools box - sticks to the bottom of the screen on desktop
.shadow-wrap {
position:fixed;
@@ -798,7 +790,7 @@ textarea.form-error {
body.frontpage {
.table-cell {
.content {
- margin: 1em auto 0;
+ margin: 1em 0.5em 0;
}
}
.nav-wrapper-2{
@@ -816,8 +808,9 @@ body.frontpage {
#user-meta {
z-index:10;
p {
- top:-4em;
- right:0;
+ top: -4em;
+ left: auto;
+ right: 0;
color:$primary;
background:none;
@include box-shadow(rgba(0, 0, 0, 0) 0 0 0);
@@ -862,8 +855,8 @@ body.frontpage {
margin: 0;
padding: 1em;
#front-main-container {
- max-width: 57em;
- margin:0 auto;
+ max-width: 60em;
+ margin: 0 auto;
}
h2 {
font-style:normal;
@@ -1195,11 +1188,6 @@ $button_bg_col: #a1a1a1; // also search bar (tables)
margin: 0em -1em 0 -1em;
}
- //make fullpage auto width
- body.fullwidthpage .content {
- width: auto;
- }
-
//make twothirdswidthpage nearly as small as main
//.content: just enough to still fit the sidebar in
body.twothirdswidthpage {