Browse Source

Merge branch 'dev'

Denis K 7 years ago
parent
commit
d4f6608549
39 changed files with 856 additions and 55 deletions
  1. 21 8
      .travis.yml
  2. 7 0
      CHANGELOG.rst
  3. 1 1
      jet/__init__.py
  4. 6 5
      jet/dashboard/forms.py
  5. 497 0
      jet/dashboard/locale/fa/LC_MESSAGES/django.po
  6. 30 0
      jet/dashboard/locale/fa/LC_MESSAGES/djangojs.po
  7. 2 1
      jet/dashboard/templatetags/jet_dashboard_tags.py
  8. 10 2
      jet/dashboard/urls.py
  9. 2 2
      jet/dashboard/views.py
  10. 6 5
      jet/forms.py
  11. 164 0
      jet/locale/fa/LC_MESSAGES/django.po
  12. 47 0
      jet/locale/fa/LC_MESSAGES/djangojs.po
  13. 0 0
      jet/locale/pt_BR/LC_MESSAGES/django.mo
  14. 0 0
      jet/locale/pt_BR/LC_MESSAGES/django.po
  15. 0 0
      jet/locale/pt_BR/LC_MESSAGES/djangojs.mo
  16. 0 0
      jet/locale/pt_BR/LC_MESSAGES/djangojs.po
  17. 0 0
      jet/locale/zh_CN/LC_MESSAGES/django.mo
  18. 0 0
      jet/locale/zh_CN/LC_MESSAGES/django.po
  19. 1 0
      jet/static/jet/css/_header.scss
  20. 0 0
      jet/static/jet/css/themes/default/base.css
  21. 0 0
      jet/static/jet/css/themes/default/base.css.map
  22. 0 0
      jet/static/jet/css/themes/green/base.css
  23. 0 0
      jet/static/jet/css/themes/green/base.css.map
  24. 0 0
      jet/static/jet/css/themes/light-blue/base.css
  25. 0 0
      jet/static/jet/css/themes/light-blue/base.css.map
  26. 0 0
      jet/static/jet/css/themes/light-gray/base.css
  27. 0 0
      jet/static/jet/css/themes/light-gray/base.css.map
  28. 0 0
      jet/static/jet/css/themes/light-green/base.css
  29. 0 0
      jet/static/jet/css/themes/light-green/base.css.map
  30. 0 0
      jet/static/jet/css/themes/light-violet/base.css
  31. 0 0
      jet/static/jet/css/themes/light-violet/base.css.map
  32. 0 1
      jet/static/jet/css/vendor.css
  33. 8 4
      jet/templates/admin/base.html
  34. 16 15
      jet/templatetags/jet_tags.py
  35. 1 1
      jet/tests/models.py
  36. 1 1
      jet/tests/settings.py
  37. 17 6
      jet/tests/urls.py
  38. 11 2
      jet/urls.py
  39. 8 1
      jet/utils.py

+ 21 - 8
.travis.yml

@@ -15,6 +15,7 @@ env:
   - DJANGO="<1.10"
   - DJANGO="<1.11"
   - DJANGO="<1.12"
+  - DJANGO="<2.1"
 before_install:
   - export DJANGO_SETTINGS_MODULE=jet.tests.settings
 install:
@@ -35,22 +36,34 @@ matrix:
       env: DJANGO="<1.9"
     - python: 2.6
       env: DJANGO="<1.10"
-    - python: 3.2
-      env: DJANGO="<1.10"
-    - python: 3.3
-      env: DJANGO="<1.10"
     - python: 2.6
       env: DJANGO="<1.11"
-    - python: 3.2
-      env: DJANGO="<1.11"
-    - python: 3.3
-      env: DJANGO="<1.11"
     - python: 2.6
       env: DJANGO="<1.12"
+    - python: 2.6
+      env: DJANGO="<2.1"
+
+    - python: 2.7
+      env: DJANGO="<2.1"
+
+    - python: 3.2
+      env: DJANGO="<1.10"
+    - python: 3.2
+      env: DJANGO="<1.11"
     - python: 3.2
       env: DJANGO="<1.12"
+    - python: 3.2
+      env: DJANGO="<2.1"
+
+    - python: 3.3
+      env: DJANGO="<1.10"
+    - python: 3.3
+      env: DJANGO="<1.11"
     - python: 3.3
       env: DJANGO="<1.12"
+    - python: 3.3
+      env: DJANGO="<2.1"
+
     - python: 3.5
       env: DJANGO="<1.7"
     - python: 3.5

+ 7 - 0
CHANGELOG.rst

@@ -1,6 +1,13 @@
 Changelog
 =========
 
+1.0.7
+-----
+* PR-265: Fixed Django 2 support (thanks to HarryLafranc for PR)
+* PR-219: Added Persian/Farsi translation (thanks to pyzenberg for PR)
+* PR-271: Fix locale names (thanks to leonardoarroyo for PR)
+
+
 1.0.6
 -----
 * PR-191: Added sidebar pinning functionality (thanks to grigory51 for PR)

+ 1 - 1
jet/__init__.py

@@ -1 +1 @@
-VERSION = '1.0.6'
+VERSION = '1.0.7'

+ 6 - 5
jet/dashboard/forms.py

@@ -3,6 +3,7 @@ from django import forms
 from django.core.exceptions import ValidationError
 from jet.dashboard.models import UserDashboardModule
 from jet.dashboard.utils import get_current_dashboard
+from jet.utils import user_is_authenticated
 
 
 class UpdateDashboardModulesForm(forms.Form):
@@ -17,7 +18,7 @@ class UpdateDashboardModulesForm(forms.Form):
     def clean(self):
         data = super(UpdateDashboardModulesForm, self).clean()
 
-        if not self.request.user.is_authenticated() or not self.request.user.is_staff:
+        if not user_is_authenticated(self.request.user) or not self.request.user.is_staff:
             raise ValidationError('error')
 
         try:
@@ -68,7 +69,7 @@ class AddUserDashboardModuleForm(forms.ModelForm):
     def clean(self):
         data = super(AddUserDashboardModuleForm, self).clean()
 
-        if not self.request.user.is_authenticated() or not self.request.user.is_staff:
+        if not user_is_authenticated(self.request.user) or not self.request.user.is_staff:
             raise ValidationError('error')
 
         if 'app_label' in data:
@@ -110,7 +111,7 @@ class UpdateDashboardModuleCollapseForm(forms.ModelForm):
     def clean(self):
         data = super(UpdateDashboardModuleCollapseForm, self).clean()
 
-        if not self.request.user.is_authenticated() or not self.request.user.is_staff:
+        if not user_is_authenticated(self.request.user) or not self.request.user.is_staff:
             raise ValidationError('error')
 
         if self.instance.user != self.request.user.pk:
@@ -131,7 +132,7 @@ class RemoveDashboardModuleForm(forms.ModelForm):
     def clean(self):
         cleaned_data = super(RemoveDashboardModuleForm, self).clean()
 
-        if not self.request.user.is_authenticated() or self.instance.user != self.request.user.pk:
+        if not user_is_authenticated(self.request.user) or self.instance.user != self.request.user.pk:
             raise ValidationError('error')
 
         return cleaned_data
@@ -156,7 +157,7 @@ class ResetDashboardForm(forms.Form):
         data = super(ResetDashboardForm, self).clean()
         data['app_label'] = data['app_label'] if data['app_label'] else None
 
-        if not self.request.user.is_authenticated() or not self.request.user.is_staff:
+        if not user_is_authenticated(self.request.user) or not self.request.user.is_staff:
             raise ValidationError('error')
 
         return data

+ 497 - 0
jet/dashboard/locale/fa/LC_MESSAGES/django.po

@@ -0,0 +1,497 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-25 12:27+0430\n"
+"PO-Revision-Date: 2017-05-24 23:51+0430\n"
+"Last-Translator: Pyzenberg <pyzenberg@gmail.com>\n"
+"Language-Team: \n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Poedit 1.8.9\n"
+
+#: dashboard/dashboard.py:215
+msgid "Quick links"
+msgstr "لینک های سریع"
+
+#: dashboard/dashboard.py:221
+msgid "Return to site"
+msgstr "بازگش به سایت"
+
+#: dashboard/dashboard.py:222
+msgid "Change password"
+msgstr "تغییر رمزعبور"
+
+#: dashboard/dashboard.py:224
+msgid "Log out"
+msgstr "خروج"
+
+#: dashboard/dashboard.py:232 dashboard/modules.py:299
+msgid "Applications"
+msgstr "اپلیکیشن ها"
+
+#: dashboard/dashboard.py:240
+msgid "Administration"
+msgstr "راهبری"
+
+#: dashboard/dashboard.py:248 dashboard/modules.py:446
+msgid "Recent Actions"
+msgstr "کنش‌های اخیر"
+
+#: dashboard/dashboard.py:256
+msgid "Latest Django News"
+msgstr "آخرین خبرهای جنگو"
+
+#: dashboard/dashboard.py:265
+msgid "Support"
+msgstr "پشتیبانی"
+
+#: dashboard/dashboard.py:268
+msgid "Django documentation"
+msgstr "مستندات جنگو"
+
+#: dashboard/dashboard.py:273
+msgid "Django \"django-users\" mailing list"
+msgstr "فهرست ایمیلی جنگو (django-users)"
+
+#: dashboard/dashboard.py:278
+msgid "Django irc channel"
+msgstr "کانال‌های irc جنگو"
+
+#: dashboard/dashboard.py:293
+msgid "Application models"
+msgstr "مدل‌های اپلیکیشن"
+
+#: dashboard/dashboard_modules/google_analytics.py:149
+#: dashboard/dashboard_modules/yandex_metrika.py:107
+msgid "Revoke access"
+msgstr "گرفتن دسترسی"
+
+#: dashboard/dashboard_modules/google_analytics.py:154
+#: dashboard/dashboard_modules/yandex_metrika.py:112
+msgid "Grant access"
+msgstr "دادن دسترسی"
+
+#: dashboard/dashboard_modules/google_analytics.py:167
+#: dashboard/dashboard_modules/yandex_metrika.py:122
+msgid "Access"
+msgstr "دسترسی"
+
+#: dashboard/dashboard_modules/google_analytics.py:168
+#: dashboard/dashboard_modules/yandex_metrika.py:123
+msgid "Counter"
+msgstr "شمارشگر"
+
+#: dashboard/dashboard_modules/google_analytics.py:169
+#: dashboard/dashboard_modules/yandex_metrika.py:124
+msgid "Statistics period"
+msgstr "دوره آماری"
+
+#: dashboard/dashboard_modules/google_analytics.py:170
+#: dashboard/dashboard_modules/yandex_metrika.py:125
+msgid "Today"
+msgstr "امروز"
+
+#: dashboard/dashboard_modules/google_analytics.py:171
+#: dashboard/dashboard_modules/yandex_metrika.py:126
+msgid "Last week"
+msgstr "هفته پیش"
+
+#: dashboard/dashboard_modules/google_analytics.py:172
+#: dashboard/dashboard_modules/yandex_metrika.py:127
+msgid "Last month"
+msgstr "ماه پیش"
+
+#: dashboard/dashboard_modules/google_analytics.py:173
+#: dashboard/dashboard_modules/yandex_metrika.py:128
+msgid "Last quarter"
+msgstr "سه ماه پیش"
+
+#: dashboard/dashboard_modules/google_analytics.py:174
+#: dashboard/dashboard_modules/yandex_metrika.py:129
+msgid "Last year"
+msgstr "سال پیش"
+
+#: dashboard/dashboard_modules/google_analytics.py:184
+#: dashboard/dashboard_modules/yandex_metrika.py:139
+msgid "none"
+msgstr "هیچکدام"
+
+#: dashboard/dashboard_modules/google_analytics.py:187
+#: dashboard/dashboard_modules/yandex_metrika.py:142
+msgid "grant access first"
+msgstr "ابتدا دسترسی بدهید"
+
+#: dashboard/dashboard_modules/google_analytics.py:187
+#: dashboard/dashboard_modules/yandex_metrika.py:142
+msgid "counters loading failed"
+msgstr "بارگذاری شمارشگر ناموفق بود"
+
+#: dashboard/dashboard_modules/google_analytics.py:192
+#: dashboard/dashboard_modules/yandex_metrika.py:147
+msgid "Show"
+msgstr "نمایش"
+
+#: dashboard/dashboard_modules/google_analytics.py:193
+#: dashboard/dashboard_modules/google_analytics.py:330
+#: dashboard/templates/jet.dashboard/modules/google_analytics_period_visitors.html:15
+msgid "users"
+msgstr "کاربران"
+
+#: dashboard/dashboard_modules/google_analytics.py:194
+#: dashboard/dashboard_modules/google_analytics.py:331
+#: dashboard/templates/jet.dashboard/modules/google_analytics_period_visitors.html:16
+msgid "sessions"
+msgstr "نشست‌ها"
+
+#: dashboard/dashboard_modules/google_analytics.py:195
+#: dashboard/dashboard_modules/google_analytics.py:332
+#: dashboard/dashboard_modules/yandex_metrika.py:150
+#: dashboard/dashboard_modules/yandex_metrika.py:271
+#: dashboard/templates/jet.dashboard/modules/google_analytics_period_visitors.html:17
+#: dashboard/templates/jet.dashboard/modules/yandex_metrika_period_visitors.html:17
+msgid "views"
+msgstr "نماها"
+
+#: dashboard/dashboard_modules/google_analytics.py:197
+#: dashboard/dashboard_modules/google_analytics.py:205
+#: dashboard/dashboard_modules/yandex_metrika.py:152
+#: dashboard/dashboard_modules/yandex_metrika.py:160
+msgid "Group"
+msgstr "گروه"
+
+#: dashboard/dashboard_modules/google_analytics.py:198
+#: dashboard/dashboard_modules/google_analytics.py:206
+#: dashboard/dashboard_modules/yandex_metrika.py:153
+#: dashboard/dashboard_modules/yandex_metrika.py:161
+msgid "By day"
+msgstr "روزانه"
+
+#: dashboard/dashboard_modules/google_analytics.py:199
+#: dashboard/dashboard_modules/google_analytics.py:207
+#: dashboard/dashboard_modules/yandex_metrika.py:154
+#: dashboard/dashboard_modules/yandex_metrika.py:162
+msgid "By week"
+msgstr "هفتگی"
+
+#: dashboard/dashboard_modules/google_analytics.py:200
+#: dashboard/dashboard_modules/google_analytics.py:208
+#: dashboard/dashboard_modules/yandex_metrika.py:155
+#: dashboard/dashboard_modules/yandex_metrika.py:163
+msgid "By month"
+msgstr "ماهانه"
+
+#: dashboard/dashboard_modules/google_analytics.py:281
+#, python-format
+msgid ""
+"Please <a href=\"%s\">attach Google account and choose Google Analytics "
+"counter</a> to start using widget"
+msgstr ""
+"لطفا برای شروع به کار این ویجت <a href=\"%s\">حساب گوگل را متصل و Google "
+"Analytics را انتخاب</a> نمایید"
+
+#: dashboard/dashboard_modules/google_analytics.py:284
+#, python-format
+msgid ""
+"Please <a href=\"%s\">select Google Analytics counter</a> to start using "
+"widget"
+msgstr ""
+"لطفا برای شروع به کار این ویجت <a href=\"%s\">شمارنده Google Analytics را "
+"انتخاب</a> نمایید"
+
+#: dashboard/dashboard_modules/google_analytics.py:303
+#: dashboard/dashboard_modules/google_analytics_views.py:46
+#: dashboard/dashboard_modules/yandex_metrika.py:240
+#: dashboard/dashboard_modules/yandex_metrika_views.py:41
+msgid "API request failed."
+msgstr "درخواست API ناموفق بود."
+
+#: dashboard/dashboard_modules/google_analytics.py:305
+#: dashboard/dashboard_modules/yandex_metrika.py:242
+#, python-format
+msgid " Try to <a href=\"%s\">revoke and grant access</a> again"
+msgstr " سعی کنید تا مجددا <a href=\"%s\">دسترسی را گرفته یا بدهید</a> again"
+
+#: dashboard/dashboard_modules/google_analytics.py:315
+msgid "Google Analytics visitors totals"
+msgstr "تعداد کل بازدیدکننده های Google Analytics"
+
+#: dashboard/dashboard_modules/google_analytics.py:334
+#: dashboard/dashboard_modules/google_analytics.py:392
+#: dashboard/dashboard_modules/google_analytics.py:442
+#: dashboard/dashboard_modules/yandex_metrika.py:273
+#: dashboard/dashboard_modules/yandex_metrika.py:325
+#: dashboard/dashboard_modules/yandex_metrika.py:369
+msgid "Bad server response"
+msgstr "پاسخ نامناسب از سمت سرور"
+
+#: dashboard/dashboard_modules/google_analytics.py:344
+msgid "Google Analytics visitors chart"
+msgstr "نمودار بازدیدکنندگان Google Analytics"
+
+#: dashboard/dashboard_modules/google_analytics.py:402
+msgid "Google Analytics period visitors"
+msgstr "بازدیدکنندگان دوره ای Google Analytics"
+
+#: dashboard/dashboard_modules/google_analytics_views.py:30
+#: dashboard/dashboard_modules/google_analytics_views.py:50
+#: dashboard/dashboard_modules/yandex_metrika_views.py:27
+#: dashboard/dashboard_modules/yandex_metrika_views.py:49
+msgid "Module not found"
+msgstr "ماژول پیدا نشد"
+
+#: dashboard/dashboard_modules/google_analytics_views.py:48
+#: dashboard/dashboard_modules/yandex_metrika_views.py:47
+msgid "Bad arguments"
+msgstr "پارامترهای نامناسب"
+
+#: dashboard/dashboard_modules/yandex_metrika.py:148
+#: dashboard/dashboard_modules/yandex_metrika.py:269
+#: dashboard/templates/jet.dashboard/modules/yandex_metrika_period_visitors.html:15
+msgid "visitors"
+msgstr "بازدیدکنندگان"
+
+#: dashboard/dashboard_modules/yandex_metrika.py:149
+#: dashboard/dashboard_modules/yandex_metrika.py:270
+#: dashboard/templates/jet.dashboard/modules/yandex_metrika_period_visitors.html:16
+msgid "visits"
+msgstr "بازدیدها"
+
+#: dashboard/dashboard_modules/yandex_metrika.py:223
+#, python-format
+msgid ""
+"Please <a href=\"%s\">attach Yandex account and choose Yandex Metrika "
+"counter</a> to start using widget"
+msgstr ""
+"لطفا Please <a href=\"%s\">حساب Yandex را متصل و شمارشگر Yandex Metrika</a> "
+"را انتخاب نمایید"
+
+#: dashboard/dashboard_modules/yandex_metrika.py:226
+#, python-format
+msgid ""
+"Please <a href=\"%s\">select Yandex Metrika counter</a> to start using widget"
+msgstr ""
+"لطفا <a href=\"%s\">شمارشگر Yandex Metrika</a> را برای شروع انتخاب نمایید"
+
+#: dashboard/dashboard_modules/yandex_metrika.py:254
+msgid "Yandex Metrika visitors totals"
+msgstr "کل بازدیدهای Yandex Metrika"
+
+#: dashboard/dashboard_modules/yandex_metrika.py:283
+msgid "Yandex Metrika visitors chart"
+msgstr "نمودار بازدیدهای Yandex Metrika"
+
+#: dashboard/dashboard_modules/yandex_metrika.py:335
+msgid "Yandex Metrika period visitors"
+msgstr "بازدیدکنندگان دوره ای Yandex Metrika"
+
+#: dashboard/models.py:11 dashboard/modules.py:164
+msgid "Title"
+msgstr "عنوان"
+
+#: dashboard/models.py:12
+msgid "module"
+msgstr "ماژول"
+
+#: dashboard/models.py:13
+msgid "application name"
+msgstr "نام اپلیکیشن"
+
+#: dashboard/models.py:14
+msgid "user"
+msgstr "کاربر"
+
+#: dashboard/models.py:15
+msgid "column"
+msgstr "ستون"
+
+#: dashboard/models.py:16
+msgid "order"
+msgstr "ترتیب"
+
+#: dashboard/models.py:17
+msgid "settings"
+msgstr "تنظیمات"
+
+#: dashboard/models.py:18
+msgid "children"
+msgstr "زیرگروه‌ها"
+
+#: dashboard/models.py:19
+msgid "collapsed"
+msgstr "بازشده"
+
+#: dashboard/models.py:22
+msgid "user dashboard module"
+msgstr "ماژول داشبورد کاربر"
+
+#: dashboard/models.py:23
+msgid "user dashboard modules"
+msgstr "ماژول های داشبورد کاربر"
+
+#: dashboard/modules.py:163
+msgid "URL"
+msgstr "نشانی‌ اینترنتی"
+
+#: dashboard/modules.py:165
+msgid "External link"
+msgstr "لینک های خارجی"
+
+#: dashboard/modules.py:169
+msgid "Layout"
+msgstr "چینش"
+
+#: dashboard/modules.py:169
+msgid "Stacked"
+msgstr "پشته شدن"
+
+#: dashboard/modules.py:169
+msgid "Inline"
+msgstr "درون خطی"
+
+#: dashboard/modules.py:215 dashboard/modules.py:239
+msgid "Links"
+msgstr "لینک‌ها"
+
+#: dashboard/modules.py:238
+msgid "Link"
+msgstr "لینک"
+
+#: dashboard/modules.py:372
+msgid "Models"
+msgstr "مدل‌ها"
+
+#: dashboard/modules.py:416 dashboard/modules.py:523
+msgid "Items limit"
+msgstr "محدوده آیتم‌ها"
+
+#: dashboard/modules.py:524
+msgid "Feed URL"
+msgstr "نشانی فید"
+
+#: dashboard/modules.py:555
+msgid "RSS Feed"
+msgstr "فید RSS"
+
+#: dashboard/modules.py:601
+msgid "You must install the FeedParser python module"
+msgstr "ابتدا باید ماژول پایتونی FeedParser را نصب کنید"
+
+#: dashboard/modules.py:606
+msgid "You must provide a valid feed URL"
+msgstr "ابتدا باید نشانی صحیح فید را وارد کنید"
+
+#: dashboard/templates/jet.dashboard/dashboard.html:17
+msgid "Delete widget"
+msgstr "حذف ویجت"
+
+#: dashboard/templates/jet.dashboard/dashboard.html:18
+msgid "Are you sure want to delete this widget?"
+msgstr "آیا میخواهید این ویجت حذف شود؟"
+
+#: dashboard/templates/jet.dashboard/dashboard_tools.html:12
+msgid "widgets"
+msgstr "ویجت‌ها"
+
+#: dashboard/templates/jet.dashboard/dashboard_tools.html:13
+msgid "available"
+msgstr "موجود"
+
+#: dashboard/templates/jet.dashboard/dashboard_tools.html:18
+msgid "initials"
+msgstr "مقادیر اولیه"
+
+#: dashboard/templates/jet.dashboard/dashboard_tools.html:23
+#: dashboard/templates/jet.dashboard/modules/app_list.html:18
+#: dashboard/templates/jet.dashboard/modules/model_list.html:8
+msgid "Add"
+msgstr "افزودن"
+
+#: dashboard/templates/jet.dashboard/dashboard_tools.html:26
+#: dashboard/templates/jet.dashboard/dashboard_tools.html:32
+msgid "Reset widgets"
+msgstr "بازنشانی ویجت‌ها"
+
+#: dashboard/templates/jet.dashboard/dashboard_tools.html:33
+msgid "Are you sure want to reset widgets?"
+msgstr "آیا میخواهید ویجت ها بازنشانی شوند؟"
+
+#: dashboard/templates/jet.dashboard/module.html:9
+#: dashboard/templates/jet.dashboard/modules/app_list.html:24
+#: dashboard/templates/jet.dashboard/modules/model_list.html:14
+#: dashboard/views.py:94
+msgid "Change"
+msgstr "تغییر"
+
+#: dashboard/templates/jet.dashboard/module.html:12
+#: dashboard/templates/jet.dashboard/update_module.html:55
+#: dashboard/templates/jet.dashboard/update_module.html:57
+msgid "Delete"
+msgstr "حذف"
+
+#: dashboard/templates/jet.dashboard/modules/app_list.html:7
+#: dashboard/templates/jet.dashboard/modules/app_list.html:10
+#, python-format
+msgid "Models in the %(name)s application"
+msgstr "مدل‌ها در اپلیکیشن %(name)s "
+
+#: dashboard/templates/jet.dashboard/modules/feed.html:13
+#: dashboard/templates/jet.dashboard/modules/google_analytics_period_visitors.html:34
+#: dashboard/templates/jet.dashboard/modules/google_analytics_visitors_chart.html:30
+#: dashboard/templates/jet.dashboard/modules/google_analytics_visitors_totals.html:23
+#: dashboard/templates/jet.dashboard/modules/link_list.html:26
+#: dashboard/templates/jet.dashboard/modules/yandex_metrika_period_visitors.html:34
+#: dashboard/templates/jet.dashboard/modules/yandex_metrika_visitors_chart.html:30
+#: dashboard/templates/jet.dashboard/modules/yandex_metrika_visitors_totals.html:23
+msgid "Nothing to show"
+msgstr "چیزی برای نمایش وجود ندارد"
+
+#: dashboard/templates/jet.dashboard/modules/google_analytics_period_visitors.html:14
+#: dashboard/templates/jet.dashboard/modules/yandex_metrika_period_visitors.html:14
+msgid "Date"
+msgstr "تاریخ"
+
+#: dashboard/templates/jet.dashboard/modules/recent_actions.html:6
+msgid "None available"
+msgstr "هیچکدام آماده نیست"
+
+#: dashboard/templates/jet.dashboard/modules/recent_actions.html:30
+msgid "Unknown content"
+msgstr "محتوای ناشناخته"
+
+#: dashboard/templates/jet.dashboard/update_module.html:7
+msgid "Home"
+msgstr "خانه"
+
+#: dashboard/templates/jet.dashboard/update_module.html:25
+msgid "Please correct the errors below."
+msgstr "لطفا خطاهای زیر را برطرف نمایید."
+
+#: dashboard/templates/jet.dashboard/update_module.html:69
+#, python-format
+msgid "Add another %(verbose_name)s"
+msgstr "افزودن یک %(verbose_name)s دیگر"
+
+#: dashboard/templates/jet.dashboard/update_module.html:81
+msgid "Save"
+msgstr "ذخیره"
+
+#: dashboard/views.py:23
+msgid "Widget was successfully updated"
+msgstr "ویجت با موفقیت بروزرسانی شد"
+
+#: dashboard/views.py:98 dashboard/views.py:99
+msgid "Items"
+msgstr "آیتم‌ها"
+
+#: dashboard/views.py:165
+msgid "Widget has been successfully added"
+msgstr "ویجت با موفقیت افزوده شد"

+ 30 - 0
jet/dashboard/locale/fa/LC_MESSAGES/djangojs.po

@@ -0,0 +1,30 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-09-11 12:44+0000\n"
+"PO-Revision-Date: 2017-05-25 12:31+0430\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Pyzenberg <pyzenberg@gmail.com>\n"
+"Language-Team: \n"
+"X-Generator: Poedit 1.8.9\n"
+
+#: static/jet/js/src/features/dashboard.js:79
+#: static/jet/js/src/features/dashboard.js:208
+msgid "Cancel"
+msgstr "لغو"
+
+#: static/jet/js/src/features/dashboard.js:203
+msgid "Delete"
+msgstr "حذف"
+
+#: static/jet/js/src/features/dashboard.js:74
+msgid "Yes"
+msgstr "بله"

+ 2 - 1
jet/dashboard/templatetags/jet_dashboard_tags.py

@@ -3,9 +3,10 @@ from django import template
 from jet.dashboard.utils import get_current_dashboard
 
 register = template.Library()
+assignment_tag = register.assignment_tag if hasattr(register, 'assignment_tag') else register.simple_tag
 
 
-@register.assignment_tag(takes_context=True)
+@assignment_tag(takes_context=True)
 def get_dashboard(context, location):
     dashboard_cls = get_current_dashboard(location)
 

+ 10 - 2
jet/dashboard/urls.py

@@ -1,11 +1,19 @@
 import django
 from django.conf.urls import url
-from django.views.i18n import javascript_catalog
+
+try:
+    from django.views.i18n import JavaScriptCatalog
+    javascript_catalog = JavaScriptCatalog.as_view()
+except ImportError:  # Django < 2.0
+    from django.views.i18n import javascript_catalog
+
 from jet.dashboard import dashboard
 from jet.dashboard.views import update_dashboard_modules_view, add_user_dashboard_module_view, \
     update_dashboard_module_collapse_view, remove_dashboard_module_view, UpdateDashboardModuleView, \
     load_dashboard_module_view, reset_dashboard_view
 
+app_name = 'dashboard'
+
 urlpatterns = [
     url(
         r'^module/(?P<pk>\d+)/$',
@@ -45,7 +53,7 @@ urlpatterns = [
     url(
         r'^jsi18n/$',
         javascript_catalog,
-        {'packages': ('jet',)},
+        {'packages': 'jet'},
         name='jsi18n'
     ),
 ]

+ 2 - 2
jet/dashboard/views.py

@@ -11,7 +11,7 @@ from django.views.decorators.http import require_POST, require_GET
 from jet.dashboard.forms import UpdateDashboardModulesForm, AddUserDashboardModuleForm, \
     UpdateDashboardModuleCollapseForm, RemoveDashboardModuleForm, ResetDashboardForm
 from jet.dashboard.models import UserDashboardModule
-from jet.utils import JsonResponse, get_app_list, SuccessMessageMixin
+from jet.utils import JsonResponse, get_app_list, SuccessMessageMixin, user_is_authenticated
 from django.views.generic import UpdateView
 from django.utils.translation import ugettext_lazy as _
 
@@ -216,7 +216,7 @@ def load_dashboard_module_view(request, pk):
     result = {'error': False}
 
     try:
-        if not request.user.is_authenticated() or not request.user.is_staff:
+        if not user_is_authenticated(request.user) or not request.user.is_staff:
             raise ValidationError('error')
 
         instance = UserDashboardModule.objects.get(pk=pk, user=request.user.pk)

+ 6 - 5
jet/forms.py

@@ -5,8 +5,9 @@ from django.contrib.contenttypes.models import ContentType
 from django.core.exceptions import ValidationError
 from django.db.models import Q
 import operator
+
 from jet.models import Bookmark, PinnedApplication
-from jet.utils import get_model_instance_label
+from jet.utils import get_model_instance_label, user_is_authenticated
 from functools import reduce
 
 try:
@@ -27,7 +28,7 @@ class AddBookmarkForm(forms.ModelForm):
 
     def clean(self):
         data = super(AddBookmarkForm, self).clean()
-        if not self.request.user.is_authenticated() or not self.request.user.is_staff:
+        if not user_is_authenticated(self.request.user) or not self.request.user.is_staff:
             raise ValidationError('error')
         if not self.request.user.has_perm('jet.change_bookmark'):
             raise ValidationError('error')
@@ -49,7 +50,7 @@ class RemoveBookmarkForm(forms.ModelForm):
 
     def clean(self):
         data = super(RemoveBookmarkForm, self).clean()
-        if not self.request.user.is_authenticated() or not self.request.user.is_staff:
+        if not user_is_authenticated(self.request.user) or not self.request.user.is_staff:
             raise ValidationError('error')
         if self.instance.user != self.request.user.pk:
             raise ValidationError('error')
@@ -71,7 +72,7 @@ class ToggleApplicationPinForm(forms.ModelForm):
 
     def clean(self):
         data = super(ToggleApplicationPinForm, self).clean()
-        if not self.request.user.is_authenticated() or not self.request.user.is_staff:
+        if not user_is_authenticated(self.request.user) or not self.request.user.is_staff:
             raise ValidationError('error')
         return data
 
@@ -108,7 +109,7 @@ class ModelLookupForm(forms.Form):
     def clean(self):
         data = super(ModelLookupForm, self).clean()
 
-        if not self.request.user.is_authenticated() or not self.request.user.is_staff:
+        if not user_is_authenticated(self.request.user) or not self.request.user.is_staff:
             raise ValidationError('error')
 
         try:

+ 164 - 0
jet/locale/fa/LC_MESSAGES/django.po

@@ -0,0 +1,164 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-25 12:27+0430\n"
+"PO-Revision-Date: 2017-05-25 12:30+0430\n"
+"Last-Translator: Pyzenberg <pyzenberg@gmail.com>\n"
+"Language-Team: \n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Poedit 1.8.9\n"
+
+#: filters.py:70
+msgid "From date"
+msgstr "از تاریخ"
+
+#: filters.py:76
+msgid "To date"
+msgstr "تا تاریخ"
+
+#: models.py:9 templates/admin/base.html:287
+msgid "URL"
+msgstr "آدرس"
+
+#: models.py:10
+msgid "title"
+msgstr "عنوان"
+
+#: models.py:11 models.py:26
+msgid "user"
+msgstr "کاربر"
+
+#: models.py:12 models.py:27
+msgid "date created"
+msgstr "تاریخ ایجاد"
+
+#: models.py:15
+msgid "bookmark"
+msgstr "بوکمارک"
+
+#: models.py:16 templates/admin/base.html:303
+msgid "bookmarks"
+msgstr "بوکمارک"
+
+#: models.py:25
+msgid "application name"
+msgstr "نام اپلیکیشن"
+
+#: models.py:30
+msgid "pinned application"
+msgstr "اپلیکیشن پین شده"
+
+#: models.py:31
+msgid "pinned applications"
+msgstr "اپلیکیشن های پین شده"
+
+#: templates/admin/base.html:57
+msgid "Welcome,"
+msgstr "خوش آمدید،"
+
+#: templates/admin/base.html:62 templates/admin/base.html:178
+msgid "View site"
+msgstr "نمایش سایت"
+
+#: templates/admin/base.html:67 templates/admin/base.html:187
+msgid "Documentation"
+msgstr "مستندات"
+
+#: templates/admin/base.html:71
+msgid "Change password"
+msgstr "تغییر رمز عبور"
+
+#: templates/admin/base.html:73
+msgid "Log out"
+msgstr "خروج"
+
+#: templates/admin/base.html:83 templates/admin/base.html:170
+msgid "Home"
+msgstr "خانه"
+
+#: templates/admin/base.html:150
+msgid "back"
+msgstr "بازگشت"
+
+#: templates/admin/base.html:231
+msgid "Applications"
+msgstr "اپلیکیشن ها"
+
+#: templates/admin/base.html:255
+msgid "Hide applications"
+msgstr "اپلیکیشن های مخفی شده"
+
+#: templates/admin/base.html:256
+msgid "Show hidden"
+msgstr "نمایش پنهان‌شده"
+
+#: templates/admin/base.html:282 templates/admin/base.html:301
+msgid "Add bookmark"
+msgstr "افزودن بوکمارک"
+
+#: templates/admin/base.html:285
+msgid "Title"
+msgstr "عنوان"
+
+#: templates/admin/base.html:295
+msgid "Delete bookmark"
+msgstr "حذف بوکمارک"
+
+#: templates/admin/base.html:296
+msgid "Are you sure want to delete this bookmark?"
+msgstr "آیا می‌خواهید بوکمارک‌ را حذف کنید؟"
+
+#: templates/admin/base.html:311 templates/admin/base.html:318
+#: templates/admin/edit_inline/compact.html:3
+msgid "Remove"
+msgstr "حذف"
+
+#: templates/admin/base.html:340 templates/rangefilter/date_filter.html:33
+msgid "Search"
+msgstr "جستجو"
+
+#: templates/admin/base.html:345
+msgid "Application page"
+msgstr "صفحه اپلیکیشن"
+
+#: templates/admin/base.html:371
+msgid "current theme"
+msgstr "تم فعلی"
+
+#: templates/admin/edit_inline/compact.html:12
+#, python-format
+msgid "Add another %(verbose_name)s"
+msgstr "افزودن %(verbose_name)s دیگر"
+
+#: templates/admin/edit_inline/compact.html:37
+msgid "Change"
+msgstr "تغییر"
+
+#: templates/admin/edit_inline/compact.html:43
+msgid "View on site"
+msgstr "نمایش در سایت"
+
+#: templates/admin/popup_response.html:4
+msgid "Popup closing..."
+msgstr "بستن پاپ‌آپ"
+
+#: templates/jet/related_field_ajax_list_filter.html:2
+#: templates/rangefilter/date_filter.html:2
+#: templates/rangefilter/date_filter.html:16
+#, python-format
+msgid " By %(filter_title)s "
+msgstr "برپایه %(filter_title)s "
+
+#: templates/rangefilter/date_filter.html:34
+msgid "Reset"
+msgstr "بازنشانی"

+ 47 - 0
jet/locale/fa/LC_MESSAGES/djangojs.po

@@ -0,0 +1,47 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-09-11 12:44+0000\n"
+"PO-Revision-Date: 2017-05-25 12:29+0430\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Pyzenberg <pyzenberg@gmail.com>\n"
+"Language-Team: \n"
+"X-Generator: Poedit 1.8.9\n"
+
+#: static/jet/js/src/features/sidebar/bookmarks.js:80
+msgid "Add"
+msgstr "افزودن"
+
+#: static/jet/js/src/features/sidebar/bookmarks.js:85
+#: static/jet/js/src/features/sidebar/bookmarks.js:118
+msgid "Cancel"
+msgstr "لغو"
+
+#: static/jet/js/src/features/sidebar/bookmarks.js:113
+msgid "Delete"
+msgstr "حذف"
+
+#: static/jet/js/src/features/changeform.js:11
+msgid "Warning: you have unsaved changes"
+msgstr "هشدار: تغییرات ذخیره نشده وجود دارد"
+
+#: static/jet/js/src/features/selects.js:109
+msgid "select all"
+msgstr "انتخاب همه"
+
+#: static/jet/js/src/features/selects.js:112
+msgid "deselect all"
+msgstr "لغو انتخاب همه"
+
+#: static/jet/js/src/layout-updaters/changeform-tabs.js:15
+#: static/jet/js/src/layout-updaters/changeform-tabs.js:30
+msgid "General"
+msgstr "کلی"

+ 0 - 0
jet/locale/pt-br/LC_MESSAGES/django.mo → jet/locale/pt_BR/LC_MESSAGES/django.mo


+ 0 - 0
jet/locale/pt-br/LC_MESSAGES/django.po → jet/locale/pt_BR/LC_MESSAGES/django.po


+ 0 - 0
jet/locale/pt-br/LC_MESSAGES/djangojs.mo → jet/locale/pt_BR/LC_MESSAGES/djangojs.mo


+ 0 - 0
jet/locale/pt-br/LC_MESSAGES/djangojs.po → jet/locale/pt_BR/LC_MESSAGES/djangojs.po


+ 0 - 0
jet/locale/zh_cn/LC_MESSAGES/django.mo → jet/locale/zh_CN/LC_MESSAGES/django.mo


+ 0 - 0
jet/locale/zh_cn/LC_MESSAGES/django.po → jet/locale/zh_CN/LC_MESSAGES/django.po


+ 1 - 0
jet/static/jet/css/_header.scss

@@ -9,6 +9,7 @@
   padding: 14px 32px 14px 36px;
   text-align: center;
   position: relative;
+  height: auto !important;
   min-height: 52px;
   box-sizing: border-box;
 

File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/default/base.css


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/default/base.css.map


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/green/base.css


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/green/base.css.map


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/light-blue/base.css


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/light-blue/base.css.map


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/light-gray/base.css


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/light-gray/base.css.map


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/light-green/base.css


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/light-green/base.css.map


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/light-violet/base.css


File diff suppressed because it is too large
+ 0 - 0
jet/static/jet/css/themes/light-violet/base.css.map


File diff suppressed because it is too large
+ 0 - 1
jet/static/jet/css/vendor.css


+ 8 - 4
jet/templates/admin/base.html

@@ -17,11 +17,14 @@
 
 {% block extrastyle %}{% endblock %}
 {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
+{% jet_get_date_format as date_format %}
+{% jet_get_time_format as time_format %}
+{% jet_get_datetime_format as datetime_format %}
 
 <script type="text/javascript" charset="utf-8">
-    var DATE_FORMAT = "{% jet_get_date_format %}";
-    var TIME_FORMAT = "{% jet_get_time_format %}";
-    var DATETIME_FORMAT = "{% jet_get_datetime_format %}";
+    var DATE_FORMAT = "{{ date_format }}";
+    var TIME_FORMAT = "{{ time_format }}";
+    var DATETIME_FORMAT = "{{ datetime_format }}";
 </script>
 <script type="text/javascript" src="{% url 'jet:jsi18n' %}"></script>
 <script src="{% static "jet/js/build/bundle.min.js" as url %}{{ url|jet_append_version }}"></script>
@@ -109,7 +112,8 @@
 
     {% block footer %}<div id="footer"></div>{% endblock %}
 
-    {% jet_delete_confirmation_context %}
+    {% jet_delete_confirmation_context as delete_confirmation_context %}
+    {{ delete_confirmation_context }}
 
     {% jet_change_form_sibling_links_enabled as show_siblings %}
     {% if change and show_siblings %}

+ 16 - 15
jet/templatetags/jet_tags.py

@@ -24,29 +24,30 @@ except ImportError:
 
 
 register = template.Library()
+assignment_tag = register.assignment_tag if hasattr(register, 'assignment_tag') else register.simple_tag
 
 
-@register.simple_tag
+@assignment_tag
 def jet_get_date_format():
     return get_format('DATE_INPUT_FORMATS')[0]
 
 
-@register.simple_tag
+@assignment_tag
 def jet_get_time_format():
     return get_format('TIME_INPUT_FORMATS')[0]
 
 
-@register.simple_tag
+@assignment_tag
 def jet_get_datetime_format():
     return get_format('DATETIME_INPUT_FORMATS')[0]
 
 
-@register.assignment_tag(takes_context=True)
+@assignment_tag(takes_context=True)
 def jet_get_menu(context):
     return get_menu_items(context)
 
 
-@register.assignment_tag
+@assignment_tag
 def jet_get_bookmarks(user):
     if user is None:
         return None
@@ -110,7 +111,7 @@ def jet_select2_lookups(field):
     return field
 
 
-@register.assignment_tag(takes_context=True)
+@assignment_tag(takes_context=True)
 def jet_get_current_theme(context):
     if 'request' in context and 'JET_THEME' in context['request'].COOKIES:
         theme = context['request'].COOKIES['JET_THEME']
@@ -121,12 +122,12 @@ def jet_get_current_theme(context):
     return settings.JET_DEFAULT_THEME
 
 
-@register.assignment_tag
+@assignment_tag
 def jet_get_themes():
     return settings.JET_THEMES
 
 
-@register.assignment_tag
+@assignment_tag
 def jet_get_current_version():
     return VERSION
 
@@ -139,12 +140,12 @@ def jet_append_version(url):
         return '%s?v=%s' % (url, VERSION)
 
 
-@register.assignment_tag
+@assignment_tag
 def jet_get_side_menu_compact():
     return settings.JET_SIDE_MENU_COMPACT
 
 
-@register.assignment_tag
+@assignment_tag
 def jet_change_form_sibling_links_enabled():
     return settings.JET_CHANGE_FORM_SIBLING_LINKS
 
@@ -198,17 +199,17 @@ def jet_sibling_object(context, next):
     }
 
 
-@register.assignment_tag(takes_context=True)
+@assignment_tag(takes_context=True)
 def jet_previous_object(context):
     return jet_sibling_object(context, False)
 
 
-@register.assignment_tag(takes_context=True)
+@assignment_tag(takes_context=True)
 def jet_next_object(context):
     return jet_sibling_object(context, True)
 
 
-@register.assignment_tag(takes_context=True)
+@assignment_tag(takes_context=True)
 def jet_popup_response_data(context):
     if context.get('popup_response_data'):
         return context['popup_response_data']
@@ -221,14 +222,14 @@ def jet_popup_response_data(context):
     })
 
 
