diff --git a/apps/users/templates/users/login.html b/apps/authentication/templates/authentication/login.html similarity index 96% rename from apps/users/templates/users/login.html rename to apps/authentication/templates/authentication/login.html index beacbacb8..e565e209c 100644 --- a/apps/users/templates/users/login.html +++ b/apps/authentication/templates/authentication/login.html @@ -7,7 +7,7 @@ Jumpserver - + {% include '_head_css_js.html' %} @@ -42,7 +42,7 @@
- + {% trans 'Login' %}
diff --git a/apps/users/templates/users/login_otp.html b/apps/authentication/templates/authentication/login_otp.html similarity index 97% rename from apps/users/templates/users/login_otp.html rename to apps/authentication/templates/authentication/login_otp.html index 005c4817f..d697cdf30 100644 --- a/apps/users/templates/users/login_otp.html +++ b/apps/authentication/templates/authentication/login_otp.html @@ -6,8 +6,8 @@ - Jumpserver - + {{ JMS_TITLE }} + {% include '_head_css_js.html' %} diff --git a/apps/users/templates/users/new_login.html b/apps/authentication/templates/authentication/new_login.html similarity index 78% rename from apps/users/templates/users/new_login.html rename to apps/authentication/templates/authentication/new_login.html index 1172001c4..9bd0fe581 100644 --- a/apps/users/templates/users/new_login.html +++ b/apps/authentication/templates/authentication/new_login.html @@ -6,18 +6,9 @@ - {% if interface and interface.favicon %} - - {% else %} - - {% endif %} - + - {% if interface and interface.login_title %} - {{ interface.login_title }} - {% else %} - Jumpserver - {% endif %} + {{ JMS_TITLE }} @@ -65,24 +56,13 @@
- {% if interface.login_image %} - - {% else %} - - {% endif %} +
- {% if interface.login_title %} -
- {{ interface.login_title }} -
- {% else %} -
- {% trans 'Welcome to the Jumpserver open source fortress' %} -
- {% endif %} - +
+ {{ JMS_TITLE }} +
{% trans 'Welcome back, please enter username and password to login' %}
diff --git a/apps/authentication/views/login.py b/apps/authentication/views/login.py index 89d647291..fc2270eba 100644 --- a/apps/authentication/views/login.py +++ b/apps/authentication/views/login.py @@ -43,7 +43,7 @@ class UserLoginView(FormView): key_prefix_captcha = "_LOGIN_INVALID_{}" def get_template_names(self): - template_name = 'users/login.html' + template_name = 'authentication/login.html' if not settings.XPACK_ENABLED: return template_name @@ -51,7 +51,7 @@ class UserLoginView(FormView): if not License.has_valid_license(): return template_name - template_name = 'users/new_login.html' + template_name = 'authentication/new_login.html' return template_name def get(self, request, *args, **kwargs): @@ -145,7 +145,7 @@ class UserLoginView(FormView): class UserLoginOtpView(FormView): - template_name = 'users/login_otp.html' + template_name = 'authentication/login_otp.html' form_class = forms.UserCheckOtpCodeForm redirect_field_name = 'next' diff --git a/apps/jumpserver/context_processor.py b/apps/jumpserver/context_processor.py index c7a5c34d4..f8967adcf 100644 --- a/apps/jumpserver/context_processor.py +++ b/apps/jumpserver/context_processor.py @@ -1,14 +1,18 @@ # -*- coding: utf-8 -*- # +from django.contrib.staticfiles.templatetags.staticfiles import static def jumpserver_processor(request): - context = {} - # Setting default pk - context.update( - {'DEFAULT_PK': '00000000-0000-0000-0000-000000000000'} - ) + context = { + 'DEFAULT_PK': '00000000-0000-0000-0000-000000000000', + 'LOGO_URL': static('img/logo.png'), + 'LOGO_TEXT_URL': static('img/logo_text.png'), + 'LOGIN_IMAGE_URL': static('img/login_image.png'), + 'FAVICON_URL': static('img/facio.ico'), + 'JMS_TITLE': 'Jumpserver' + } return context diff --git a/apps/static/img/login/login_image_1.png b/apps/static/img/login_image.png similarity index 100% rename from apps/static/img/login/login_image_1.png rename to apps/static/img/login_image.png diff --git a/apps/static/img/logo-text.png b/apps/static/img/logo_text.png similarity index 100% rename from apps/static/img/logo-text.png rename to apps/static/img/logo_text.png diff --git a/apps/templates/_footer.html b/apps/templates/_footer.html index e9f268b1a..869ea76a6 100644 --- a/apps/templates/_footer.html +++ b/apps/templates/_footer.html @@ -1,7 +1,7 @@ {% load i18n %}