Skip to content
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 5 #2163

Open
mo8it opened this issue Oct 20, 2021 · 21 comments
Open

Bootstrap 5 #2163

mo8it opened this issue Oct 20, 2021 · 21 comments
Labels

Comments

@mo8it
Copy link
Contributor

mo8it commented Oct 20, 2021

Bootstrap 4 is not optimal in flask-admin. The Bootstrap 3 support is better. Maybe just drop Bootstrap 4 and start with Bootstrap 5 which has been released months ago? Thanks for the awesome package!

@zloyded
Copy link

zloyded commented Jan 11, 2022

@dagostinelli
Copy link

Not sure about the "not optimal" bit. But an upgrade to BootStrap 5 would be appreciated.

@mo8it
Copy link
Contributor Author

mo8it commented Mar 2, 2022

Not sure about the "not optimal" bit. But an upgrade to BootStrap 5 would be appreciated.

I did mean bugs like this which I did finally manage to fix: #2233

@ealtamir
Copy link

Anyone knows how hard would it be to override flask-admin templates and use Bootstrap 5?

@zloyded
Copy link

zloyded commented Sep 19, 2022

somebody?

@dagostinelli
Copy link

@ealtamir It doesn't look that hard. Give it a whirl.

@mo8it
Copy link
Contributor Author

mo8it commented Sep 20, 2022

@mrjoes would you merge a done PR to Bootstrap 5?
I am not trying to put any pressure, thank you anyway. Just to not waste time ;)

@macnewbold
Copy link

Following also. We also would be interested in Bootstrap 5.

@samialfattani
Copy link

BootStrap 5 supports LTR (Left-To-Right) direction for RTL languages such as Arabic, Hebrew...etc. BootStrap 5 would be much appreciated.

@mariofix
Copy link

mariofix commented Apr 3, 2023

Any one want to collaborate on making this happen?
I've started playing with the bootswatch update to bootstrap 5.2.3

@Soham7777777
Copy link

This Flask-Admin project is so much useful, Can anyone please guide how to add support for bootstrap-5.3.3 it would be cool!

@macnewbold
Copy link

macnewbold commented Mar 25, 2024

I think the approaches I'd suggest would be either of these two:

  1. Take the bootstrap3 or bootstrap4 example, and modernize it to work with the bootstrap5 changes, and take advantage of some of the new things it offers.
  2. Start without any styling at all, and implement bootstrap5 on it, looking at the bootstrap3/4 plugs for inspiration if you get stuck.

I think either could work well, but I'm sure everyone will have their opinion or preference on which would work better or be easier. I've been bugged by the same thing, and wouldn't mind contributing or helping to test on a work project.

@mariofix
Copy link

It's not as easy as it sounds, I have about 60% advanced (I don't use inlines so I haven't got around that), but the main problem is that support for BS4 is not complete, so upgrading it to bs5 is a bit difficult.

@macnewbold
Copy link

Indeed. If there's a branch I could help test for you, or contribute to, I'd be happy to do so. I'm hoping we can get a new release out, since there's an important (to me) bugfix in master that isn't released yet, and this would be a great one to have released soon. It's been three years since Bootstrap 5 came out, and v4 is now six years old, and v3 is ten years old. It's time and I think we can get this working now.

@mariofix
Copy link

Indeed. If there's a branch I could help test for you, or contribute to, I'd be happy to do so. I'm hoping we can get a new release out, since there's an important (to me) bugfix in master that isn't released yet, and this would be a great one to have released soon. It's been three years since Bootstrap 5 came out, and v4 is now six years old, and v3 is ten years old. It's time and I think we can get this working now.

#2350

@hasansezertasan
Copy link
Member

Anyone knows how hard would it be to override flask-admin templates and use Bootstrap 5?

I don't think it's too hard. Check out these projects:

@hasansezertasan
Copy link
Member

It's not as easy as it sounds, I have about 60% advanced (I don't use inlines so I haven't got around that), but the main problem is that support for BS4 is not complete, so upgrading it to bs5 is a bit difficult.

X-editable has some problems with BS5, so I used a fork.

Also, what do you mean by "support for BS4 is not complete"? It seems OK to me, what's missing?

@mariofix
Copy link

mariofix commented Jun 4, 2024

Anyone knows how hard would it be to override flask-admin templates and use Bootstrap 5?

I don't think it's too hard. Check out these projects:

I didn't know about this one, i'll check it out.

I contribute to this project and because it was impossible to upgrade there, I decided to include it as a PR here :) i guess i'm back there

@hasansezertasan
Copy link
Member

I contribute to this project and because it was impossible to upgrade there, I decided to include it as a PR here :) i guess i'm back there

Why was it impossible to upgrade there? 🤓

@mariofix
Copy link

mariofix commented Jun 7, 2024

https://github.com/flask-admin/flask-admin/blob/14e24c970f0ee3a29add830612eee9a0b0ba5dcc/flask_admin/base.py#L495C13-L497C89

            :param template_mode:
                Base template path. Defaults to `bootstrap2`. If you want to use
                Bootstrap 3 or 4 integration, change it to `bootstrap3` or `bootstrap4`.

At first i just tried to put None or bs5 but a folder with the name is needed.
This parameter loads the base javascript and styles to work with bootswatch, if I just ignore it and make the template regardless, i still get those javascript and styles, with the bugs and fixes for that specific version of bootstrap.

I'm not an expert in front-end, so if there is another workaround it and try to make it work with both javascript loaded (bootstrap 4 and 5), i'll take it, i guess eventually the team here will make their own upgrade.

@hasansezertasan
Copy link
Member

At first i just tried to put None or bs5 but a folder with the name is needed. This parameter loads the base javascript and styles to work with bootswatch, if I just ignore it and make the template regardless, i still get those javascript and styles, with the bugs and fixes for that specific version of bootstrap.

Hmm. I use template_mode="boostrap4" because it is irrelevant if you override the templates. On the other hand, you are supposed to add the Bootstrap5 Bootswatch files right?

I'm not an expert in front-end, so if there is another workaround it and try to make it work with both javascript loaded (bootstrap 4 and 5), i'll take it, i guess eventually the team here will make their own upgrade.

Why not just override the <script> and <link> tags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

9 participants