File tree Expand file tree Collapse file tree 6 files changed +77
-9
lines changed Expand file tree Collapse file tree 6 files changed +77
-9
lines changed Original file line number Diff line number Diff line change 1- - name : Publish a Python distribution to PyPI
2- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
3- uses : pypa/gh-action-pypi-publish@v1.5.0
4- with :
5- user : __token__
6- password : ${{ secrets.PYPI }}
1+ name : main
2+
3+ on : push
4+
5+ jobs :
6+ build-n-publish :
7+ name : Build and publish Python 🐍 distributions 📦 to PyPI
8+ runs-on : ubuntu-18.04
9+
10+ steps :
11+ - uses : actions/checkout@master
12+ - name : Set up Python 3.9
13+ uses : actions/setup-python@v1
14+ with :
15+ python-version : 3.9
16+ - name : Install pypa/build
17+ run : >-
18+ python -m
19+ pip install
20+ build
21+ --user
22+ - name: Build a binary wheel and a source tarball
23+ run: >-
24+ python -m
25+ build
26+ --sdist
27+ --wheel
28+ --outdir dist/
29+ .
30+ - name : Publish a Python distribution to PyPI
31+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
32+ uses : pypa/gh-action-pypi-publish@v1.5.0
33+ with :
34+ user : __token__
35+ password : ${{ secrets.PYPI }}
Original file line number Diff line number Diff line change 77# django-adminlte-ui
88[ ![ PyPI Version] ( https://img.shields.io/pypi/v/django-adminlte-ui.svg )] ( https://pypi.python.org/pypi/django-adminlte-ui )
99[ ![ Download Status] ( https://img.shields.io/pypi/dm/django-adminlte-ui.svg )] ( https://pypi.python.org/pypi/django-adminlte-ui )
10- [ ![ Build Status] ( https://api.travis-ci.org /wuyue92tree/django-adminlte-ui.svg )] ( https://travis-ci.org /wuyue92tree/django-adminlte-ui )
10+ [ ![ Build Status] ( https://github.com /wuyue92tree/django-adminlte-ui/workflows/main/badge .svg )] ( https://github.com /wuyue92tree/django-adminlte-ui/workflows/main/badge.svg )
1111[ ![ Documentation Status] ( https://readthedocs.org/projects/django-adminlte-ui/badge/?version=latest )] ( https://django-adminlte-ui.readthedocs.io/en/latest/?badge=latest )
1212[ ![ Gitter] ( https://badges.gitter.im/django-adminlte-ui/community.svg )] ( https://gitter.im/django-adminlte-ui/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge )
1313
Original file line number Diff line number Diff line change 1- version = '1.6.1 '
1+ version = '1.7.0 '
22default_app_config = 'adminlteui.apps.AdminlteUIConfig'
Original file line number Diff line number Diff line change 11# ChangeLog
22
3+ ## [ v1.7.0] ( https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.7.0 )
4+ - make previous & next button effective on change_list.html
5+ - use select2 make admin filter searchable
6+ - add search_field_placeholder for search_fields
7+ - use ` github actions ` replace ` travis `
8+
39## [ v1.6.1] ( https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.6.1 )
410- fix app in ADMINLTE_SETTINGS but current_user has not perm
511- fix model in ADMINLTE_SETTINGS but current_user has not perm
Original file line number Diff line number Diff line change @@ -50,6 +50,39 @@ before custom option, you should known what adminlte has used.
5050- avatar_field
5151- show_avatar
5252
53+ ## ModelAdmin
54+ - make change_list filter support select2
55+ - custom placeholder for search_fields
56+
57+ ``` python
58+ # adminlte/admin.py
59+ class ModelAdmin (admin .ModelAdmin ):
60+ select2_list_filter = ()
61+ search_field_placeholder = ' '
62+
63+ class Media :
64+ css = {
65+ " all" : (" admin/components/select2/dist/css/select2.min.css" ,)
66+ }
67+ js = (
68+ " admin/components/select2/dist/js/select2.min.js" ,
69+ )
70+
71+ def changelist_view (self , request , extra_context = None ):
72+ view = super ().changelist_view(request, extra_context)
73+ cl = view.context_data.get(' cl' )
74+ cl.search_field_placeholder = self .search_field_placeholder
75+ filter_specs = cl.filter_specs
76+
77+ for index, filter_spec in enumerate (filter_specs):
78+ if filter_spec.field_path in self .select2_list_filter:
79+ # flag to use select2
80+ filter_spec.display_select2 = True
81+ cl.filter_specs[index] = filter_spec
82+ view.context_data[' cl' ] = cl
83+ return view
84+ ```
85+
5386## Widgets
5487
5588### AdminlteSelect
Original file line number Diff line number Diff line change 22
33[ ![ PyPI Version] ( https://img.shields.io/pypi/v/django-adminlte-ui.svg )] ( https://pypi.python.org/pypi/django-adminlte-ui )
44[ ![ Download Status] ( https://img.shields.io/pypi/dm/django-adminlte-ui.svg )] ( https://pypi.python.org/pypi/django-adminlte-ui )
5- [ ![ Build Status] ( https://api.travis-ci.org /wuyue92tree/django-adminlte-ui.svg )] ( https://travis-ci.org /wuyue92tree/django-adminlte-ui )
5+ [ ![ Build Status] ( https://github.com /wuyue92tree/django-adminlte-ui/workflows/main/badge .svg )] ( https://github.com /wuyue92tree/django-adminlte-ui/workflows/main/badge.svg )
66[ ![ Gitter] ( https://badges.gitter.im/django-adminlte-ui/community.svg )] ( https://gitter.im/django-adminlte-ui/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge )
77
88
You can’t perform that action at this time.
0 commit comments