Conversation
Includes terser-webpack-plugin explicitly for custom Webpack config
| <div class="control"> | ||
| <div class="mb-3"> | ||
| <label class="form-label">{% trans "Email" %}</label> | ||
| <div> |
There was a problem hiding this comment.
These surrounding <div>s seem like they're probably not be necessary around the form fields anymore.
There was a problem hiding this comment.
It appears that they're intended to keep the input fields below their labels.
There was a problem hiding this comment.
Ah, that's fair. If there's a way to apply the form-control class to the inputs themselves that would also do this (and apply a little bit of Bootstrap styling), but not sure there's an easy way for inputs rendered as {{ form.field }}
|
Thank you for the thorough review @nospame ! I think (I hope) we're done with this bit. I'll follow up later with a PR with some refactors and optimizations. Edit: Oh! Wait! There is a little more clean-up to do. One moment ... |
|
Okay, I think that's everything. 😅 |
The template is not pretty. But this approach avoids having to explicitly add a Select widget, with the "class" attribute set, for every Form field. It also follows the precedent set with the template for `<input>`.
4a33af7 to
62b04cc
Compare
|
Right. This time I think I'm actually done. There may still be some unnecessary |
| @@ -0,0 +1,33 @@ | |||
| <select | |||
| name="{{ widget.name }}" | |||
| class="form-select{% if widget.attrs.class %} {{ widget.attrs.class }}{% endif %}" | |||
There was a problem hiding this comment.
Just noting that when using prettier (as added in a different PR) it will tend to compress spaces between template tags, so this class attr would probably come out without any spaces, like this:
"form-select{% if widget.attrs.class %}{{ widget.attrs.class }}{% endif %}"Spaces before template tags or after are maintained, so this would be untouched:
"form-select {% if widget.attrs.class %}{{ widget.attrs.class }}{% endif %}"
🦖 SAAS-19179
Now with Bootstrap 5!
(This branch is rebased onto
masterso that it can get merged before the ongoing dashboard work is complete.)Definitely easier to review by commit 🐡