Skip to content

Commit ded6484

Browse files
committed
Merge branch 'release/1.3.3'
2 parents 5e61f33 + b518b33 commit ded6484

File tree

14 files changed

+366
-139
lines changed

14 files changed

+366
-139
lines changed

adminlteui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = '1.3.2'
1+
version = '1.3.3'
22
default_app_config = 'adminlteui.apps.AdminlteUIConfig'

adminlteui/admin.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
from django.urls import path, reverse
88
from django.template.response import TemplateResponse
99
from django.utils import timezone
10+
from django.utils.encoding import force_str
1011
from django.utils.translation import gettext_lazy as _
1112
from django.utils.html import format_html
1213
from django.conf import settings
13-
from django.http.response import HttpResponse, HttpResponseForbidden
14+
from django.http.response import HttpResponse, HttpResponseForbidden, \
15+
HttpResponseBadRequest
1416
from adminlteui.widgets import AdminlteSelect
1517
from treebeard.admin import TreeAdmin
1618
from treebeard.forms import movenodeform_factory
@@ -225,10 +227,10 @@ def general_option_view(self, request):
225227
@admin.register(Menu)
226228
class MenuAdmin(TreeAdmin):
227229
list_display = ('name', 'position', 'link_type', 'display_link',
228-
'display_content_type', 'display_icon',
230+
'display_content_type', 'priority_level', 'display_icon',
229231
'valid')
230232
list_filter = ('position', 'link_type', 'valid')
231-
list_editable = ('valid',)
233+
list_editable = ('valid', 'priority_level')
232234
form = movenodeform_factory(Menu)
233235
change_list_template = 'adminlte/menu_change_list.html'
234236
change_form_template = 'adminlte/menu_change_form.html'
@@ -250,6 +252,16 @@ def formfield_for_foreignkey(self, db_field, request, **kwargs):
250252

251253
return super().formfield_for_foreignkey(db_field, request, **kwargs)
252254

