From 8f7e4f4f24dbed5a555c8f2a9cbb02a6e37c8910 Mon Sep 17 00:00:00 2001 From: CJ Green <44074998+okaycj@users.noreply.github.com> Date: Fri, 24 Mar 2023 11:09:38 -0400 Subject: [PATCH] Fix registration views (#1152) * Update registration view for BS5 * Remove duplicate form error messages --- accounts/templates/accounts/2fa-setup.html | 1 - .../templates/accounts/account-update.html | 3 -- .../accounts/researcher-registration.html | 1 - studies/templates/studies/lab_create.html | 1 - studies/templates/studies/lab_update.html | 1 - .../studies/study_participant_contact.html | 1 - web/templates/registration/login.html | 1 - .../registration/password_reset_complete.html | 20 +++----- .../registration/password_reset_confirm.html | 50 ++++++------------- .../registration/password_reset_done.html | 24 ++++----- .../registration/password_reset_form.html | 37 +++++--------- web/templates/web/child-add.html | 1 - web/templates/web/child-update.html | 1 - .../web/demographic-data-update.html | 1 - .../web/participant-email-preferences.html | 1 - web/templates/web/participant-signup.html | 1 - 16 files changed, 44 insertions(+), 101 deletions(-) diff --git a/accounts/templates/accounts/2fa-setup.html b/accounts/templates/accounts/2fa-setup.html index e0e45b5da..071942fdb 100644 --- a/accounts/templates/accounts/2fa-setup.html +++ b/accounts/templates/accounts/2fa-setup.html @@ -28,7 +28,6 @@

QR Code

  • {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button "Test Code" button_type="submit" button_class=btn_primary_classes %}
    diff --git a/accounts/templates/accounts/account-update.html b/accounts/templates/accounts/account-update.html index ddec13739..80c0f9cb4 100644 --- a/accounts/templates/accounts/account-update.html +++ b/accounts/templates/accounts/account-update.html @@ -14,7 +14,6 @@

    {% trans "Account Information" %}

    {% csrf_token %} - {% bootstrap_form_errors update_account_form %} {% bootstrap_form update_account_form %} {% bootstrap_button "Save" name="form-handle" value="update-account" %}
    @@ -26,7 +25,6 @@

    {% trans "Account Information" %}

    {% trans "Change Your Password" %}

    {% csrf_token %} - {% bootstrap_form_errors change_password_form %} {% bootstrap_form change_password_form %} {% bootstrap_button "Save" name="form-handle" value="change-password" %}
    @@ -52,7 +50,6 @@

    {% trans "Manage Two-Factor Authentication" %}

    {% endif %} {% csrf_token %} - {% bootstrap_form_errors otp_check_form %} {% bootstrap_form otp_check_form %} {% if otp.activated %} {% bootstrap_button "Submit" name="form-handle" value="deactivate-otp" %} diff --git a/accounts/templates/accounts/researcher-registration.html b/accounts/templates/accounts/researcher-registration.html index 02272055c..a41ae9ad6 100644 --- a/accounts/templates/accounts/researcher-registration.html +++ b/accounts/templates/accounts/researcher-registration.html @@ -11,7 +11,6 @@
    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %}

    By clicking 'Create Account', you agree that you have read and accepted the diff --git a/studies/templates/studies/lab_create.html b/studies/templates/studies/lab_create.html index 6074176c5..cb9b47622 100644 --- a/studies/templates/studies/lab_create.html +++ b/studies/templates/studies/lab_create.html @@ -14,7 +14,6 @@

    Create Lab

    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button "Submit" %}
    diff --git a/studies/templates/studies/lab_update.html b/studies/templates/studies/lab_update.html index ea280137d..cd62e924d 100644 --- a/studies/templates/studies/lab_update.html +++ b/studies/templates/studies/lab_update.html @@ -18,7 +18,6 @@

    Update Lab

    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button "Discard Changes" href=url_lab_edit button_class=btn_secondary_classes %} {% bootstrap_button "Save" type="submit" button_class=btn_primary_classes %} diff --git a/studies/templates/studies/study_participant_contact.html b/studies/templates/studies/study_participant_contact.html index d720fa7ac..d22dc9f49 100644 --- a/studies/templates/studies/study_participant_contact.html +++ b/studies/templates/studies/study_participant_contact.html @@ -139,7 +139,6 @@
    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button "Submit" %} diff --git a/web/templates/registration/login.html b/web/templates/registration/login.html index 38194d83c..0d76f3620 100644 --- a/web/templates/registration/login.html +++ b/web/templates/registration/login.html @@ -11,7 +11,6 @@
    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button button_type="submit" content=login %} diff --git a/web/templates/registration/password_reset_complete.html b/web/templates/registration/password_reset_complete.html index fc0761422..7fd11b117 100644 --- a/web/templates/registration/password_reset_complete.html +++ b/web/templates/registration/password_reset_complete.html @@ -4,19 +4,13 @@ {% load bootstrap_icons %} {% load web_extras %} {% block content %} -
    -
    -
    -
    -

    {% trans "Password reset complete" %}

    -
    -
    -

    {% trans "Your password has been set. You may go ahead and log in now." %}

    -

    - {% bs_icon "user" %} {% trans "Log in" %} -

    -
    -
    + {% bs_icon "person-circle" as bs_icon_person %} + {% trans "Log in" as trans_login %} +
    +
    {% trans "Password reset complete" %}
    +
    +

    {% trans "Your password has been set. You may go ahead and log in now." %}

    +

    {% bootstrap_button bs_icon_person|add:trans_login href=login_url %}

    {% endblock content %} diff --git a/web/templates/registration/password_reset_confirm.html b/web/templates/registration/password_reset_confirm.html index f6a095fee..a11092923 100644 --- a/web/templates/registration/password_reset_confirm.html +++ b/web/templates/registration/password_reset_confirm.html @@ -3,40 +3,22 @@ {% load django_bootstrap5 %} {% load web_extras %} {% block content %} -
    -
    -
    -
    -

    {% trans "Password reset confirmation" %}

    -
    -
    - {% if validlink %} -

    {% trans "Please enter your new password twice so we can verify you typed it in correctly." %}

    - - {% csrf_token %} -
    -
    - {{ form.new_password1.errors }} - - {{ form.new_password1 }} -
    -
    - {{ form.new_password2.errors }} - - {{ form.new_password2 }} -
    - -
    - - {% else %} -

    - {% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %} -

    - {% endif %} -
    -
    + {% trans "Change my password" as trans_change_my_password %} +
    +
    {% trans "Password reset confirmation" %}
    +
    + {% if validlink %} +

    {% trans "Please enter your new password twice so we can verify you typed it in correctly." %}

    +
    + {% csrf_token %} + {% bootstrap_form form %} + {% bootstrap_button trans_change_my_password %} +
    + {% else %} +

    + {% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %} +

    + {% endif %}
    {% endblock content %} diff --git a/web/templates/registration/password_reset_done.html b/web/templates/registration/password_reset_done.html index 32aca7d8a..a732ee78d 100644 --- a/web/templates/registration/password_reset_done.html +++ b/web/templates/registration/password_reset_done.html @@ -2,21 +2,15 @@ {% load i18n static %} {% load django_bootstrap5 %} {% block content %} -
    -
    -
    -
    -

    {% trans "Password reset link sent" %}

    -
    -
    -

    - {% trans "If an account exists with the email you entered, we've emailed instructions for resetting your password and you should receive them shortly." %} -

    -

    - {% trans "If you don't receive an email, please check your spam folder and make sure you've entered the address you registered with. (You won't get an email unless there's already an account for that email address!)" %} -

    -
    -
    +
    +
    {% trans "Password reset link sent" %}
    +
    +

    + {% trans "If an account exists with the email you entered, we've emailed instructions for resetting your password and you should receive them shortly." %} +

    +

    + {% trans "If you don't receive an email, please check your spam folder and make sure you've entered the address you registered with. (You won't get an email unless there's already an account for that email address!)" %} +

    {% endblock content %} diff --git a/web/templates/registration/password_reset_form.html b/web/templates/registration/password_reset_form.html index 8a60342c4..8e49c1d6a 100644 --- a/web/templates/registration/password_reset_form.html +++ b/web/templates/registration/password_reset_form.html @@ -3,31 +3,18 @@ {% load django_bootstrap5 %} {% load web_extras %} {% block content %} -
    -
    -
    -
    -

    {% trans "Password reset" %}

    -
    -
    -

    - {% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %} -

    -
    - {% csrf_token %} -
    -
    - {{ form.email.errors }} - - {{ form.email }} -
    - -
    -
    -
    -
    + {% trans "Reset my password" as trans_reset_password %} +
    +
    {% trans "Password reset" %}
    +
    +

    + {% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %} +

    +
    + {% csrf_token %} + {% bootstrap_form form %} + {% bootstrap_button trans_reset_password %} +
    {% endblock content %} diff --git a/web/templates/web/child-add.html b/web/templates/web/child-add.html index a81f3b202..8731724fd 100644 --- a/web/templates/web/child-add.html +++ b/web/templates/web/child-add.html @@ -26,7 +26,6 @@

    {% trans "Add Child" %}

    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button trans_cancel href=url_children_list button_class=btn_secondary_classes %} {% bootstrap_button bs_icon_plus|add:trans_add_child button_class=btn_primary_classes %} diff --git a/web/templates/web/child-update.html b/web/templates/web/child-update.html index ab98e2b1e..bb65e0fe4 100644 --- a/web/templates/web/child-update.html +++ b/web/templates/web/child-update.html @@ -28,7 +28,6 @@

    {% trans "Update" %} {{ child.given_name }}

    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button trans_delete button_class="btn-danger" name="deleteChild" %} {% bootstrap_button trans_cancel href=url_children_list button_class=btn_secondary_classes %} diff --git a/web/templates/web/demographic-data-update.html b/web/templates/web/demographic-data-update.html index f401388de..862dfc5a5 100644 --- a/web/templates/web/demographic-data-update.html +++ b/web/templates/web/demographic-data-update.html @@ -48,7 +48,6 @@ {% endif %} {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button trans_save %}
    diff --git a/web/templates/web/participant-email-preferences.html b/web/templates/web/participant-email-preferences.html index 89726d924..747e78337 100644 --- a/web/templates/web/participant-email-preferences.html +++ b/web/templates/web/participant-email-preferences.html @@ -19,7 +19,6 @@

    {% trans "I would like to be contacted when:" %}

    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %} {% bootstrap_button trans_cancel href=url_email_prefs button_class=btn_secondary_classes %} {% bootstrap_button trans_save name="password_update" button_class=btn_primary_classes %} diff --git a/web/templates/web/participant-signup.html b/web/templates/web/participant-signup.html index 6018bf595..210b8632d 100644 --- a/web/templates/web/participant-signup.html +++ b/web/templates/web/participant-signup.html @@ -22,7 +22,6 @@
    {% csrf_token %} - {% bootstrap_form_errors form %} {% bootstrap_form form %}

    {% trans "By clicking 'Create Account', I agree that I have read and accepted the " %} {% trans "Privacy Statement" %}.