-@register.simple_tag(takes_context=True)
+@assignment_tag(takes_context=True)
 def jet_delete_confirmation_context(context):
     if context.get('deletable_objects') is None and context.get('deleted_objects') is None:
         return ''
     return mark_safe('<div class="delete-confirmation-marker"></div>')
 
 
-@register.assignment_tag
+@assignment_tag
 def jet_static_translation_urls():
     language_codes = get_possible_language_codes()
 

+ 1 - 1
jet/tests/models.py

@@ -13,7 +13,7 @@ class TestModel(models.Model):
 
 @python_2_unicode_compatible
 class RelatedToTestModel(models.Model):
-    field = models.ForeignKey(TestModel)
+    field = models.ForeignKey(TestModel, on_delete=models.CASCADE)
 
     def __str__(self):
         return self.field

+ 1 - 1
jet/tests/settings.py

@@ -24,7 +24,7 @@ INSTALLED_APPS = (
     'jet.tests',
 )
 
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE = MIDDLEWARE_CLASSES = (
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',

+ 17 - 6
jet/tests/urls.py

@@ -4,12 +4,23 @@ from django.contrib import admin
 
 admin.autodiscover()
 
-urlpatterns = [
-    url(r'^jet/', include('jet.urls', 'jet')),
-    url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
-    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
-    url(r'^admin/', include(admin.site.urls)),
-]
+
+try:
+    from django.urls import path
+
+    urlpatterns = [
+        url(r'^jet/', include('jet.urls', 'jet')),
+        url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
+        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+        path('admin/', admin.site.urls),
+    ]
+except ImportError:  # Django < 2.0
+    urlpatterns = [
+        url(r'^jet/', include('jet.urls', 'jet')),
+        url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
+        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+        url(r'^admin/', include(admin.site.urls)),
+    ]
 
 if django.VERSION[:2] < (1, 8):
     from django.conf.urls import patterns

+ 11 - 2
jet/urls.py

@@ -1,8 +1,17 @@
 import django
 from django.conf.urls import url
-from django.views.i18n import javascript_catalog
+
+try:
+    from django.views.i18n import JavaScriptCatalog
+    javascript_catalog = JavaScriptCatalog.as_view()
+except ImportError:  # Django < 2.0
+    from django.views.i18n import javascript_catalog
+
 from jet.views import add_bookmark_view, remove_bookmark_view, toggle_application_pin_view, model_lookup_view
 
+
+app_name = 'jet'
+
 urlpatterns = [
     url(
         r'^add_bookmark/$',
@@ -27,7 +36,7 @@ urlpatterns = [
     url(
         r'^jsi18n/$',
         javascript_catalog,
-        {'packages': ('django.conf', 'django.contrib.admin', 'jet',)},
+        {'packages': 'django.contrib.admin+jet'},
         name='jsi18n'
     ),
 ]

+ 8 - 1
jet/utils.py

@@ -250,7 +250,7 @@ def get_possible_language_codes():
 
 
 def get_original_menu_items(context):
-    if context.get('user') and context['user'].is_authenticated():
+    if context.get('user') and user_is_authenticated(context['user']):
         pinned_apps = PinnedApplication.objects.filter(user=context['user'].pk).values_list('app_label', flat=True)
     else:
         pinned_apps = []
@@ -447,3 +447,10 @@ def context_to_dict(context):
         context = flat
 
     return context
+
+
+def user_is_authenticated(user):
+    if not hasattr(user.is_authenticated, '__call__'):
+        return user.is_authenticated
+    else:
+        return user.is_authenticated()

Some files were not shown because too many files changed in this diff