urls.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import django
  2. from django.conf.urls import url
  3. try:
  4. from django.views.i18n import javascript_catalog
  5. jsc_view = javascript_catalog
  6. except ImportError:
  7. from django.views.i18n import JavaScriptCatalog
  8. jsc_view = JavaScriptCatalog.as_view()
  9. from jet.dashboard import dashboard
  10. from jet.dashboard.views import update_dashboard_modules_view, add_user_dashboard_module_view, \
  11. update_dashboard_module_collapse_view, remove_dashboard_module_view, UpdateDashboardModuleView, \
  12. load_dashboard_module_view, reset_dashboard_view
  13. app_name = 'dashboard'
  14. urlpatterns = [
  15. url(
  16. r'^module/(?P<pk>\d+)/$',
  17. UpdateDashboardModuleView.as_view(),
  18. name='update_module'
  19. ),
  20. url(
  21. r'^update_dashboard_modules/$',
  22. update_dashboard_modules_view,
  23. name='update_dashboard_modules'
  24. ),
  25. url(
  26. r'^add_user_dashboard_module/$',
  27. add_user_dashboard_module_view,
  28. name='add_user_dashboard_module'
  29. ),
  30. url(
  31. r'^update_dashboard_module_collapse/$',
  32. update_dashboard_module_collapse_view,
  33. name='update_dashboard_module_collapse'
  34. ),
  35. url(
  36. r'^remove_dashboard_module/$',
  37. remove_dashboard_module_view,
  38. name='remove_dashboard_module'
  39. ),
  40. url(
  41. r'^load_dashboard_module/(?P<pk>\d+)/$',
  42. load_dashboard_module_view,
  43. name='load_dashboard_module'
  44. ),
  45. url(
  46. r'^reset_dashboard/$',
  47. reset_dashboard_view,
  48. name='reset_dashboard'
  49. ),
  50. url(
  51. r'^jsi18n/$',
  52. jsc_view,
  53. {'packages': ('jet',)},
  54. name='jsi18n'
  55. ),
  56. ]
  57. urlpatterns += dashboard.urls.get_urls()
  58. if django.VERSION[:2] < (1, 8):
  59. from django.conf.urls import patterns
  60. urlpatterns = patterns('', *urlpatterns)