-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support passing themes? #71
Comments
I did not dig into code (it changed much from last time i touched it) but it looks like |
Looks promising — let me try that and report back! |
Passing # git --no-pager diff -- sampleproject/demoapp/admin.py
diff --git a/sampleproject/demoapp/admin.py b/sampleproject/demoapp/admin.py
index b756c91..a7ad382 100644
--- a/sampleproject/demoapp/admin.py
+++ b/sampleproject/demoapp/admin.py
@@ -6,7 +6,7 @@ from .models import Note, Category
class NoteAdmin(admin.ModelAdmin):
- form = select2_modelform(Note)
+ form = select2_modelform(Note, attrs={'theme': 'classic'})
admin.site.register(Category) However with theme
…but I see no easy way to swap |
I ll put this as a PR, since this was not forseen as a proper requirement, so got left for this hard way reach. |
Hi!
I would like to use the bootstrap4 theme for Select2. The way to activate it would be:
To make that work with django-easy-select2 it seems I would need to pass
theme: 'bootstrap4'
here:django-easy-select2/easy_select2/static/easy_select2/js/init.js
Lines 3 to 6 in 0a87c50
If that's right, I wonder how to best bypass just
easy_select2/js/init.js
as a user and load a custom copy. Any thoughts? Would a PR adding a new setting work?Best, Sebastian
The text was updated successfully, but these errors were encountered: