diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Westminster.pm | 14 | ||||
-rw-r--r-- | templates/web/westminster/report/form/user.html | 35 |
2 files changed, 48 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Westminster.pm b/perllib/FixMyStreet/Cobrand/Westminster.pm index a62295aa3..9ae276f2b 100644 --- a/perllib/FixMyStreet/Cobrand/Westminster.pm +++ b/perllib/FixMyStreet/Cobrand/Westminster.pm @@ -30,6 +30,18 @@ sub social_auth_enabled { my $self = shift; return $self->feature('oidc_login') ? 1 : 0; - } +} + +sub allow_anonymous_reports { 'button' } + +sub admin_user_domain { 'westminster.gov.uk' } + +sub anonymous_account { + my $self = shift; + return { + email => $self->feature('anonymous_account') . '@' . $self->admin_user_domain, + name => 'Anonymous user', + }; +} 1; diff --git a/templates/web/westminster/report/form/user.html b/templates/web/westminster/report/form/user.html index c2fec9082..c3cde2203 100644 --- a/templates/web/westminster/report/form/user.html +++ b/templates/web/westminster/report/form/user.html @@ -1,4 +1,34 @@ <!-- report/form/user.html --> +<style> +.form-section-preview small { + margin: 0.5em auto; + display: block; + text-align: center; + font-style: normal; + width: 75%; +} +.form-section-preview small#or { + margin: 1em auto; + width: 100%; +} +small#or:before, small#or:after { + background-color: #fff; + content: ""; + display: inline-block; + height: 2px; + position: relative; + vertical-align: middle; + width: 50%; +} +small#or:before { + right: 1em; + margin-left: -50%; +} +small#or:after { + left: 1em; + margin-right: -50%; +} +</style> <div class="js-new-report-user-hidden form-section-preview form-section-preview--next [%~ ' hidden-nojs' IF c.user_exists OR NOT c.cobrand.social_auth_enabled %]"> <h2 class="form-section-heading form-section-heading--private hidden-nojs"> @@ -26,5 +56,10 @@ [% END %] <button type="button" class="btn btn--block hidden-nojs js-new-report-user-show">Confirm by email</button> [% END %] +[% IF type == 'report' AND c.cobrand.allow_anonymous_reports == 'button' %] + <small id="or">[% loc('or') %]</small> + <button name="report_anonymously" value="yes" class="btn btn--block js-new-report-submit">[% loc('Report anonymously') %]</button> + <small>[% loc('No personal details will be stored, and you will not receive updates about this report.') %]</small> +[% END %] </div> <!-- /report/form/user.html --> |