Skip to content

Commit 26191e9

Browse files
committed
update docs
1 parent f164cb5 commit 26191e9

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

docs/about.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# ChangeLog
22

3+
## [v1.5.0b0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.5.0b0)
4+
5+
- add adminlte/widgets/select.html && auto active select2 by select id.
6+
7+
## [v1.4.0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.4.0)
8+
9+
- feature #6 add `ADMINLTE_SETTINGS`;
10+
- update menu render logic.
11+
312
## [v1.3.3](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.3.3)
413

514
- add menu on the top;

docs/guide.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,41 +54,45 @@ before custom option, you should known what adminlte has used.
5454

5555
### AdminlteSelect
5656

57+
> Since v1.5.0b0, you don't need modify new template to active select2.
58+
5759
example:
5860
```
5961
# adminlte/admin.py
6062
@admin.register(Menu)
6163
class MenuAdmin(TreeAdmin):
6264
...
63-
change_form_template = 'adminlte/menu_change_form.html'
65+
# change_form_template = 'adminlte/menu_change_form.html'
6466
formfield_overrides = {
6567
models.ForeignKey: {'widget': AdminlteSelect}
6668
}
6769
6870
# adminlte/menu_change_form.html
6971
# active the target select
70-
{% extends 'admin/change_form.html' %}
71-
72-
{% block extrajs %}
73-
{{ block.super }}
74-
<script>
75-
django.jQuery('#id_content_type').select2();
76-
</script>
77-
{% endblock %}
72+
# {% extends 'admin/change_form.html' %}
73+
74+
# {% block extrajs %}
75+
# {{ block.super }}
76+
# <script>
77+
# django.jQuery('#id_content_type').select2();
78+
# </script>
79+
# {% endblock %}
7880
```
7981
effect:
8082

8183
![adminlte_select](https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/adminlte_select.png?raw=true)
8284

8385
### AdminlteSelectMultiple
8486

87+
> Since v1.5.0b0, you don't need modify new template to active select2.
88+
8589
example:
8690
```
8791
# adminlte/admin.py
8892
@admin.register(Menu)
8993
class MenuAdmin(TreeAdmin):
9094
...
91-
change_form_template = 'adminlte/menu_change_form.html'
95+
# change_form_template = 'adminlte/menu_change_form.html'
9296
formfield_overrides = {
9397
# multiple for ManayToManyField
9498
models.ManayToManyField: {'widget': AdminlteSelectMultiple(
@@ -98,14 +102,14 @@ class MenuAdmin(TreeAdmin):
98102
99103
# adminlte/menu_change_form.html
100104
# active the target select
101-
{% extends 'admin/change_form.html' %}
102-
103-
{% block extrajs %}
104-
{{ block.super }}
105-
<script>
106-
django.jQuery('#id_content_type').select2();
107-
</script>
108-
{% endblock %}
105+
# {% extends 'admin/change_form.html' %}
106+
107+
# {% block extrajs %}
108+
# {{ block.super }}
109+
# <script>
110+
# django.jQuery('#id_content_type').select2();
111+
# </script>
112+
# {% endblock %}
109113
```
110114
effect:
111115

0 commit comments

Comments
 (0)