diff options
-rw-r--r-- | Makefile.PL | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Alert.pm | 2 | ||||
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 13 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UK.pm | 2 | ||||
-rw-r--r-- | perllib/Open311.pm | 2 | ||||
-rw-r--r-- | perllib/Utils.pm | 1 | ||||
-rw-r--r-- | t/app/controller/alert.t | 2 | ||||
-rw-r--r-- | t/app/controller/alert_new.t | 2 | ||||
-rw-r--r-- | templates/web/fixmybarangay/footer.html | 2 | ||||
-rw-r--r-- | templates/web/fixmybarangay/report/_message_manager.html | 1 | ||||
-rw-r--r-- | web/cobrands/fixmybarangay/layout.scss | 5 | ||||
-rw-r--r-- | web/cobrands/fixmybarangay/message_manager.scss | 6 |
13 files changed, 34 insertions, 8 deletions
diff --git a/Makefile.PL b/Makefile.PL index aba781785..92f08e405 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -49,6 +49,8 @@ test_requires 'Test::More' => '0.88'; test_requires 'Test::WWW::Mechanize::Catalyst'; test_requires 'Sub::Override'; +tests 't/*.t t/*/*.t t/*/*/*.t t/*/*/*/*.t t/*/*/*/*/*.t'; + catalyst; install_script glob('script/*.pl'); diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm index 4e5319a59..91ea61fbc 100644 --- a/perllib/FixMyStreet/App/Controller/Alert.pm +++ b/perllib/FixMyStreet/App/Controller/Alert.pm @@ -438,7 +438,7 @@ sub determine_location : Private { $c->detach('choose'); } - $c->go('index') if $c->stash->{location_error}; + $c->go('index'); } # truncate the lat,lon for nicer urls diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index fe4b652ed..baaa3b927 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -106,10 +106,19 @@ sub local_problems_pc_distance : Path('pc') : Args(2) { } -sub local_problems : LocalRegex('^(n|l)/([\d.-]+)[,/]([\d.-]+)(?:/(\d+))?$') { +sub local_problems_dist : LocalRegex('^(n|l)/([\d.-]+)[,/]([\d.-]+)/(\d+)$') { my ( $self, $c ) = @_; + $c->forward( 'local_problems', $c->req->captures ); +} + +sub local_problems_no_dist : LocalRegex('^(n|l)/([\d.-]+)[,/]([\d.-]+)$') { + my ( $self, $c ) = @_; + $c->forward( 'local_problems', $c->req->captures ); +} + +sub local_problems : Private { + my ( $self, $c, $type, $a, $b, $d ) = @_; - my ( $type, $a, $b, $d) = @{ $c->req->captures }; $c->forward( 'get_query_parameters', [ $d ] ); $c->detach( 'redirect_lat_lon', [ $a, $b ] ) diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index b9a893778..a6c9c6fba 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -697,7 +697,7 @@ If set to an arrayref, will plot those area ID(s) from mapit on all the /around =cut -sub areas_on_around {} +sub areas_on_around { []; } sub process_extras {} diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm index dfdce641e..58da5166c 100644 --- a/perllib/FixMyStreet/Cobrand/UK.pm +++ b/perllib/FixMyStreet/Cobrand/UK.pm @@ -45,7 +45,7 @@ sub process_extras { my $extra = shift; my $fields = shift || []; - if ( $area_id == 2482 ) { + if ( $area_id eq '2482' ) { my @fields = ( 'fms_extra_title', @$fields ); for my $field ( @fields ) { my $value = $ctx->request->param( $field ); diff --git a/perllib/Open311.pm b/perllib/Open311.pm index ef430d628..603eae777 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -419,7 +419,7 @@ sub _get_xml_object { my $obj; eval { - $obj = $simple ->XMLin( $xml ); + $obj = $simple ->parse_string( $xml ); }; return $obj; diff --git a/perllib/Utils.pm b/perllib/Utils.pm index 09c7386b4..ab7bc6e12 100644 --- a/perllib/Utils.pm +++ b/perllib/Utils.pm @@ -241,6 +241,7 @@ sub cleanup_text { sub prettify_epoch { my ( $epoch, $type ) = @_; + $type ||= ''; $type = 'short' if $type eq '1'; my $dt = DateTime->from_epoch( epoch => $epoch, time_zone => 'local' ); diff --git a/t/app/controller/alert.t b/t/app/controller/alert.t index e1ebbecb6..3d95bef6d 100644 --- a/t/app/controller/alert.t +++ b/t/app/controller/alert.t @@ -40,7 +40,7 @@ $mech->get_ok('/alert/list?pc=High Street'); $mech->content_contains('We found more than one match for that location'); $mech->get_ok('/alert/list?pc='); -$mech->content_contains('hat location does not appear to be covered by a council'); +$mech->content_contains('To find out what local alerts we have for you'); $mech->get_ok('/alert/list?pc=GL502PR'); $mech->content_contains('Problems within the boundary of'); diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t index c89f37028..c849b9485 100644 --- a/t/app/controller/alert_new.t +++ b/t/app/controller/alert_new.t @@ -330,7 +330,7 @@ subtest "Test two-tier council alerts" => sub { feed => $alert->{feed}, } } ); - is $mech->uri->path, $alert->{result}; + is $mech->uri->path, $alert->{result}, 'Redirected to right RSS feed'; } }; diff --git a/templates/web/fixmybarangay/footer.html b/templates/web/fixmybarangay/footer.html index 658d654c4..786285942 100644 --- a/templates/web/fixmybarangay/footer.html +++ b/templates/web/fixmybarangay/footer.html @@ -12,6 +12,8 @@ </ul> <ul id="main-menu"> + <li><a href="/around?latitude=10.322;longitude=123.907" class="fmb-bgy-btn">Luz</a></li> + <li><a href="/around?latitude=10.288;longitude=123.870" class="fmb-bgy-btn">BSN</a></li> <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn" >View problems</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[% %]<li><[% IF c.req.uri.path == '/reports' %]span[% ELSE %]a href="/reports"[% END diff --git a/templates/web/fixmybarangay/report/_message_manager.html b/templates/web/fixmybarangay/report/_message_manager.html index 721eda33e..e5b99bf3a 100644 --- a/templates/web/fixmybarangay/report/_message_manager.html +++ b/templates/web/fixmybarangay/report/_message_manager.html @@ -6,6 +6,7 @@ <ul id="message_manager" class="issue-list-a tab" style="display: none"> <li id="message-control"> + <a id="mm-link-to-admin" href="[% c.config.MESSAGE_MANAGER_URL %]">[admin]</a> <div id="mm-username-container">username: <span id="mm-received-username"></span></div> <div id="mm-status-message-container"> <div id="mm-status-message"></div> diff --git a/web/cobrands/fixmybarangay/layout.scss b/web/cobrands/fixmybarangay/layout.scss index 0f575806a..ccbf00748 100644 --- a/web/cobrands/fixmybarangay/layout.scss +++ b/web/cobrands/fixmybarangay/layout.scss @@ -101,7 +101,12 @@ body #main-nav ul#main-menu li span background-image: none; margin: 0; } + + &.fmb-bgy-btn { + color: #fcc921; + } + &:hover{ background-color: rgba(0,0,0,0.75); background-image: none; diff --git a/web/cobrands/fixmybarangay/message_manager.scss b/web/cobrands/fixmybarangay/message_manager.scss index 6ade1fb52..66db65bfd 100644 --- a/web/cobrands/fixmybarangay/message_manager.scss +++ b/web/cobrands/fixmybarangay/message_manager.scss @@ -158,3 +158,9 @@ $weak_text_color: #666; display: none; } } +a#mm-link-to-admin { + display:block; + float:right; + font-size:80%; + padding:4px 8px 4px 0; +} |