Commit b8a18bef by Kálmán Viktor

circle: add js i18n catalog

parent 9cafc124
...@@ -11,6 +11,12 @@ from dashboard.forms import CirclePasswordResetForm, CircleSetPasswordForm ...@@ -11,6 +11,12 @@ from dashboard.forms import CirclePasswordResetForm, CircleSetPasswordForm
admin.autodiscover() admin.autodiscover()
# TODO cache
# docs.djangoproject.com/en/1.5/topics/i18n/translation/#note-on-performance
js_info_dict = {
'packages': ("dashboard", "network", ),
}
urlpatterns = patterns( urlpatterns = patterns(
'', '',
#url(r'^$', TemplateView.as_view(template_name='base.html')), #url(r'^$', TemplateView.as_view(template_name='base.html')),
...@@ -26,6 +32,9 @@ urlpatterns = patterns( ...@@ -26,6 +32,9 @@ urlpatterns = patterns(
url(r'^network/', include('network.urls')), url(r'^network/', include('network.urls')),
url(r'^dashboard/', include('dashboard.urls')), url(r'^dashboard/', include('dashboard.urls')),
url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict,
name="js-i18n"),
url((r'^accounts/reset/(?P<uidb36>[0-9A-Za-z]{1,13})-' url((r'^accounts/reset/(?P<uidb36>[0-9A-Za-z]{1,13})-'
'(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$'), '(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$'),
'django.contrib.auth.views.password_reset_confirm', 'django.contrib.auth.views.password_reset_confirm',
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<link href="{{ STATIC_URL }}dashboard/bootstrap-tour.min.css" rel="stylesheet"> <link href="{{ STATIC_URL }}dashboard/bootstrap-tour.min.css" rel="stylesheet">
<link href="{{ STATIC_URL }}dashboard/dashboard.css" rel="stylesheet"> <link href="{{ STATIC_URL }}dashboard/dashboard.css" rel="stylesheet">
<script src="{{ STATIC_URL }}dashboard/dashboard.js"></script> <script src="{{ STATIC_URL }}dashboard/dashboard.js"></script>
<script src="{% url "js-i18n" %}"></script>
</head> </head>
<body> <body>
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</div><!-- .footer-container .container --> </div><!-- .footer-container .container -->
<script src="//code.jquery.com/jquery-latest.js"></script> <script src="//code.jquery.com/jquery-latest.js"></script>
<script src="{% url "network.js_catalog" %}"></script> <script src="{% url "js-i18n" %}"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="{% static "js/bootbox.min.js" %}"></script> <script src="{% static "js/bootbox.min.js" %}"></script>
<script src="{% static "js/network.js" %}"></script> <script src="{% static "js/network.js" %}"></script>
......
...@@ -15,10 +15,6 @@ from .views import (IndexView, ...@@ -15,10 +15,6 @@ from .views import (IndexView,
remove_host_group, add_host_group, remove_host_group, add_host_group,
remove_switch_port_device, add_switch_port_device) remove_switch_port_device, add_switch_port_device)
js_info_dict = {
'packages': ('network', ),
}
urlpatterns = patterns( urlpatterns = patterns(
'', '',
url('^$', IndexView.as_view(), name='network.index'), url('^$', IndexView.as_view(), name='network.index'),
...@@ -92,8 +88,4 @@ urlpatterns = patterns( ...@@ -92,8 +88,4 @@ urlpatterns = patterns(
remove_switch_port_device, name='network.remove_switch_port_device'), remove_switch_port_device, name='network.remove_switch_port_device'),
url('^switchports/(?P<pk>\d+)/add/$', add_switch_port_device, url('^switchports/(?P<pk>\d+)/add/$', add_switch_port_device,
name='network.add_switch_port_device'), name='network.add_switch_port_device'),
# js gettext catalog
url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict,
name="network.js_catalog"),
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment