Some password reset UI fixes. Fixes #955
This commit is contained in:
parent
70f15ffd6f
commit
7d6985647f
3 changed files with 22 additions and 9 deletions
5
ui/src/components/comment-form.tsx
vendored
5
ui/src/components/comment-form.tsx
vendored
|
@ -258,7 +258,10 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
||||||
<use xlinkHref="#icon-alert-triangle"></use>
|
<use xlinkHref="#icon-alert-triangle"></use>
|
||||||
</svg>
|
</svg>
|
||||||
<T i18nKey="must_login" class="d-inline">
|
<T i18nKey="must_login" class="d-inline">
|
||||||
#<Link to="/login">#</Link>
|
#
|
||||||
|
<Link class="alert-link" to="/login">
|
||||||
|
#
|
||||||
|
</Link>
|
||||||
</T>
|
</T>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
25
ui/src/components/login.tsx
vendored
25
ui/src/components/login.tsx
vendored
|
@ -120,14 +120,15 @@ export class Login extends Component<any, State> {
|
||||||
class="form-control"
|
class="form-control"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<button
|
{validEmail(this.state.loginForm.username_or_email) && (
|
||||||
type="button"
|
<button
|
||||||
disabled={!validEmail(this.state.loginForm.username_or_email)}
|
type="button"
|
||||||
onClick={linkEvent(this, this.handlePasswordReset)}
|
onClick={linkEvent(this, this.handlePasswordReset)}
|
||||||
className="btn p-0 btn-link d-inline-block float-right text-muted small font-weight-bold"
|
className="btn p-0 btn-link d-inline-block float-right text-muted small font-weight-bold"
|
||||||
>
|
>
|
||||||
{i18n.t('forgot_password')}
|
{i18n.t('forgot_password')}
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
|
@ -186,6 +187,14 @@ export class Login extends Component<any, State> {
|
||||||
onInput={linkEvent(this, this.handleRegisterEmailChange)}
|
onInput={linkEvent(this, this.handleRegisterEmailChange)}
|
||||||
minLength={3}
|
minLength={3}
|
||||||
/>
|
/>
|
||||||
|
{!validEmail(this.state.registerForm.email) && (
|
||||||
|
<div class="mt-2 mb-0 alert alert-light" role="alert">
|
||||||
|
<svg class="icon icon-inline mr-2">
|
||||||
|
<use xlinkHref="#icon-alert-triangle"></use>
|
||||||
|
</svg>
|
||||||
|
{i18n.t('no_password_reset')}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
1
ui/translations/en.json
vendored
1
ui/translations/en.json
vendored
|
@ -253,6 +253,7 @@
|
||||||
"Couldn't find that username or email.",
|
"Couldn't find that username or email.",
|
||||||
"password_incorrect": "Password incorrect.",
|
"password_incorrect": "Password incorrect.",
|
||||||
"passwords_dont_match": "Passwords do not match.",
|
"passwords_dont_match": "Passwords do not match.",
|
||||||
|
"no_password_reset": "You will not be able to reset your password without an email.",
|
||||||
"invalid_username": "Invalid username.",
|
"invalid_username": "Invalid username.",
|
||||||
"admin_already_created": "Sorry, there's already an admin.",
|
"admin_already_created": "Sorry, there's already an admin.",
|
||||||
"user_already_exists": "User already exists.",
|
"user_already_exists": "User already exists.",
|
||||||
|
|
Loading…
Reference in a new issue