255+
def changeform_view(self, request, object_id=None, form_url='', extra_context=None):
256+
try:
257+
return super().changeform_view(request, object_id, form_url, extra_context)
258+
except Exception as e:
259+
messages.error(request,
260+
_('Exception raised while add node: %s') % _(
261+
force_str(e)))
262+
return HttpResponseBadRequest(
263+
_('Exception raised while add node: %s') % _(force_str(e)))
264+
253265
def get_urls(self):
254266
base_urls = super().get_urls()
255267
urls = [
283 Bytes
Binary file not shown.

adminlteui/locale/zh-Hans/LC_MESSAGES/django.po

Lines changed: 75 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2019-07-10 22:14+0800\n"
11+
"POT-Creation-Date: 2019-08-06 20:34+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,153 +17,170 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919

20-
#: admin.py:51
20+
#: admin.py:53
2121
msgid "Site Title"
2222
msgstr "站点标题"
2323

24-
#: admin.py:54
24+
#: admin.py:56
2525
msgid "Text to put at the end of each page's tag title."
2626
msgstr "每个页面的标题后缀,对应templates中的site_title标签。"
2727

28-
#: admin.py:55
28+
#: admin.py:57
2929
msgid "Site Header"
3030
msgstr "站点标头"
3131

32-
#: admin.py:58
32+
#: admin.py:60
3333
msgid "Text to put in base page's tag b."
3434
msgstr "右上角文字标头,对应templates中的site_header标签。"
3535

36-
#: admin.py:61
36+
#: admin.py:63
3737
msgid "Site Logo"
3838
msgstr "站点logo"
3939

40-
#: admin.py:65
40+
#: admin.py:67
4141
msgid "Transparent background picture is a good choice."
4242
msgstr "透明背景的图片更适合。"
4343

44-
#: admin.py:67
44+
#: admin.py:69
4545
msgid "Welcome Sign"
4646
msgstr "欢迎标语"
4747

48-
#: admin.py:69
48+
#: admin.py:71
4949
msgid "Login page welcome sign."
5050
msgstr "登录页面欢迎标语"
5151

52-
#: admin.py:72
52+
#: admin.py:74
5353
msgid "Avatar Field"
5454
msgstr "头像字段"
5555

56-
#: admin.py:76
56+
#: admin.py:78
5757
msgid "which field is avatar."
5858
msgstr "用户表中头像对应的字段"
5959

60-
#: admin.py:78
60+
#: admin.py:80
6161
msgid "Show Avatar"
6262
msgstr "显示头像"
6363

64-
#: admin.py:105 admin.py:123
64+
#: admin.py:107 admin.py:125
6565
msgid "site_logo depends on setting.MEDIA_URL and setting.MEDIA_ROOT."
6666
msgstr "site_logo依赖于setting.MEDIA_URL和setting.MEDIA_ROOT。"
6767

68-
#: admin.py:216
68+
#: admin.py:218
6969
msgid "General Option Saved."
7070
msgstr "基本设置保存成功。"
7171

72-
#: admin.py:219
72+
#: admin.py:221
7373
msgid "General Option Save Failed."
7474
msgstr "基本设置保存失败。"
7575

76-
#: admin.py:248 admin.py:324 models.py:49
76+
#: admin.py:250 admin.py:336 models.py:52
7777
msgid "ContentType"
7878
msgstr "关联Model"
7979

80-
#: admin.py:281
80+
#: admin.py:260 admin.py:263
81+
#, python-format
82+
msgid "Exception raised while add node: %s"
83+
msgstr "在添加菜单时,发生异常:%s"
84+
85+
#: admin.py:293
8186
msgid "Menu exchanged, current is `custom menu`."
8287
msgstr "菜单切换成功,当前为`自定义菜单`"
8388

84-
#: admin.py:287
89+
#: admin.py:299
8590
msgid "Menu exchanged, current is `system menu`."
8691
msgstr "菜单切换成功,当前为`系统菜单`"
8792

88-
#: admin.py:308 models.py:41
93+
#: admin.py:320 models.py:43
8994
msgid "Link"
9095
msgstr "链接"
9196

92-
#: admin.py:316 models.py:46
97+
#: admin.py:328 models.py:49
9398
msgid "Icon"
9499
msgstr "图标"
95100

96101
#: apps.py:12 templates/adminlte/general_option.html:13
97102
msgid "AdminSettings"
98103
msgstr "设置"
99104

100-
#: models.py:12
105+
#: models.py:14
101106
msgid "Option Name"
102107
msgstr "名称"
103108

104-
#: models.py:14
109+
#: models.py:16
105110
msgid "Option Value"
106111
msgstr "值"
107112

108-
#: models.py:15 models.py:54
113+
#: models.py:17 models.py:59
109114
msgid "Valid"
110115
msgstr "有效性"
111116

112-
#: models.py:17
117+
#: models.py:19
113118
msgid "CreateTime"
114119
msgstr "创建时间"
115120

116-
#: models.py:19
121+
#: models.py:21
117122
msgid "UpdateTime"
118123
msgstr "更新时间"
119124

120-
#: models.py:25
125+
#: models.py:27
121126
msgid "Options"
122127
msgstr "选项"
123128

124-
#: models.py:26
129+
#: models.py:28
125130
msgid "All Options"
126131
msgstr "所有选项"
127132

128-
#: models.py:31
133+
#: models.py:33
129134
msgid "Internal"
130135
msgstr "内部"
131136

132-
#: models.py:32
137+
#: models.py:34
133138
msgid "External"
134139
msgstr "外部"
135140

136-
#: models.py:33
141+
#: models.py:35
137142
msgid "Divide"
138143
msgstr "链接分组"
139144

140-
#: models.py:35
145+
#: models.py:37
141146
#, fuzzy
142147
#| msgid "username"
143148
msgid "name"
144149
msgstr "用户名"
145150

146-
#: models.py:37
151+
#: models.py:39
147152
msgid "Menu Position"
148153
msgstr "菜单位置"
149154

150-
#: models.py:39
155+
#: models.py:41
151156
msgid "Link Type"
152157
msgstr "链接类型"
153158

154-
#: models.py:42
159+
#: models.py:45
155160
msgid "support admin:index or /admin/ or http://"
156161
msgstr "支持 admin:index 或 /admin/ 或 http://"
157162

158-
#: models.py:52
163+
#: models.py:55
159164
msgid "use for permission control."
160165
msgstr "用于权限控制。"
161166

162-
#: models.py:61
167+
#: models.py:57
168+
msgid "Priority Level"
169+
msgstr "优先级"
170+
171+
#: models.py:58
172+
msgid "The bigger the priority"
173+
msgstr "越大越优先"
174+
175+
#: models.py:71
176+
msgid "max depth is 2."
177+
msgstr "菜单最大深度为2"
178+
179+
#: models.py:78
163180
msgid "Menu"
164181
msgstr "菜单"
165182

166-
#: models.py:62
183+
#: models.py:79
167184
msgid "Menu Setting"
168185
msgstr "菜单设置"
169186

@@ -239,7 +256,7 @@ msgstr ""
239256
#: templates/admin/auth/user/change_password.html:22
240257
#: templates/admin/auth/user/change_password.html:27
241258
#: templates/admin/auth/user/change_password.html:94
242-
#: templates/admin/base.html:151
259+
#: templates/admin/base.html:166
243260
#: templates/registration/password_change_done.html:3
244261
#: templates/registration/password_change_form.html:7
245262
#: templates/registration/password_change_form.html:102
@@ -263,61 +280,61 @@ msgstr ""
263280
msgid "Please correct the errors below."
264281
msgstr ""
265282

266-
#: templates/admin/base.html:104 templates/admin/base.html:120
283+
#: templates/admin/base.html:119 templates/admin/base.html:135
267284
msgid "Super manager"
268285
msgstr "超级管理员"
269286

270-
#: templates/admin/base.html:109 templates/admin/base.html:125
287+
#: templates/admin/base.html:124 templates/admin/base.html:140
271288
msgid "Normal"
272289
msgstr "普通用户"
273290

274-
#: templates/admin/base.html:112 templates/admin/base.html:128
291+
#: templates/admin/base.html:127 templates/admin/base.html:143
275292
msgid "Register time"
276293
msgstr "注册时间"
277294

278-
#: templates/admin/base.html:154
295+
#: templates/admin/base.html:169
279296
#: templates/registration/password_change_done.html:3
280297
#: templates/registration/password_change_form.html:7
281298
msgid "Log out"
282299
msgstr ""
283300

284-
#: templates/admin/base.html:185
301+
#: templates/admin/base.html:200
285302
msgid "Online"
286303
msgstr "在线"
287304

288-
#: templates/admin/base.html:192 templates/admin/search_form.html:20
305+
#: templates/admin/base.html:207 templates/admin/search_form.html:20
289306
msgid "Search"
290307
msgstr "搜索"
291308

292-
#: templates/admin/base.html:202
309+
#: templates/admin/base.html:217
293310
msgid "MAIN NAVIGATION"
294311
msgstr "页面导航"
295312

296-
#: templates/admin/base.html:205
313+
#: templates/admin/base.html:220
297314
msgid "Dashboard"
298315
msgstr "仪表盘"
299316

300-
#: templates/admin/base.html:237
317+
#: templates/admin/base.html:252
301318
msgid "System manage"
302319
msgstr ""
303320

304-
#: templates/admin/base.html:243
321+
#: templates/admin/base.html:258
305322
msgid "Log manage"
306323
msgstr ""
307324

308-
#: templates/admin/base.html:244
325+
#: templates/admin/base.html:259
309326
msgid "System config"
310327
msgstr ""
311328

312-
#: templates/admin/base.html:250
329+
#: templates/admin/base.html:265
313330
msgid "Important"
314331
msgstr ""
315332

316-
#: templates/admin/base.html:251
333+
#: templates/admin/base.html:266
317334
msgid "Warning"
318335
msgstr ""
319336

320-
#: templates/admin/base.html:252
337+
#: templates/admin/base.html:267
321338
msgid "Information"
322339
msgstr ""
323340

@@ -583,11 +600,11 @@ msgstr ""
583600
#: templates/adminlte/general_option.html:14
584601
#: templates/adminlte/general_option.html:18
585602
#: templates/adminlte/general_option.html:27
586-
#: templates/adminlte/general_option.html:36 templatetags/adminlte_menu.py:142
603+
#: templates/adminlte/general_option.html:36 templatetags/adminlte_menu.py:146
587604
msgid "General Option"
588605
msgstr "基本设置"
589606

590-
#: templates/adminlte/menu_change_list.html:4
607+
#: templates/adminlte/menu_change_list.html:16
591608
msgid "Exchange Menu"
592609
msgstr "菜单切换"
593610

@@ -623,3 +640,7 @@ msgid ""
623640
"Please enter your old password, for security's sake, and then enter your new "
624641
"password twice so we can verify you typed it in correctly."
625642
msgstr ""
643+
644+
#: templatetags/adminlte_list.py:172
645+
msgid "Return to ordered tree"
646+
msgstr ""
283 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)