From 2409572486b4461c8df2f71495856002048d9341 Mon Sep 17 00:00:00 2001 From: wuyue Date: Tue, 4 Jul 2023 18:01:46 +0800 Subject: [PATCH 1/5] update changelog --- docs/en/changelog.md | 7 +++++++ docs/zh/changelog.md | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/en/changelog.md b/docs/en/changelog.md index 953b587..835c4c2 100644 --- a/docs/en/changelog.md +++ b/docs/en/changelog.md @@ -1,5 +1,12 @@ # ChangeLog +## [v2.1.0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/2.1.0) +- add date range filter base on daterangepicker +- add min-width for all filter +- change object-tools position +- update locale +- calculate menu active status from server + ## [v2.0.0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/2.0.0) - remove `django-treebeard` deps, fix #28, #29, #30 - remove all adminlte models, make simple diff --git a/docs/zh/changelog.md b/docs/zh/changelog.md index 8344c66..352c834 100644 --- a/docs/zh/changelog.md +++ b/docs/zh/changelog.md @@ -1,5 +1,13 @@ # 更新说明 + +## [v2.1.0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/2.1.0) +- 新增基于daterangepicker的时间过滤器 +- 为所有的filter新增min-width样式 +- 调整change_list视图object-tools的位置,与actions处于同一行 +- 更新locale +- 在服务器端计算菜单的活跃状态,原来通过js在浏览器实现 + ## [v2.0.0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/2.0.0) - 移除 `django-treebeard` 依赖包, 同时修复 #28, #29, #30 - 移除了所有models,不再通过数据库的方式管理自定义菜单及其他选项 From 48bf647aa20b729a2d1ae2e802225dca129c18fe Mon Sep 17 00:00:00 2001 From: wuyue Date: Wed, 5 Jul 2023 11:07:23 +0800 Subject: [PATCH 2/5] fix menu status render issue when access model child url --- adminlteui/core.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/adminlteui/core.py b/adminlteui/core.py index b86ba54..a51e1c4 100644 --- a/adminlteui/core.py +++ b/adminlteui/core.py @@ -37,12 +37,17 @@ def make(self, request, models=None, deep=1, deep_limit=0): if not self.name: menu_item['name'] = model.get('name') menu_item['url'] = model.get('admin_url') + # show menu active when access child url, add/change... page + if menu_item['url'] in request.path: + menu_item['active'] = True elif self.menu_type == 'link': menu_item['url'] = self.url # check permissions when permissions are not None if self.permissions: if request.user.has_perms(self.permissions) is False: return None + if menu_item['url'] == request.path: + menu_item['active'] = True else: # menu_type: group and child is empty will hide the menu if not self.child: @@ -55,10 +60,6 @@ def make(self, request, models=None, deep=1, deep_limit=0): menu_item['target_blank'] = self.target_blank menu_item['menu_type'] = self.menu_type or 'group' - if menu_item['menu_type'] != 'group': - if menu_item['url'] == request.path: - menu_item['active'] = True - if self.child: if deep_limit == 0 or deep <= deep_limit: child_list = [] From 245516872c50ea519a4a30e8885cb1df1c88c212 Mon Sep 17 00:00:00 2001 From: wuyue Date: Wed, 5 Jul 2023 11:20:39 +0800 Subject: [PATCH 3/5] fix date range filter,setup empty when un focus except apply --- adminlteui/templates/adminlte/date_range_filter.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/adminlteui/templates/adminlte/date_range_filter.html b/adminlteui/templates/adminlte/date_range_filter.html index 841b442..86ffc18 100644 --- a/adminlteui/templates/adminlte/date_range_filter.html +++ b/adminlteui/templates/adminlte/date_range_filter.html @@ -51,8 +51,13 @@ }); $drp_input.on('cancel.daterangepicker', function(ev, picker) { $drp_input.val('{{ title }}') - $('#id_filter_{{ field_name }}__gte').attr('name', '').val(''); - $('#id_filter_{{ field_name }}__lte').attr('name', '').val(''); + $('#id_filter_{{ field_name }}__gte').removeAttr('name').val(''); + $('#id_filter_{{ field_name }}__lte').removeAttr('name').val(''); + }); + $drp_input.on('change', function(ev) { + $drp_input.val('{{ title }}') + $('#id_filter_{{ field_name }}__gte').removeAttr('name').val(''); + $('#id_filter_{{ field_name }}__lte').removeAttr('name').val(''); }); // set initial value var range = "{{ choices.0.value }}"; From 155ce52f1f1ca285b51669baf4f66fb298875e57 Mon Sep 17 00:00:00 2001 From: wuyue Date: Wed, 5 Jul 2023 11:51:36 +0800 Subject: [PATCH 4/5] update docs --- .../images/adminlte_date_range_filter.png | Bin 0 -> 27598 bytes docs/en/guide.md | 22 ++++++++++++++-- docs/en/index.md | 1 + docs/zh/guide.md | 24 ++++++++++++++++-- docs/zh/index.md | 1 + 5 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 docs/assets/images/adminlte_date_range_filter.png diff --git a/docs/assets/images/adminlte_date_range_filter.png b/docs/assets/images/adminlte_date_range_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..39a614f6baf5d5ccb9c627df56afee64efc27b22 GIT binary patch literal 27598 zcmdSA2T+q=_bwVl!4gCSq=_ghQUpR*I?|+91*8T9LhrqU1P}t!L+>EHmrw0JwLm3Y9(+J_YRg`83^B2XXa*O zQ|C1roxBJ*!4r6ZV^#tf-EE{w`CWm=yxd;BpEN4pepCT1yAe8X_4T{3+?`B9KiND; z)P(g$A7Le#I?G_JfmB?k-{vW=L*18mEm>M`f85b7pt2mJe_x!Kv%H^ElSt1m3fOq{ zQrAIZ{l2gS!O4DKfN=lMZb}><9esS$`_JFPn@|6rj%p^G*+V7SK9XR}`KGt>YWuLz zJ))qX_F>^aZ@4KH2*_?DSuqnfNIA$XO>^SbIP(f8w|>x@3GAO@%4Ya*GS9nhqnzXA z3CZW)=4nc;v}JsKW+FchfJIob{6F%MiXqv}dO7AzcX;C1Idz?f%4tyXY3;2(ccIGJ zWzzDCRWJs@CtSR2xYAjDkn(MF*FX@M40w`RA(`_Kq_BUk@j9b>79;&H!`?nqt@Fzm zy^-=>49b0jOwzR|lM(A4UTZ~hqW6(+BVd3>VnEU!A%3`Nh6h;Z!O~Sp7z} z*_f(xq?YD*UsOdCj;8beyK3d(2NR?MtzXOW35f>Bk>)`NOu_6f(r(h)P|A#1fMFmZ zqc!vwcQ^mw_hQ$|x3^Z^V@0D1xF3u#Ek){aE~hBuYwh_QG=@}UkuTZIX(P5u*qJ%d zrcojEU3~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Ek@ik46_bkQxvoO3#yh)vqN-q7@lmiW%{@`aGcVae5J z)W7J#v~&-&@~einhGdEt=Sb{1_r*G)13yumPR{*%T+Y_bH6d}Oo1(blx)tlOX91=O zqMb3UEiiX1cbxfVRL6*Hy``mAZvhT0gBO@9fPGS2MvOjxJp9VQ^U+rKN0kOk#ivPt zvXcI!Y(64y6CXAG?qsb9%|tnkn}sG`H|g)a{hjq*Ma+n>koCS<3O5tF)M2dBXEs4jDfD$Qk9s3&R>ChSX6U?3QQe+6Az-Lr=CLTw zT+u*aXy48I(py}mAQo;YDsco4-(7liu;eMLIEzse;#_oZtl5O|@%nrdV~_6F*Kk%{ zE7X|xs2a3dUc0}M)22iH^1_8?&^Xh%u7xGpJak`yBYYC;eMiL>*QZ|#=Tys{stZ>)`xNA&5-W@~25TfVK=-z!>6)jokL;uRaV++5o^ z3!T!p=W-k(;OvR_2|GqK%U(_jzV>zQq7Gg15rkE?j5a=Ui)^kRB@vu$m0#z1IIF1N z_-N?OjDT-F3pZSHjH2CZp`!6zQj=o8#jbe1o4s=Tvdu980dspFzaFE`G8S*7T`jTm zqm689+Q5$E015hL%uPR7o4lO2^*krpd?T5S1adVA;tXcj@P}W}1G9vCCl)zpv)Jc; z;qku|Z3GXshv&{z>;nU*3MRa{44QzE@Iu``fN4lkUzY*U@wU)t$w?OkEV=e&pvLbt zV?jX6b=xoR(zTLtSOpgS<+oK8q61bmEu;4%bJd#j$di@|9FwQh<*#)_W`0bwerNCU mg+&f_!EBUp@fUU95zS1Fy?F=^tHQDDR#( Tips: Top menu will not show icon,only support secondary menu max ## ModelAdmin -external ModelAdmin in django +### external ModelAdmin in django - make table filter support `select2` in `change_list` page - custom search field placeholder for `change_list` page @@ -109,6 +109,24 @@ effect ![modeladmin](../assets/images/modeladmin.png) +### Custom Filters +#### DateRangeFilter + +example: +```python title='rap/admin.py' +from adminlteui.admin import ModelAdmin +from adminlteui.filters import DateRangeFilter + +class AutomationTaskRecordAdmin(CommonAdmin, ModelAdmin): + list_display = ('id', 'automation', 'account', 'status', 'start_time', + 'end_time', 'update_time') + list_filter = ('automation__project', 'automation__source', + 'status', ('start_time', DateRangeFilter), ('end_time', DateRangeFilter)) + +``` +effect: +![adminlte_date_range_filter](../assets/images/adminlte_date_range_filter.png) + ## Widgets ### AdminlteSelect @@ -146,4 +164,4 @@ class CollectorAdmin(admin.ModelAdmin): ``` effect: -![adminlte_select](../assets/images/adminlte_select_multiple.png) +![adminlte_select_multiple](../assets/images/adminlte_select_multiple.png) diff --git a/docs/en/index.md b/docs/en/index.md index 3fec882..5f7ca3e 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -53,6 +53,7 @@ INSTALLED_APPS = [ ## Features - [Custom General Option](/django-adminlte-ui/2.x/guide/#basic-info) +- [ModelAdmin](/django-adminlte-ui/2.x/guide/#modeladmin) - [Widgets](/django-adminlte-ui/2.x/guide/#widgets) - [Custom Menu](/django-adminlte-ui/2.x/guide/#menu) diff --git a/docs/zh/guide.md b/docs/zh/guide.md index 6b45534..14c9177 100644 --- a/docs/zh/guide.md +++ b/docs/zh/guide.md @@ -87,7 +87,7 @@ class MyAdminlteConfig(AdminlteConfig): > Tips: 顶部菜单将不显示Icon,并且最多显示二级菜单,多余的将被隐藏 ## ModelAdmin -扩展django的ModelAdmin +### 扩展django的ModelAdmin - 让`change_list`页面的table过滤器支持`select2` - 自定义`change_list`页面搜索框的placeholder提示 @@ -109,6 +109,26 @@ class CollectorModelAdmin(ModelAdmin): ![modeladmin](../assets/images/modeladmin.png) +### Filters过滤器 +#### DateRangeFilter + +基于datarangepicker的时间范围过滤器 + +示例: +```python title='rap/admin.py' +from adminlteui.admin import ModelAdmin +from adminlteui.filters import DateRangeFilter + +class AutomationTaskRecordAdmin(CommonAdmin, ModelAdmin): + list_display = ('id', 'automation', 'account', 'status', 'start_time', + 'end_time', 'update_time') + list_filter = ('automation__project', 'automation__source', + 'status', ('start_time', DateRangeFilter), ('end_time', DateRangeFilter)) + +``` +效果图: +![adminlte_date_range_filter](../assets/images/adminlte_date_range_filter.png) + ## Widgets组件 ### AdminlteSelect @@ -146,4 +166,4 @@ class CollectorAdmin(admin.ModelAdmin): ``` 效果图: -![adminlte_select](../assets/images/adminlte_select_multiple.png) +![adminlte_select_multiple](../assets/images/adminlte_select_multiple.png) diff --git a/docs/zh/index.md b/docs/zh/index.md index a3d1b6e..e121406 100644 --- a/docs/zh/index.md +++ b/docs/zh/index.md @@ -53,6 +53,7 @@ INSTALLED_APPS = [ ## 功能 - [自定义属性](/django-adminlte-ui/2.x/zh/guide/#_4) +- [ModelAdmin扩展](/django-adminlte-ui/2.x/zh/guide/#modeladmin) - [Widget组件](/django-adminlte-ui/2.x/zh/guide/#widgets) - [自定义菜单](/django-adminlte-ui/2.x/zh/guide/#_5) From 1799d26b7bed973a52487c2a51f6efd752095dbc Mon Sep 17 00:00:00 2001 From: wuyue Date: Wed, 5 Jul 2023 13:56:11 +0800 Subject: [PATCH 5/5] update version to 2.1.1 --- adminlteui/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminlteui/__init__.py b/adminlteui/__init__.py index 68e9e47..6d45486 100644 --- a/adminlteui/__init__.py +++ b/adminlteui/__init__.py @@ -1,2 +1,2 @@ -version = '2.1.0' +version = '2.1.1' default_app_config = 'adminlteui.apps.AdminlteUIConfig'