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
Create a bootstrap modal layout object #1204
Create a bootstrap modal layout object #1204
Conversation
Thanks for this, it looks like a nice addition. Could I ask you to have a look at updating the docs, and adding some tests? Here's a commit that shows how we're currently writing tests. The aim is with this style that it makes them easier to test than lots of HTML in Python strings. Do let me know if you need any help with these. |
Codecov Report
@@ Coverage Diff @@
## main #1204 +/- ##
==========================================
+ Coverage 97.35% 97.38% +0.03%
==========================================
Files 23 23
Lines 2909 2950 +41
Branches 327 328 +1
==========================================
+ Hits 2832 2873 +41
Misses 39 39
Partials 38 38
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@smithdc1 Of course! I wanted to hold off on updating the docs and writing tests until my pull request got attention. Thanks for the example. |
Modals are only supported by bootstrap 3 and 4 with no changes between the versions that would cause incompatibility. f1a8382 only tests bootstrap3 modals and the assumption is a bootstrap4 modal would work the same. If a test for bootstrap4 is requested I'm more than willing to add one, though it would be the exact same test as bootstrap3, just with the bootstrap4 decorator. |
@smithdc1 I'm a bit stuck with how to pass the Python 3.7 check. Any ideas? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, the whole space "thing" with Django 2.2. Not long left to support this version.
Adding a couple of spaces to the tests should fix it.
This is now top of my list to have a look at, looks great a a first glance!
crispy_forms/tests/results/bootstrap3/test_layout_objects/bootstrap_modal_no_kwargs.html
Outdated
Show resolved
Hide resolved
crispy_forms/tests/results/bootstrap3/test_layout_objects/bootstrap_modal_no_kwargs.html
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the PR! 🏅
I've got a few notes, mostly nits and/or questions about some edge cases. Appreciate your thoughts on these.
crispy_forms/tests/results/bootstrap3/test_layout_objects/bootstrap_modal_with_kwargs.html
Show resolved
Hide resolved
…strap_modal_no_kwargs.html Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
…strap_modal_no_kwargs.html Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
b89c2cf
to
4362a8c
Compare
Ok, tests are passing. Is there anything else before I merge? |
@nsandler1 thanks for the contribution! |
@smithdc1 Nope, looks good to me! No problem! |
Introduces bootstrap modals into crispy forms as a layout object.
Supported by Bootstrap v3+