diff --git a/ietf/ietfauth/views.py b/ietf/ietfauth/views.py index 60e0c6cb9..1380f6e3e 100644 --- a/ietf/ietfauth/views.py +++ b/ietf/ietfauth/views.py @@ -236,9 +236,13 @@ def profile(request): r.email = e r.save() + primary_email = request.POST.get("primary_email", None) active_emails = request.POST.getlist("active_emails", []) for email in emails: email.active = email.pk in active_emails + email.primary = email.address == primary_email + if email.primary and not email.active: + email.active = True email.save() # Make sure the alias table contains any new and/or old names. diff --git a/ietf/static/ietf/css/ietf.css b/ietf/static/ietf/css/ietf.css index 6ddcab843..d7053b7dd 100644 --- a/ietf/static/ietf/css/ietf.css +++ b/ietf/static/ietf/css/ietf.css @@ -710,3 +710,8 @@ blockquote { margin: inherit; border-left: inherit; } + +#emails { + padding-top: 4px; + padding-right: 4px; +} diff --git a/ietf/templates/registration/edit_profile.html b/ietf/templates/registration/edit_profile.html index 44c89d04f..3b56a7ff1 100644 --- a/ietf/templates/registration/edit_profile.html +++ b/ietf/templates/registration/edit_profile.html @@ -34,14 +34,16 @@
- {% for email in emails %} -
- -
- {% endfor %} + + + {% for email in emails %} + + + + + + {% endfor %} +
PrimaryActiveAddress
{{ email }}
Note: Email addresses cannot be deleted, only deactivated.
@@ -81,11 +83,11 @@ $(document).ready(function() { $("input[name=active_emails]").on("change keypress click", function () { if (this.checked) { - $(this).parent().addClass("text-success");; - $(this).parent().removeClass("text-danger line-through"); + $(this).parent().parent().addClass("text-success");; + $(this).parent().parent().removeClass("text-danger line-through"); } else { - $(this).parent().addClass("text-danger line-through"); - $(this).parent().removeClass("text-success"); + $(this).parent().parent().addClass("text-danger line-through"); + $(this).parent().parent().removeClass("text-success"); } }).trigger("change");