diff options
author | Matthew Somerville <matthew@mysociety.org> | 2014-07-10 15:28:54 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2014-07-10 17:23:09 +0100 |
commit | 5aab29046bbc602bb63a647f61f5b9fd4fe137cd (patch) | |
tree | e1b54449b7a94ef777702e4d0b800a88cf308e00 /perllib/FixMyStreet/App/Controller/Report/New.pm | |
parent | 49cb1e91e0cf01e27843f4c8e22731b7d28c049e (diff) |
Add fixmystreet.com reporting form A/B tests.
Testing two things:
* Putting the email box above the Yes/No, or repeating it inside.
* Showing the contents of the Yes/No sections at first, or not.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 1e9f83aec..c885e1a8a 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -719,7 +719,8 @@ sub process_user : Private { # Extract all the params to a hash to make them easier to work with my %params = map { $_ => scalar $c->req->param($_) } - ( 'email', 'name', 'phone', 'password_register', 'fms_extra_title' ); + ( 'email', 'name', 'phone', 'password_register', 'fms_extra_title', + 'email_y', 'email_n' ); my $user_title = Utils::trim_text( $params{fms_extra_title} ); @@ -744,6 +745,9 @@ sub process_user : Private { # cleanup the email address my $email = $params{email} ? lc $params{email} : ''; + my $email_y = $params{email_y} ? lc $params{email_y} : ''; + my $email_n = $params{email_n} ? lc $params{email_n} : ''; + $email = $email || $email_y || $email_n; $email =~ s{\s+}{}g; $report->user( $c->model('DB::User')->find_or_new( { email => $email } ) ) |