Skip to content

Commit

Permalink
Merge branch 'release/1.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyue92tree committed Jun 30, 2022
2 parents 21a0fea + c47ec55 commit b8b5cd0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion adminlteui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = '1.7.0'
version = '1.7.1'
default_app_config = 'adminlteui.apps.AdminlteUIConfig'
22 changes: 12 additions & 10 deletions adminlteui/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,18 @@ class Media:

def changelist_view(self, request, extra_context=None):
view = super().changelist_view(request, extra_context)
cl = view.context_data.get('cl')
cl.search_field_placeholder = self.search_field_placeholder
filter_specs = cl.filter_specs

for index, filter_spec in enumerate(filter_specs):
if filter_spec.field_path in self.select2_list_filter:
# flag to use select2
filter_spec.display_select2 = True
cl.filter_specs[index] = filter_spec
view.context_data['cl'] = cl
if hasattr(view, 'context_data'):
cl = view.context_data.get('cl', None)
if cl:
cl.search_field_placeholder = self.search_field_placeholder
filter_specs = cl.filter_specs

for index, filter_spec in enumerate(filter_specs):
if filter_spec.field_path in self.select2_list_filter:
# flag to use select2
filter_spec.display_select2 = True
cl.filter_specs[index] = filter_spec
view.context_data['cl'] = cl
return view


Expand Down
3 changes: 3 additions & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# ChangeLog
## [v1.7.1](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.7.0)
- fix exception when delete in changelist_view
- update docs

## [v1.7.0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.7.0)
- make previous & next button effective on change_list.html
Expand Down
22 changes: 12 additions & 10 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,17 +264,19 @@ Modify apps icon & order apps/models

```python
ADMINLTE_SETTINGS = {
'example-app': {
'icon': 'fa-desktop',
'models': {
'example-model': {
'icon': 'fa-archive'
},
'example-model1': {}
'apps': {
'example-app': {
'icon': 'fa-desktop',
'models': {
'example-model': {
'icon': 'fa-archive'
},
'example-model1': {}
}
},
'auth': {
'icon': 'fa-users'
}
},
'auth': {
'icon': 'fa-users'
}
}
```

0 comments on commit b8b5cd0

Please sign in to comment.