diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FixMyStreet.pm | 11 |
4 files changed, 25 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 788e57be0..3d3ddce1e 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -189,11 +189,14 @@ sub report_form_ajax : Path('ajax') : Args(0) { ? $c->render_fragment('report/new/extra_name.html') : ''; + my $extra_titles_list = $c->cobrand->title_list($c->stash->{all_areas}); + my $body = JSON->new->utf8(1)->encode( { councils_text => $councils_text, category => $category, extra_name_info => $extra_name_info, + titles_list => $extra_titles_list, categories => $c->stash->{category_options}, } ); diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index 3c7580eb1..f648225ae 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -97,6 +97,9 @@ sub tweak_all_reports_map { } } +sub title_list { + return ["MR", "MISS", "MRS", "MS", "DR"]; +} 1; diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index a745088a6..38efb7a35 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -691,6 +691,14 @@ sub example_places { return $e; } +=head2 title_list + +Returns an arrayref of possible titles for a person to send to the mobile app. + +=cut + +sub title_list { return undef; } + =head2 only_authed_can_create If true, only users with the from_body flag set are able to create reports. diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 04c137674..aa2be4a0f 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -1,6 +1,8 @@ package FixMyStreet::Cobrand::FixMyStreet; use base 'FixMyStreet::Cobrand::UK'; +use constant COUNCIL_ID_BROMLEY => 2482; + # FixMyStreet should return all cobrands sub restriction { return {}; @@ -10,5 +12,14 @@ sub admin_base_url { return 'https://secure.mysociety.org/admin/bci/'; } +sub title_list { + my $self = shift; + my $areas = shift; + my $first_area = ( values %$areas )[0]; + + return ["MR", "MISS", "MRS", "MS", "DR"] if $first_area->{id} eq COUNCIL_ID_BROMLEY; + return undef; +} + 1; |