django-bootstrap4
django-bootstrap4 copied to clipboard
Make javascript optional
I am using only the CSS parts of bootstrap, not the JavaScript. Currently, this does not seem to be supported.
The issue I noticed is that the form errors have a close button that requires javascript. I am not sure if there is more.
I would be available to help implementing this. However, I am not sure how to approach the topic and if it is even wanted.
We have a solution for not loading JavaScript, which is do not use the template tag to load JS in your templates.
You have a point with the form errors, but we should look for a different solution there. Adding a global use_javascript settings is not the way we want to go.
Thanks for the feedback. I see two possible solutions:
- Add the
dismissableparameter that is available on bootstrap_alert to more template tags, e.g.form_errorsandform. - Tell people to overwrite
form_errors.htmlandmessages.htmlin their projects.
I think I personally prefer the second option. Not using javascript is a global property and you should not have to add a parameter to every form.
Still, I implemented the first option in a branch.
What do you think should be the way forward?
If we start with the decision that it should be possible to use django-bootstrap4 without using any JavaScript, the next question is how to best implement this.
Up until now, it used to be: just do not include the JavaScript (either through template or manually). But this ticket shows that we also include JS-specific code in the templates.
If there is no interest in discussing this any further, I think we should close this issue.