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

Move show password checkbox under password field #8027

Merged
merged 6 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions warehouse/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ msgid "Sponsor"
msgstr ""

#: warehouse/templates/accounts/login.html:18
#: warehouse/templates/accounts/login.html:94 warehouse/templates/base.html:43
#: warehouse/templates/accounts/login.html:88 warehouse/templates/base.html:43
#: warehouse/templates/base.html:57
msgid "Log in"
msgstr ""
Expand Down Expand Up @@ -813,16 +813,16 @@ msgstr ""
msgid "Password"
msgstr ""

#: warehouse/templates/accounts/login.html:76
#: warehouse/templates/manage/manage_base.html:170
msgid "Show password"
#: warehouse/templates/accounts/login.html:75
msgid "Your password"
msgstr ""

#: warehouse/templates/accounts/login.html:79
msgid "Your password"
#: warehouse/templates/accounts/login.html:92
#: warehouse/templates/manage/manage_base.html:170
msgid "Show password"
msgstr ""

#: warehouse/templates/accounts/login.html:97
#: warehouse/templates/accounts/login.html:96
msgid "Forgot password?"
msgstr ""

Expand Down
21 changes: 10 additions & 11 deletions warehouse/templates/accounts/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ <h1 class="page-title">{% trans title=title %}Log in to {{ title }}{% endtrans %
</div>

<div data-controller="password" class="form-group">
<div class="split-layout">
<div>
<label for="password" class="form-group__label">
{% trans %}Password{% endtrans %}
{% if form.password.flags.required %}
<span class="form-group__required">{% trans %}(required){% endtrans %}</span>
{% endif %}
</label>
<label for="show-password">
<input data-action="change->password#togglePasswords" data-target="password.showPassword"
id="show-password" type="checkbox">&nbsp;{% trans %}Show password{% endtrans %}
</label>
</div>
{{ form.password(placeholder=gettext("Your password"), required="required", class_="form-group__field", autocomplete="current-password", spellcheck="false", data_target="password.password", **{"aria-describedby":"password-errors"}) }}
<div id="password-errors">
Expand All @@ -86,12 +82,15 @@ <h1 class="page-title">{% trans title=title %}Log in to {{ title }}{% endtrans %
</ul>
{% endif %}
</div>
</div>

<div class="form-group">
<div class="split-layout split-layout--table">
<div>
<input type="submit" value="{% trans %}Log in{% endtrans %}" class="button button--primary">
<div class="form-group">
<div class="split-layout margin-top--large margin-bottom--large">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed split-layout--table, as it causes elements to be vertically centered in the container, whereas Nicole's screenshot shows "Show password" aligned to the top of the div

<div>
<input type="submit" value="{% trans %}Log in{% endtrans %}" class="button button--primary">
</div>
<label for="show-password">
<input data-action="change->password#togglePasswords" data-target="password.showPassword"
id="show-password" type="checkbox">&nbsp;{% trans %}Show password{% endtrans %}
</label>
</div>
<span>
<a href="{{request.route_url('accounts.request-password-reset')}}">{% trans %}Forgot password?{% endtrans %}</a>
Expand Down