Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buttons problems in 'Change Email' section. #5219

Merged
merged 3 commits into from May 13, 2019

Conversation

@dojutsu-user
Copy link
Member

@dojutsu-user dojutsu-user commented Feb 3, 2019

Problem it solves:

  1. Even if the email is verified and primary, buttons still show to resend verification link and to make the email primary.
  2. If the email is not verified, button should not be there to make it as primary.
  3. if the email is not verified and not primary, only show Resend verification link button and after it has been verified, hide Resend Verification link button and show Make primary button.
  4. Also, there was no use-case for block extra_body. It should be footerjs.

Demo:

ezgif-2-8bd36bbb91cc

Currently, I have implemented this on client side, this should also be from server side. I was able to send 3-4 email verification email for a verified email.

@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented Feb 6, 2019

@humitos
Can I request a review here?

@humitos humitos requested a review from Feb 6, 2019
@stale
Copy link

@stale stale bot commented Mar 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale label Mar 23, 2019
@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented Mar 23, 2019

This is still valid bot.

@stale stale bot removed the Status: stale label Mar 23, 2019
@stale
Copy link

@stale stale bot commented May 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale label May 7, 2019
@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented May 7, 2019

Still valid bot.
Partially linked to #5665
Relevant Comment: #5665 (comment)

@stale stale bot removed the Status: stale label May 7, 2019
Copy link
Member

@humitos humitos left a comment

This looks good to me.

I left some small styling comments.

{% for emailaddress in user.emailaddress_set.all %}
<div class="ctrlHolder">
<label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}">
<input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
Copy link
Member

@humitos humitos May 9, 2019

It's a good practice to use spaces around {{ and {%. For example, {{ forloop.counter }}.

Copy link
Member Author

@dojutsu-user dojutsu-user May 9, 2019

Thank you.
I have pushed the changes.

<button class="primaryAction" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
</div>
{% if user.emailaddress_set.all %}
<p>{% trans 'The following email addresses are associated with your account:' %}</p>
Copy link
Member

@humitos humitos May 9, 2019

nit: I think we have been using " for these blocks.

var primaryButton = document.querySelector("button[name=action_primary]");
var sendVerificationButton = document.querySelector("button[name=action_send");

{% if user.emailaddress_set.all %}
Copy link
Member

@humitos humitos May 9, 2019

nit: use .exists here instead of .all.

Copy link
Member Author

@dojutsu-user dojutsu-user May 9, 2019

Thank you.
I have pushed the changes.

@humitos
Copy link
Member

@humitos humitos commented May 9, 2019

Currently, I have implemented this on client side, this should also be from server side. I was able to send 3-4 email verification email for a verified email.

We could, but I think this is not really important in this case.

Copy link
Contributor

@davidfischer davidfischer left a comment

I tested this locally without issue and I think it's safe to merge. With that said, I think things like this get a lot easier once we have a better UI framework in place.

@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented May 9, 2019

@davidfischer

I think things like this get a lot easier once we have a better UI framework in place.

Are there any plans to work on the UI part of RTD?

@davidfischer
Copy link
Contributor

@davidfischer davidfischer commented May 9, 2019

Are there any plans to work on the UI part of RTD?

Yes there are. This has been something I've been pushing on for a while but it's actually a pretty huge task.

@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented May 9, 2019

@davidfischer
I also want the UI to improve and would like to collaborate on that whenever the team decides to work on the UI part.

@humitos
Copy link
Member

@humitos humitos commented May 13, 2019

I'm merging the PR now since it's tested and we agree on it.

@humitos humitos merged commit 843ce09 into readthedocs:master May 13, 2019
1 check passed
@dojutsu-user dojutsu-user deleted the change-buttons-style branch May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants