diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FixMyStreet.pm | 31 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UKCouncils.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 2 | ||||
-rw-r--r-- | t/app/controller/admin.t | 2 | ||||
-rw-r--r-- | t/app/controller/report_new.t | 12 | ||||
-rw-r--r-- | t/app/controller/report_updates.t | 8 | ||||
-rw-r--r-- | t/app/model/problem.t | 4 | ||||
-rw-r--r-- | t/map/tilma/original.t | 14 | ||||
-rw-r--r-- | templates/web/fixmystreet/around/around_index.html | 4 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/display.html | 3 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/new/fill_in_details.html | 8 |
12 files changed, 63 insertions, 29 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index a222b950d..12b48a99b 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -23,7 +23,7 @@ FixMyStreet::App::Controller::Report::New =head1 DESCRIPTION -Create a new report, or complete a partial one . +Create a new report, or complete a partial one. =head1 PARAMETERS diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 242194e01..97b4c3c8b 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -1,5 +1,36 @@ package FixMyStreet::Cobrand::FixMyStreet; use base 'FixMyStreet::Cobrand::Default'; +# FixMyStreet should return all cobrands +sub restriction { + return {}; +} + +sub generate_problem_banner { + my ( $self, $problem ) = @_; + + my $banner = {}; + if ( $problem->is_open && time() - $problem->lastupdate_local->epoch > 8 * 7 * 24 * 60 * 60 ) + { + $banner->{id} = 'unknown'; + $banner->{text} = _('Unknown'); + } + if ($problem->is_fixed) { + $banner->{id} = 'fixed'; + $banner->{text} = _('Fixed'); + } + if ($problem->is_closed) { + $banner->{id} = 'closed'; + $banner->{text} = _('Closed'); + } + + if ( grep { $problem->state eq $_ } ( 'investigating', 'in progress', 'planned' ) ) { + $banner->{id} = 'progress'; + $banner->{text} = _('In progress'); + } + + return $banner; +} + 1; diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm index 9aaa8eca0..570c90c46 100644 --- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm +++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm @@ -1,5 +1,5 @@ package FixMyStreet::Cobrand::UKCouncils; -use base 'FixMyStreet::Cobrand::FixMyStreet'; +use base 'FixMyStreet::Cobrand::Default'; use strict; use warnings; diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm index 185b59daa..a8cbc98f2 100644 --- a/perllib/FixMyStreet/TestMech.pm +++ b/perllib/FixMyStreet/TestMech.pm @@ -224,6 +224,7 @@ sub form_errors { my $mech = shift; my $result = scraper { process 'div.form-error', 'errors[]', 'TEXT'; + process 'p.form-error', 'errors[]', 'TEXT'; } ->scrape( $mech->response ); return $result->{errors} || []; @@ -365,6 +366,7 @@ sub extract_problem_banner { my $result = scraper { process 'div#side > p.banner', id => '@id', text => 'TEXT'; + process 'div.banner > p', id => '@id', text => 'TEXT'; } ->scrape( $mech->response ); diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 0a6f09585..d8a1c24a1 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -79,6 +79,8 @@ my $alert = FixMyStreet::App->model('DB::Alert')->find_or_create( subtest 'check summary counts' => sub { my $problems = FixMyStreet::App->model('DB::Problem')->search( { state => { -in => [qw/confirmed fixed closed investigating planned/, 'in progress', 'fixed - user', 'fixed - council'] } } ); + ok $mech->host('www.fixmystreet.com'); + my $problem_count = $problems->count; $problems->update( { cobrand => '' } ); diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index 076813868..6da9afa24 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -191,7 +191,7 @@ foreach my $test ( changes => {}, errors => [ 'Please enter your email', -'Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box', +'Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below', ], }, { @@ -213,7 +213,7 @@ foreach my $test ( changes => {}, errors => [ 'Please enter your email', -'Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box', +'Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below', ], }, { @@ -360,7 +360,7 @@ foreach my $test ( "submit location" ); # click through to the report page - $mech->follow_link_ok( { text => 'skip this step', }, + $mech->follow_link_ok( { text_regex => qr/skip this step/i, }, "follow 'skip this step' link" ); $mech->submit_form_ok( @@ -473,7 +473,7 @@ subtest "test password errors for a user who is signing in as they report" => su "submit location" ); # click through to the report page - $mech->follow_link_ok( { text => 'skip this step', }, + $mech->follow_link_ok( { text => 'Skip this step', }, "follow 'skip this step' link" ); $mech->submit_form_ok( @@ -520,7 +520,7 @@ subtest "test report creation for a user who is signing in as they report" => su "submit location" ); # click through to the report page - $mech->follow_link_ok( { text => 'skip this step', }, + $mech->follow_link_ok( { text => 'Skip this step', }, "follow 'skip this step' link" ); $mech->submit_form_ok( @@ -614,7 +614,7 @@ foreach my $test ( "submit location" ); # click through to the report page - $mech->follow_link_ok( { text => 'skip this step', }, + $mech->follow_link_ok( { text => 'Skip this step', }, "follow 'skip this step' link" ); # check that the fields are correctly prefilled diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index 39cb5d6d8..99f1ba62d 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -826,7 +826,7 @@ for my $test ( update => 'Update from a registered user' }, initial_banner => undef, - endstate_banner => ' This problem has been fixed. ', + endstate_banner => 'Fixed', alert => 1, anonymous => 0, }, @@ -848,8 +848,8 @@ for my $test ( changed => { update => 'Another update from a registered user' }, - initial_banner => ' This problem has been fixed. ', - endstate_banner => ' This problem has been fixed. ', + initial_banner => 'Fixed', + endstate_banner => 'Fixed', alert => 0, anonymous => 0, }, @@ -953,7 +953,7 @@ foreach my $test ( fixed => 1, }, changed => { update => 'Update from owner' }, - initial_banner => ' This problem is in progress. ', + initial_banner => 'In progress', initial_state => 'in progress', alert => 1, # we signed up for alerts before, do not unsign us anonymous => 0, diff --git a/t/app/model/problem.t b/t/app/model/problem.t index ad42c5fdf..638e89200 100644 --- a/t/app/model/problem.t +++ b/t/app/model/problem.t @@ -56,7 +56,7 @@ for my $test ( title => 'Please enter a subject', detail => 'Please enter some details', council => 'No council selected', - name => 'Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box', + name => 'Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below', } }, { @@ -68,7 +68,7 @@ for my $test ( title => 'Please enter a subject', detail => 'Please enter some details', council => 'No council selected', - name => 'Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box', + name => 'Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below', } }, { diff --git a/t/map/tilma/original.t b/t/map/tilma/original.t index 3add7719e..04c4d578c 100644 --- a/t/map/tilma/original.t +++ b/t/map/tilma/original.t @@ -56,31 +56,31 @@ my $report = FixMyStreet::App->model('DB::Problem')->find_or_create( for my $test ( { state => 'fixed', - colour => 'green', + colour => 'yellow', }, { state => 'fixed - user', - colour => 'green', + colour => 'yellow', }, { state => 'fixed - council', - colour => 'green', + colour => 'yellow', }, { state => 'confirmed', - colour => 'red', + colour => 'yellow', }, { state => 'investigating', - colour => 'red', + colour => 'yellow', }, { state => 'planned', - colour => 'red', + colour => 'yellow', }, { state => 'in progress', - colour => 'red', + colour => 'yellow', }, ) { subtest "pin colour for state $test->{state}" => sub { diff --git a/templates/web/fixmystreet/around/around_index.html b/templates/web/fixmystreet/around/around_index.html index 95577134a..7207a7292 100644 --- a/templates/web/fixmystreet/around/around_index.html +++ b/templates/web/fixmystreet/around/around_index.html @@ -42,11 +42,11 @@ [% IF partial_token %] <p style="margin-top: 0; color: #cc0000;"> - <img align="right" src="/photo?id=[% report.id %]" hspace="5"> + <img align="right" src="/photo?id=[% partial_report.id %]" hspace="5"> [% loc("Thanks for uploading your photo. We now need to locate your problem, so please enter a nearby street name or postcode in the box below :") %] </p> [% END %] -[% INCLUDE 'footer.html' %]
\ No newline at end of file +[% INCLUDE 'footer.html' %] diff --git a/templates/web/fixmystreet/report/display.html b/templates/web/fixmystreet/report/display.html index b3cfcff6a..d9e98af71 100644 --- a/templates/web/fixmystreet/report/display.html +++ b/templates/web/fixmystreet/report/display.html @@ -15,9 +15,8 @@ [% IF banner.id %] - <!-- This text needs to change: [% banner.text %] --> <div class="banner"> - <p id="[% banner.id %]">Fixed</p> + <p id="[% banner.id %]">[% banner.text %]</p> </div> [% END %] diff --git a/templates/web/fixmystreet/report/new/fill_in_details.html b/templates/web/fixmystreet/report/new/fill_in_details.html index d4351143c..fa783ab64 100644 --- a/templates/web/fixmystreet/report/new/fill_in_details.html +++ b/templates/web/fixmystreet/report/new/fill_in_details.html @@ -1,8 +1,8 @@ [% - SET c = ''; - SET c = 'mappage' IF report.used_map; + SET class = ''; + SET class = 'mappage' IF report.used_map; PROCESS "maps/${map.type}.html" IF report.used_map; - INCLUDE 'header.html', title => loc('Reporting a problem'), bodyclass => c + INCLUDE 'header.html', title => loc('Reporting a problem'), bodyclass => class %] [% IF report.used_map %] @@ -33,4 +33,4 @@ [% PROCESS 'report/new/fill_in_details_form.html' %] </form> -[% INCLUDE 'footer.html' %]
\ No newline at end of file +[% INCLUDE 'footer.html' %] |