Browse Source

fix(i18n): 修复重置密码那的i18n问题

pull/4968/head
ibuler 4 years ago committed by Jiangjie.Bai
parent
commit
987f840431
  1. 2
      apps/jumpserver/conf.py
  2. 8
      apps/jumpserver/urls.py
  3. 4
      apps/static/js/jumpserver.js
  4. 1
      apps/templates/_base_only_content.html

2
apps/jumpserver/conf.py

@ -369,7 +369,7 @@ class Config(dict):
tp = type(default_value)
# 对bool特殊处理
if tp is bool and isinstance(v, str):
if v in ("true", "True", "1"):
if v.lower() in ("true", "1"):
return True
else:
return False

8
apps/jumpserver/urls.py

@ -4,6 +4,8 @@ from __future__ import unicode_literals
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls.i18n import i18n_patterns
from django.views.i18n import JavaScriptCatalog
from . import views, api
@ -66,7 +68,11 @@ urlpatterns = [
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \
+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
# urlpatterns += js_i18n_patterns
js_i18n_patterns = i18n_patterns(
path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
)
urlpatterns += js_i18n_patterns
handler404 = 'jumpserver.views.handler404'
handler500 = 'jumpserver.views.handler500'

4
apps/static/js/jumpserver.js

@ -3,10 +3,6 @@
//此函数用于checkbox的全选和反选
var checked = false;
function gettext(s) {
return s
}
function check_all(form) {
var checkboxes = document.getElementById(form);
if (checked === false) {

1
apps/templates/_base_only_content.html

@ -11,6 +11,7 @@
{% include '_head_css_js.html' %}
<link href="{% static "css/jumpserver.css" %}" rel="stylesheet">
<script src="{% url 'javascript-catalog' %}"></script>
<script src="{% static "js/jumpserver.js" %}"></script>
<style>
.passwordBox {

Loading…
Cancel
Save