diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 10 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FixMyBarangay.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Oxfordshire.pm | 2 | ||||
-rw-r--r-- | templates/web/default/report/new/fill_in_details_form.html | 2 | ||||
-rw-r--r-- | templates/web/default/report/update-form.html | 2 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/new/fill_in_details_form.html | 14 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/update-form.html | 2 |
7 files changed, 24 insertions, 15 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 86ea693b7..efa455637 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -740,5 +740,15 @@ until the contacts/area/body handling is rewritten to be better. sub reports_by_body { 0; } +=head2 default_show_name + +Returns true if the show name checkbox should be ticked by default. + +=cut + +sub default_show_name { + 1; +} + 1; diff --git a/perllib/FixMyStreet/Cobrand/FixMyBarangay.pm b/perllib/FixMyStreet/Cobrand/FixMyBarangay.pm index c53b8e971..8ccbb57f5 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyBarangay.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyBarangay.pm @@ -43,5 +43,12 @@ sub can_support_problems { sub reports_by_body { 1 } +sub default_show_name { + my $self = shift; + + return 0 if $self->{c}->user->from_council; + return 1; +} + 1; diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm index 578dfa53c..745123fdb 100644 --- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm +++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm @@ -59,5 +59,7 @@ sub base_url_for_report { } } +sub default_show_name { 0 } + 1; diff --git a/templates/web/default/report/new/fill_in_details_form.html b/templates/web/default/report/new/fill_in_details_form.html index 9c9451914..0befb344e 100644 --- a/templates/web/default/report/new/fill_in_details_form.html +++ b/templates/web/default/report/new/fill_in_details_form.html @@ -206,7 +206,7 @@ <div class="checkbox"> [%# if there is nothing in the name field then set check box as default on form %] - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF !report.anonymous %]> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %]> <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> <br><small>[% loc('(we never show your email address or phone number)') %]</small> </div> diff --git a/templates/web/default/report/update-form.html b/templates/web/default/report/update-form.html index 721e6d4b5..7e39f79b7 100644 --- a/templates/web/default/report/update-form.html +++ b/templates/web/default/report/update-form.html @@ -151,7 +151,7 @@ </div> <div class="checkbox"> - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' UNLESS update.anonymous %]> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF update.anonymous==0 OR (c.cobrand.default_show_name AND update.anonymous=='') %]> <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> <small>[% loc('(we never show your email)') %]</small> </div> diff --git a/templates/web/fixmystreet/report/new/fill_in_details_form.html b/templates/web/fixmystreet/report/new/fill_in_details_form.html index 82f9b0da5..fb342d487 100644 --- a/templates/web/fixmystreet/report/new/fill_in_details_form.html +++ b/templates/web/fixmystreet/report/new/fill_in_details_form.html @@ -125,17 +125,7 @@ [%# if there is nothing in the name field then set check box as default on form %] <div class="checkbox-group"> - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" - [% IF c.cobrand.moniker == 'fixmybarangay' && c.user.from_council %] - [%# - FMB staff reports are anonymous by default; so may_show_name is checked only if explicitly set to 0. - If the user has not set it (that is, it is null) TemplateToolkit sees an empty string. - %] - [% 'checked' IF report.anonymous==0 %] - [% ELSE %] - [% 'checked' IF !report.anonymous %] - [% END %] - > + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %]> <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %] </label> </div> @@ -203,7 +193,7 @@ [%# if there is nothing in the name field then set check box as default on form %] <div class="checkbox-group"> - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF !report.anonymous %]> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %]> <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label> </div> diff --git a/templates/web/fixmystreet/report/update-form.html b/templates/web/fixmystreet/report/update-form.html index c08ac4d52..14efdb51b 100644 --- a/templates/web/fixmystreet/report/update-form.html +++ b/templates/web/fixmystreet/report/update-form.html @@ -138,7 +138,7 @@ <input type="text" [% IF problem.council == '2482' %]class="validName" [% END %]name="name" id="form_name" value="[% update.name || c.user.name | html %]" placeholder="[% loc('Your name') %]"> <div class="checkbox-group"> - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' UNLESS update.anonymous %]> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF update.anonymous==0 OR (c.cobrand.default_show_name AND update.anonymous=='') %]> <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label> </div> <div class="checkbox-group"> |