File tree Expand file tree Collapse file tree 4 files changed +44
-0
lines changed
crispy_bootstrap5/templates/bootstrap5/layout Expand file tree Collapse file tree 4 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 33## Next Release
44
55* Added support for [ Switches] ( https://getbootstrap.com/docs/5.2/forms/checks-radios/#switches ) . (#162 )
6+ * Added modal template
67
78## 2023.10 (2023-10-2023)
89* Added Django 5.0 and 4.2 support
Original file line number Diff line number Diff line change 1+ < div id ="{{ modal.css_id }} " class ="modal fade {{ modal.css_class }} " {{ modal.flat_attrs }} >
2+ < div class ="modal-dialog " role ="document ">
3+ < div class ="modal-content ">
4+ < div class ="modal-header ">
5+ < h5 class ="modal-title {{ modal.title_class }} " id ="{{ modal.title_id }}-label "> {{ modal.title }}</ h5 >
6+ < button type ="button " class ="btn-close " data-bs-dismiss ="modal " aria-label ="Close "> </ button >
7+ </ div >
8+ < div class ="modal-body ">
9+ {{ fields }}
10+ </ div >
11+ </ div >
12+ </ div >
13+ </ div >
Original file line number Diff line number Diff line change 1+ < div aria-labelledby ="modal_title_id-label " class ="fade modal modal-class-ex " id ="modal-id-ex " role ="dialog "
2+ tabindex ="-1 ">
3+ < div class ="modal-dialog " role ="document ">
4+ < div class ="modal-content ">
5+ < div class ="modal-header ">
6+ < h5 class ="modal-title " id ="modal_title_id-label ">
7+ This is my modal
8+ </ h5 >
9+ < button aria-label ="Close " class ="btn-close " data-bs-dismiss ="modal " type ="button "> </ button >
10+ </ div >
11+ < div class ="modal-body ">
12+ </ div >
13+ </ div >
14+ </ div >
15+ </ div >
Original file line number Diff line number Diff line change 1111 InlineCheckboxes ,
1212 InlineField ,
1313 InlineRadios ,
14+ Modal ,
1415 PrependedAppendedText ,
1516 PrependedText ,
1617 StrictButton ,
@@ -621,3 +622,17 @@ def test_switch_horizontal(self):
621622 form .helper .form_class = "form-horizontal"
622623 form .helper .layout = Layout (Switch ("is_company" ), "first_name" )
623624 assert parse_form (form ) == parse_expected ("test_switch_horizontal.html" )
625+
626+ def test_modal (self ):
627+ test_form = SampleForm ()
628+ test_form .helper = FormHelper ()
629+ test_form .helper .form_tag = False
630+ test_form .helper .layout = Layout (
631+ Modal (
632+ 'field1' ,
633+ css_id = "modal-id-ex" ,
634+ css_class = "modal-class-ex" ,
635+ title = "This is my modal" ,
636+ )
637+ )
638+ assert parse_form (test_form ) == parse_expected ("modal.html" )
You can’t perform that action at this time.
0 commit comments