diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-12-06 14:42:57 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-12-08 09:30:51 +0000 |
commit | c5cb5b7bc7f0c2cd10939bcbe0bdfdaed0543329 (patch) | |
tree | 5add4a88e56fc6865b6cf4dda697158357051c77 | |
parent | 1d1681c632774cf6ef00b6a9d20fe89077231cb9 (diff) |
Show email form after logging in as leaving update
With the recent login changes, the user form was being hidden after
logging in while leaving an update, meaning you had to click "Continue"
to see the thing it was asking you to check. Refactor the update flow
slightly in this area to be more like reporting, showing the relevant
bit of the user form immediately (and thus also not having it within a
hidden section).
-rw-r--r-- | .cypress/cypress/integration/simple_spec.js | 1 | ||||
-rw-r--r-- | templates/web/base/report/update-form.html | 16 | ||||
-rw-r--r-- | templates/web/base/report/update/form_user.html | 7 |
3 files changed, 12 insertions, 12 deletions
diff --git a/.cypress/cypress/integration/simple_spec.js b/.cypress/cypress/integration/simple_spec.js index 48c80840b..faf24f70e 100644 --- a/.cypress/cypress/integration/simple_spec.js +++ b/.cypress/cypress/integration/simple_spec.js @@ -32,7 +32,6 @@ describe('Leaving updates', function() { cy.get('[name=password_sign_in]:last').type('password'); cy.get('[name=password_sign_in]:last').parents('form:first').submit(); cy.get('#map_sidebar').should('contain', 'check and confirm your details'); - cy.get('.js-new-report-user-show').click(); // Should not have to do this, #2340 cy.get('[name=submit_register]').parents('form').submit(); cy.get('body').should('contain', 'Thank you for updating this issue'); } diff --git a/templates/web/base/report/update-form.html b/templates/web/base/report/update-form.html index 9a3717ed9..afa110280 100644 --- a/templates/web/base/report/update-form.html +++ b/templates/web/base/report/update-form.html @@ -21,16 +21,20 @@ <form method="post" action="[% c.uri_for( '/report/update' ) %]" id="form_update_form" name="updateForm" class="validate"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> <input type="hidden" name="token" value="[% csrf_token %]"> <fieldset> - [% IF NOT login_success AND NOT oauth_need_email %] - <div class="js-new-report-user-hidden"> - [% INCLUDE 'report/update/form_update.html' %] + [% IF login_success %] + [% PROCESS "report/update/form_user_loggedin.html" %] + [% INCLUDE 'report/update/form_update.html' %] + [% ELSIF oauth_need_email %] + <div id="form_sign_in"> + [% PROCESS "report/form/user_loggedout_by_email.html" object=update type='update' valid_class='validNameU' email_required=1 %] + <input type="hidden" name="oauth_need_email" value="1"> </div> - [% END %] - [% PROCESS "report/update/form_user.html" %] - [% IF login_success OR oauth_need_email %] + [% INCLUDE 'report/update/form_update.html' %] + [% ELSE %] <div class="js-new-report-user-hidden"> [% INCLUDE 'report/update/form_update.html' %] </div> + [% PROCESS "report/update/form_user.html" %] [% END %] </fieldset> </form> diff --git a/templates/web/base/report/update/form_user.html b/templates/web/base/report/update/form_user.html index 65d15e22f..d9a181e26 100644 --- a/templates/web/base/report/update/form_user.html +++ b/templates/web/base/report/update/form_user.html @@ -1,3 +1,4 @@ +<!-- report/update/form_user.html --> [% PROCESS 'report/form/user.html' %] <div class="hidden-js js-new-report-user-shown"> @@ -9,13 +10,9 @@ [% IF c.user_exists %] [% PROCESS "report/update/form_user_loggedin.html" type='update' %] - [% ELSIF oauth_need_email %] - <div id="form_sign_in"> - [% PROCESS 'report/form/user_loggedout_by_email.html' object=update type='update' valid_class='validNameU' email_required=1 %] - <input type="hidden" name="oauth_need_email" value="1"> - </div> [% ELSE %] [% PROCESS "report/form/user_loggedout.html" type='update' object=update %] [% END %] </div> +<!-- /report/update/form_user.html --> |