Skip to content

Commit 20542e8

Browse files
committed
chore(passport): optimize login display
1 parent 00e7d72 commit 20542e8

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

rootfs/api/templates/user/login.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ <h2 class="h3">Log in to your account</h2>
2626
<button class="btn btn-primary btn-lg btn-block" name="commit" type="submit">Log In</button>
2727
<input type="hidden" name="next" value={{ next }}>
2828
</form>
29+
{% if registration_enabled %}
2930
<a class="panel-footer" href="/user/registration/"><span>Sign Up</span></a>
31+
{% endif %}
3032
</div>
33+
{% if password_reset_enabled %}
3134
<a href="/user/password_reset/" class="white-link">Forgot your password?</a>
35+
{% endif %}
3236
</div>
3337
</div>

rootfs/api/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ class ActivateAccountFailView(TemplateView):
136136

137137

138138
class UserLoginView(views.LoginView):
139+
extra_context = {
140+
"registration_enabled": settings.REGISTRATION_ENABLED,
141+
"password_reset_enabled": True if settings.EMAIL_HOST else False,
142+
}
139143
template_name = 'user/login.html'
140144

141145

0 commit comments

Comments
 (0)