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

Add horizontal form support via BootstrapTheme #2532

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Oct 1, 2024

Allow horizontal forms to be used as described in https://getbootstrap.com/docs/4.0/components/forms/#horizontal-form and used in #2368, although here no extra div is added to the template and it is configured from the Theme object. That was not quite so simple as there is also template rendering going on in form.widgets.RenderTemplateWidget - so this PR adds theme to current_app ???

Also.
Boostrap 4 renamed .control-label to .col-form-label.
https://getbootstrap.com/docs/4.0/migration/#forms-1

Closes #2368.

@cjmayo cjmayo force-pushed the fix-lib-html branch 3 times, most recently from 821a8e1 to 7a36bc8 Compare October 3, 2024 18:26
@cjmayo cjmayo changed the title Fixes for bootstrap4/admin/lib.html Add horizontal form support Oct 3, 2024
@cjmayo cjmayo changed the title Add horizontal form support Add horizontal form support via Theme Oct 3, 2024
@cjmayo cjmayo changed the title Add horizontal form support via Theme Add horizontal form support via BootstrapTheme Oct 3, 2024
@samuelhwilliams
Copy link
Contributor

I think this may need a bit more thought - if an app has multiple admin instances with different themes, these settings will get mixed up.

Also, injecting the Flask-Admin theme as theme on the global app config seems to have a high possibility of overlapping with userspace config. We should probably prefix it with flask_admin_ or something similar.

@cjmayo cjmayo marked this pull request as draft October 13, 2024 18:33
@cjmayo
Copy link
Contributor Author

cjmayo commented Oct 13, 2024

It's probably beyond my understanding of Admin and Views - obviously I could do a rename. I've split the fixes out anyway.

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

Successfully merging this pull request may close these issues.

2 participants