Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Add parent div to all input password elements in same row.

Shubham Padiae72b42ec13b8
diff --git a/web/styles/settings.css b/web/styles/settings.css
index ce19291fd41..36b3139e300 100644
--- a/web/styles/settings.css
+++ b/web/styles/settings.css
@@ -1166,59 +1166,58 @@ input[type="checkbox"] {
flex: 0 0 100%;
}
- .modal_password_input {
- /* The usual width of input is 206px, but we reduce
- it by 30px to make way for the padding. */
- width: 176px;
- padding-right: 30px;
- }
-
- .password_visibility_toggle {
- /* We're going to use flexbox, not
- positioning, to get the clear button
- over top of the input. This -2em
- margin accomplishes that, in tandem
- with the 2em width of this element,
- which is shared with the ending
- anchor element in left sidebar header
- rows. We're using em instead of pixels
- so the whitespace between the input box
- and the icon doesn't decrease when the
- icon's font-size increases when switching
- from 14px info density to 16px info density
- mode. */
- width: 2em;
- margin-left: -2em;
-
- /* Make the button itself a flex container,
- so we can perfectly center the X icon. */
+ .password-input-row {
display: flex;
- justify-content: center;
- align-items: center;
+ margin-bottom: 10px;
- opacity: 0.6;
+ .modal_password_input {
+ /* The usual width of input is 206px, but we reduce
+ it by 30px to make way for the padding. */
+ width: 176px;
+ padding-right: 30px;
+ /* Override the original 10px value so that we can
+ set the margin-bottom in the parent div instead. */
+ margin-bottom: 0;
+ }
- /* Make the bottom margin same as `.modal_password_input`
- for proper centering, if the margin changes there,
- it should also change here and vice versa. */
- margin-bottom: 10px;
+ .password_visibility_toggle {
+ /* We're going to use flexbox, not
+ positioning, to get the clear button
+ over top of the input. This -2em
+ margin accomplishes that, in tandem
+ with the 2em width of this element,
+ which is shared with the ending
+ anchor element in left sidebar header
+ rows. We're using em instead of pixels
+ so the whitespace between the input box
+ and the icon doesn't decrease when the
+ icon's font-size increases when switching
+ from 14px info density to 16px info density
+ mode. */
+ width: 2em;
+ margin-left: -2em;
+
+ /* Make the button itself a flex container,
+ so we can perfectly center the X icon. */
+ display: flex;
+ justify-content: center;
+ align-items: center;
- &:hover {
- opacity: 1;
+ opacity: 0.6;
+
+ &:hover {
+ opacity: 1;
+ }
}
- }
- .settings-forgot-password {
- /* Make the link itself a flex container,
- so we can perfectly center the text
- in relation to the input box. */
- display: flex;
- align-items: center;
- margin-left: 10px;
- /* Make the bottom margin same as `.modal_password_input`
- for proper centering, if the margin changes there,
- it should also change here and vice versa. */
- margin-bottom: 10px;
+ .settings-forgot-password {
+ /* Make the link itself a flex container,
+ so we can perfectly center the text
+ in relation to the input box. */
+ display: flex;
+ align-items: center;
+ margin-left: 10px;
+ }
}
}
}
diff --git a/web/templates/dialog_change_password.hbs b/web/templates/dialog_change_password.hbs
index 489e7e456dd..2b4c0654ad5 100644
--- a/web/templates/dialog_change_password.hbs
+++ b/web/templates/dialog_change_password.hbs
@@ -1,15 +1,19 @@
<form id="change_password_container">
<div class="settings-password-div">
<label for="old_password" class="modal-field-label">{{t "Old password" }}</label>
- <input type="password" autocomplete="off" name="old_password" id="old_password" class="w-200 inline-block modal_password_input" value="" />
- <i class="fa fa-eye-slash password_visibility_toggle tippy-zulip-tooltip" role="button" tabindex="0"></i>
- <a href="/accounts/password/reset/" class="settings-forgot-password sea-green" target="_blank" rel="noopener noreferrer">{{t "Forgot it?" }}</a>
+ <div class="password-input-row">
+ <input type="password" autocomplete="off" name="old_password" id="old_password" class="w-200 inline-block modal_password_input" value="" />
+ <i class="fa fa-eye-slash password_visibility_toggle tippy-zulip-tooltip" role="button" tabindex="0"></i>
+ <a href="/accounts/password/reset/" class="settings-forgot-password sea-green" target="_blank" rel="noopener noreferrer">{{t "Forgot it?" }}</a>
+ </div>
</div>
<div class="settings-password-div">
<label for="new_password" class="modal-field-label">{{t "New password" }}</label>
- <input type="password" autocomplete="new-password" name="new_password" id="new_password" class="w-200 inline-block modal_password_input" value=""
- data-min-length="{{password_min_length}}" data-min-guesses="{{password_min_guesses}}" />
- <i class="fa fa-eye-slash password_visibility_toggle tippy-zulip-tooltip" role="button" tabindex="0"></i>
+ <div class="password-input-row">
+ <input type="password" autocomplete="new-password" name="new_password" id="new_password" class="w-200 inline-block modal_password_input" value=""
+ data-min-length="{{password_min_length}}" data-min-guesses="{{password_min_guesses}}" />
+ <i class="fa fa-eye-slash password_visibility_toggle tippy-zulip-tooltip" role="button" tabindex="0"></i>
+ </div>
<div class="progress inline-block" id="pw_strength">
<div class="bar bar-danger hide" style="width: 10%;"></div>
</div>
diff --git a/web/templates/settings/api_key_modal.hbs b/web/templates/settings/api_key_modal.hbs
index d356f248f38..eaa08d44ce8 100644
--- a/web/templates/settings/api_key_modal.hbs
+++ b/web/templates/settings/api_key_modal.hbs
@@ -14,8 +14,10 @@
<p>{{t "Please re-enter your password to confirm your identity." }}</p>
<div class="settings-password-div">
<label for="password" class="modal-field-label">{{t "Your password" }}</label>
- <input type="password" autocomplete="off" name="password" id="get_api_key_password" class=" modal_password_input" value="" />
- <i class="fa fa-eye-slash password_visibility_toggle tippy-zulip-tooltip" role="button"></i>
+ <div class="password-input-row">
+ <input type="password" autocomplete="off" name="password" id="get_api_key_password" class=" modal_password_input" value="" />
+ <i class="fa fa-eye-slash password_visibility_toggle tippy-zulip-tooltip" role="button"></i>
+ </div>
</div>
<p class="small">
{{#tr}}If you don't know your password, you can <z-link>reset it</z-link>.