Skip to content

Commit 065a0a1

Browse files
committed
update docs
1 parent 208c8e6 commit 065a0a1

File tree

4 files changed

+140
-45
lines changed

4 files changed

+140
-45
lines changed

docs/about.md

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

3+
## [v1.3.0b0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.3.0b0)
4+
5+
- add treebeard as menu depends;
6+
- add `select2` into `widgets.py`;
7+
- update site_logo save path, base on settings.MEDIA_ROOT & settings.MEDIA_URL;
8+
- fix base.html & login.html b tag issue;
9+
- change base.html extra_style and extra_head position.
10+
311
## [v1.2.0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.2.0)
412

513
- add models with options;

docs/guide.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Guides
2+
3+
## General Option
4+
5+
dynamic setup your site base on table `django_admin_settings_options`.
6+
7+
support options:
8+
9+
- Site Title
10+
- Site Header
11+
- Site Logo
12+
- Welcome Sign
13+
14+
## Options
15+
16+
this options in your db, named `django_admin_settings_options`, after do migrate.
17+
18+
you can also add your custom option into this table, and use it by templatetags
19+
`adminlte_options` with function `get_adminlte_option`.
20+
21+
options table has a valid field to control your option work or not.
22+
23+
24+
example:
25+
26+
```
27+
# adminlte/general_option.html
28+
29+
{% load adminlte_options %}
30+
31+
# here my option_name is site_title, you can custom yourself.
32+
{% get_adminlte_option 'site_title' as adminlte_site_title %}
33+
{% if adminlte_site_title.valid %}
34+
{{ adminlte_site_title.site_title }}
35+
{% else %}
36+
{{ site_title|default:_('Django site admin') }}
37+
{% endif %}
38+
39+
```
40+
41+
before custom option, you should known what adminlte has used.
42+
43+
- site_title
44+
- site_header
45+
- site_logo
46+
- welcome_sign
47+
48+
## Widgets
49+
50+
### AdminlteSelect
51+
52+
example:
53+
```
54+
# adminlte/admin.py
55+
@admin.register(Menu)
56+
class MenuAdmin(TreeAdmin):
57+
...
58+
change_form_template = 'adminlte/menu_change_form.html'
59+
formfield_overrides = {
60+
models.ForeignKey: {'widget': AdminlteSelect}
61+
}
62+
63+
# adminlte/menu_change_form.html
64+
# active the target select
65+
{% extends 'admin/change_form.html' %}
66+
67+
{% block extrajs %}
68+
{{ block.super }}
69+
<script>
70+
django.jQuery('#id_content_type').select2();
71+
</script>
72+
{% endblock %}
73+
```
74+
effect:
75+
76+
![adminlte_select](https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/adminlte_select.png?raw=true)
77+
78+
### AdminlteSelectMultiple
79+
80+
example:
81+
```
82+
# adminlte/admin.py
83+
@admin.register(Menu)
84+
class MenuAdmin(TreeAdmin):
85+
...
86+
change_form_template = 'adminlte/menu_change_form.html'
87+
formfield_overrides = {
88+
# multiple for ManayToManyField
89+
models.ManayToManyField: {'widget': AdminlteSelectMultiple(
90+
attr={'style': 'width: 100%'}
91+
)}
92+
}
93+
94+
# adminlte/menu_change_form.html
95+
# active the target select
96+
{% extends 'admin/change_form.html' %}
97+
98+
{% block extrajs %}
99+
{{ block.super }}
100+
<script>
101+
django.jQuery('#id_content_type').select2();
102+
</script>
103+
{% endblock %}
104+
```
105+
effect:
106+
107+
![adminlte_select](https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/adminlte_select_multiple.png?raw=true)
108+
109+
110+
111+
## Menu
112+
113+
developing ...

docs/index.md

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ INSTALLED_APPS = [
3737
'django.contrib.sessions',
3838
'django.contrib.messages',
3939
'django.contrib.staticfiles',
40+
# custom menu base on treebeard
41+
'treebeard',
4042
...
4143
]
4244
```
@@ -45,55 +47,26 @@ INSTALLED_APPS = [
4547
```
4648
python manage.py migrate django_admin_settings
4749
```
50+
## screen shot
4851

49-
## Guides
52+
### login page
53+
![login](https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/login.jpg?raw=true)
5054

51-
### General Option
55+
### dashboard
56+
![dashboard](https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/dashboard.jpg?raw=true)
5257

53-
dynamic setup your site base on table `django_admin_settings_options`.
58+
### table list
59+
![table list](https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/table-list.jpg?raw=true)
5460

55-
support options:
61+
### form page
62+
![form page](https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/form.png?raw=true)
5663

57-
- Site Title
58-
- Site Header
59-
- Site Logo
60-
- Welcome Sign
64+
### general_option
65+
![general_option](https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/general_option.jpg?raw=true)
6166

62-
### Options
67+
## Thanks
6368

64-
this options in your db, named `django_admin_settings_options`, after do migrate.
65-
66-
you can also add your custom option into this table, and use it by templatetags
67-
`adminlte_options` with function `get_adminlte_option`.
68-
69-
options table has a valid field to control your option work or not.
70-
71-
72-
example:
73-
74-
```
75-
# adminlte/general_option.html
76-
77-
{% load adminlte_options %}
78-
79-
# here my option_name is site_title, you can custom yourself.
80-
{% get_adminlte_option 'site_title' as adminlte_site_title %}
81-
{% if adminlte_site_title.valid %}
82-
{{ adminlte_site_title.site_title }}
83-
{% else %}
84-
{{ site_title|default:_('Django site admin') }}
85-
{% endif %}
86-
87-
```
88-
89-
before custom option, you should known what adminlte has used.
90-
91-
- site_title
92-
- site_header
93-
- site_logo
94-
- welcome_sign
95-
96-
97-
### Menu
98-
99-
coming soon...
69+
- [AdminLTE](https://github.com/ColorlibHQ/AdminLTE)
70+
- [django](https://github.com/django/django)
71+
- [django-treebeard](https://github.com/django-treebeard/django-treebeard)
72+
- [django-suit](https://github.com/darklow/django-suit)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
site_name: django-adminlte-ui
22
nav:
33
- Home: index.md
4+
- Guide: guide.md
45
- About: about.md
56
#theme: readthedocs

0 commit comments

Comments
 (0)