-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Bootstrap v5 #7411
base: master
Are you sure you want to change the base?
Bootstrap v5 #7411
Conversation
Hi @smithdc1. Thanks for this! Super start. |
Thanks 😄 It's coming along well, currently wrangling with the collapse menu in the docs. Got my eye on the upcoming releases, seems like they made good progress on alpha 2 in the last few days. I can already see some breaking changes in the next release but they should be incremental changes to the current changes. (e.g. rename of |
So I'm fairly pleased with where I've got this to. It's a bit of a waiting game now to see the new releases come out and see if there are any more breaking changes, and to see if the drop-down tool-tip gets fixed. Can also review the remaining css in One question I do have is for the filter form. The filter form looks a bit odd, it looks like a template from |
Chuckle. 😀 Erm... the form is generated by django-filter but is it rendered with crispy forms? (A while since I looked in here...) If you throw up a few links to exact places I'm sure I can get the relevant grey-cells lined up again. 😝 |
Ok - let's leave it some time and I'll dig deeper at some point in the coming months. There is going to be plenty of time before Bootstrap 5 reaches a stable release. There may be a |
Note (to self really). #30170 on bootstrap 5 changes feedback messages. Html layout and CSS classes will need to be changed. Currently this ticket is on the inbox for v5 alpha 2. |
Looking forward to this! |
Thanks -- It's coming but bootstrap 5 development itself is steadily paced. For your need I'm not sure I have a good answer, maybe you could have your own fork with this work, noting it is un-reviewed (but if you're in the market to have a look 😉 ) I'm not sure an alpha version is better than an old one from a security perspective 🤷 . |
Bootstrap5 beta 1 is now out. I'll be looking to test my memory by revisiting this soon ™️. |
* navbar-expand-md to stop navbar growing when dropdown opens. * Split dropdown doesn't work with tooltip - looks like a bs5 bug (same layout works with bs4) * Need to check button colours * Need to look at colour of dropdown links
* BS3 had lots of top (20px) and bottom (10px) margin to push page down. Now added top margin on the div. * Font has style has changed with bs5. But is slightly custom as font weight is over riden. Personally think it looks ok.
* form-horizontal is no longer used. Need to use the grid. aligned tabs right Raw Data Form * Use grid / rows to space form. form-group has been deprecated in favour of utility classes. Replaced `well` class (background colour/border) with bootstrap utility classes
* form-group is deprecated in bootstrap 5 and is replaced by utility classes.
* checkbox are now fully custom by default in Bootstrap5 - removed previous tweaks. * control-label --> col-form-label * errors now need `invalid-feedback` on the text and `is-invalid` on the input * new `form-text` class for help text * New html layout and css classes for radio/multiple checkbox. Added work around for errors and inline (see comments in code).
* error class has changed to `invalid-feedback`
* render_markdown returns its content in a <p> tag, so don't need to wrap again.
* No need to add popper.js as a separate source
Changed in beta 1 see - https://getbootstrap.com/docs/5.0/migration/#javascript-2
The hide class in bootstrap 2 added display:none. This is done via d-none in v5 see. https://getbootstrap.com/docs/5.0/utilities/display/#notation
Changed in beta 1. See https://getbootstrap.com/docs/5.0/migration/#utilities-2
as this is staled, should we try a smaller incremental version with bootstrap v4 instead? |
or maybe we should have our own CSS like |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
we can revamp it with newer https://blog.getbootstrap.com/2023/05/30/bootstrap-5-3-0/ which has new colors and many improvements. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi, can this be rebased? |
Hi, @smithdc1 I want to help you finish this PR. I have extensive experience with Django templates and Bootstrap 5 (I just did a similar migration on a client from v3 to v5.3). I plan to pull your branch, update this to Bootstrap v5.3, and keep going page by page, ensuring everything works seamlessly. Are you available for a quick async talk on the IRC channel, or do you prefer to discuss the next steps here? |
Hi @luanfonceca -- I'm afraid I don't have time to work on this patch right now. It's been ~3 years since I've looked at this so I'd be starting from scratch to pick this up again. I think it would be amazing if you have capacity to update and address the review comments! |
Yeah, there's no need to worry about it. Thanks |
Hi @auvipy, I can take over this migration, I saw some conversation about migrating to v4 before trying the v5, do you know how that's going? Last week did some attempts and can share where I'm at with you. |
Here's a short video showing how far I got with this last week; I had a couple of issues, and the layout still needs some improvements. I can open a new issue up for discussion, along with my ideas about this, as there were several attempts related to this migration. I think we need time to decide what we want to do and how, as well as the impact of this migration on third-party apps that use the DRF browseable API page. Screen.Recording.2023-12-16.at.12.06.34.PM.mov |
Could this maybe be released as some alpha version for some future release? Or is it too risky? I'm interested in BS5 too |
Any update on this? We recently had a pen test done and they told us that we need to upgrade Bootstrap due to security vulnerabilities It seems this has been on the back burner for a while, any plans on updating? @luanfonceca |
Hey @rmiyazaki6499, sorry about that. I tried to migrate that and got it in a really good state, but it is not production-ready. The major problem I faced was that both the Docs and the user-facing (the front-end bundle that's pip installed) share the same front-end codebase, so to make the whole migration (DRF browseable API and docs), it needs to be done together. I can get back to this if we are open to starting with just the user-facing first and migrating it separately. I'd ask that for two reasons:
|
Hi @luanfonceca All good, thanks for the update |
Thanks for trying to get this fixed @luanfonceca. In the same situation as @rmiyazaki6499 with pentest findings. Again relatively low risk, but would be great if you were able to fix 🙏 |
Hi @luanfonceca thanks for your work on this. I'd be happy to try and pick up where you've left off if you don't have the time to work on this in the near term. |
you can take this and fix the merge conflicts first and make it working again |
Go for it! It was really hard to upgrade to Bootstrap v5, mainly because the same Base templates used in the User-facing API are also used in the Docs. Instead of upgrading just one template and a few components, I got caught up in the whole Docs website codebase, which was time-consuming and brought up several bugs and broken pieces of UI. Creating a new base template for the user-facing API and upgrading only the HTML used there will make this migration easier. |
It looks like Bootstrap v5 upgrades will not be accepted for the Docs. Is this dead in the water until the "unified doc style" gets implemented (i.e. and the Docs site + user-facing API no longer use the same base templates)? Probably a question for @tomchristie |
Fixes #7327
This is a WIP patch to upgrade the templates to Bootstrap v5. I've tried to chunk the commits up to help review, this will change as this will quite a number of files and lines of code.
I feel like I've made good progress so far. Only major issue I've found so far is tooltips on the dropdown button. The solution on bootstrap 4 (which I've used here) no longer works on bootstrap 5. Another alpha release is due of bootstrap 5 shortly, if it is not fixed in that I can try approaching the issue tracker.
To do (there is much more than this, but here are things I've changed but need to go back and look at):