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

Added Django 5.0 support and Dropped Django 3.2 and 4.1. #154

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# CHANGELOG FOR CRISPY-BOOTSTRAP5

## Next Release (TBC)
* Added Django 4.2 support
* Added Python 3.11 support
* Added Django 5.0 and 4.2 support
* Added Python 3.11 and 3.12 support
* Dropped Python 3.7 support
* Dropped Django 4.0 support
* Dropped Django 3.2, 4.0 and 4.1 support

## 0.7 (2022-09-28)
* Added Django 4.1 support
Expand Down
4 changes: 2 additions & 2 deletions crispy_bootstrap5/templates/bootstrap5/layout/help_text.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if field.help_text %}
{% if help_text_inline %}
<span id="hint_{{ field.auto_id }}" class="form-text">{{ field.help_text|safe}}</span>
<span id="{{ field.id_for_label }}_helptext" class="form-text">{{ field.help_text|safe}}</span>
{% else %}
<div id="hint_{{ field.auto_id }}" class="form-text">{{ field.help_text|safe }}</div>
<div {% if field.id_for_label %}id="{{ field.id_for_label }}_helptext" {% endif %}class="form-text">{{ field.help_text|safe }}</div>
{% endif %}
{% endif %}
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ requires-python = ">=3.8"
classifiers=[
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand All @@ -32,7 +32,7 @@ dynamic = [
"version",
]
dependencies = [
"django>=3.2",
"django>=4.2",
"django-crispy-forms>=2",
]
[project.optional-dependencies]
Expand Down
9 changes: 5 additions & 4 deletions tests/results/field_with_buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
<div class="mb-3"><label class=" form-label requiredField" for="id_email">email<span
class="asteriskField">*</span></label>
<div>
<div class="input-group"><input class="form-control inputtext textInput textinput" id="id_email"
maxlength="30" name="email" required type="text"><a class="btn btn-primary"
role="button">click me</a></div>
<div class="form-text" id="hint_id_email">Insert your email</div>
<div class="input-group">
<input class="form-control inputtext textInput textinput" id="id_email" aria-describedby="id_email_helptext"
maxlength="30" name="email" required type="text">
<a class="btn btn-primary" role="button">click me</a></div>
<div class="form-text" id="id_email_helptext">Insert your email</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/results/field_with_buttons_failing.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class="asteriskField">*</span></label>
<div>
<div class="input-group"><input class="form-control inputtext is-invalid textInput textinput"
id="id_email" maxlength="20" name="email" required type="text"><button
id="id_email" maxlength="20" name="email" required type="text" aria-invalid="true"><button
class="btn btn-outline-secondary" type="button">Go!</button></div>
<p class="mb-0 text-danger" id="error_1_id_email"><small><strong>This field is
required.</strong></small></p>
Expand Down
14 changes: 14 additions & 0 deletions tests/results/field_with_buttons_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<form method="post">
<div class=" col-md">
<div class="mb-3"><label class=" form-label requiredField" for="id_email">Email<span
class="asteriskField">*</span></label>
<div>
<div class="input-group"><input class="form-control inputtext is-invalid textInput textinput"
id="id_email" maxlength="20" name="email" required type="text"><button
class="btn btn-outline-secondary" type="button">Go!</button></div>
<p class="mb-0 text-danger" id="error_1_id_email"><small><strong>This field is
required.</strong></small></p>
</div>
</div>
</div>
</form>
14 changes: 14 additions & 0 deletions tests/results/field_with_buttons_lt50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<form method="post">
<div class=" col-md">
<div class="mb-3"><label class=" form-label requiredField" for="id_email">email<span
class="asteriskField">*</span></label>
<div>
<div class="input-group">
<input class="form-control inputtext textInput textinput" id="id_email"
maxlength="30" name="email" required type="text">
<a class="btn btn-primary" role="button">click me</a></div>
<div class="form-text" id="id_email_helptext">Insert your email</div>
</div>
</div>
</div>
</form>
4 changes: 2 additions & 2 deletions tests/results/help_text_escape.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="mb-3" id="div_id_email"><label class="form-label requiredField" for="id_email">email<span
class="asteriskField">*</span></label><input class="form-control inputtext textInput textinput"
id="id_email" name="email" required type="text" maxlength="320"><div class="form-text" id="hint_id_email">Insert
class="asteriskField">*</span></label><input class="form-control inputtext textInput textinput" aria-describedby="id_email_helptext"
id="id_email" name="email" required type="text" maxlength="320"><div class="form-text" id="id_email_helptext">Insert
your <b>email</b></div>
</div>
5 changes: 5 additions & 0 deletions tests/results/help_text_escape_lt50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="mb-3" id="div_id_email"><label class="form-label requiredField" for="id_email">email<span
class="asteriskField">*</span></label><input class="form-control inputtext textInput textinput"
id="id_email" name="email" required type="text" maxlength="320"><div class="form-text" id="id_email_helptext">Insert
your <b>email</b></div>
</div>
2 changes: 1 addition & 1 deletion tests/results/test_bootstrap5_form_inline.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<label class="visually-hidden" for="id_email">
email
</label><input class="form-control inputtext textInput textinput" id="id_email" maxlength="30" name="email"
placeholder="email" required type="text">
placeholder="email" required type="text" aria-describedby="id_email_helptext">
</div>
<div id="div_id_password1">
<label class="visually-hidden" for="id_password1">
Expand Down
20 changes: 20 additions & 0 deletions tests/results/test_bootstrap5_form_inline_lt50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<form class="row row-cols-lg-auto" method="post">
<div id="div_id_email">
<label class="visually-hidden" for="id_email">
email
</label><input class="form-control inputtext textInput textinput" id="id_email" maxlength="30" name="email"
placeholder="email" required type="text">
</div>
<div id="div_id_password1">
<label class="visually-hidden" for="id_password1">
password
</label><input class="form-control textInput textinput" id="id_password1" maxlength="30" name="password1"
placeholder="password" required type="password">
</div>
<div id="div_id_last_name">
<label class="visually-hidden" for="id_last_name">
last name
</label><input class="form-control inputtext textInput textinput" id="id_last_name" maxlength="5"
name="last_name" placeholder="last name" required type="text">
</div>
</form>
9 changes: 8 additions & 1 deletion tests/results/test_clearable_file_field_failing.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
<span class="asteriskField">*</span>
</label>
<div class="is-invalid">
<input type="file" name="clearable_file" class="form-control is-invalid" id="id_clearable_file" required>
<input
type="file"
name="clearable_file"
class="form-control is-invalid"
id="id_clearable_file"
required
aria-invalid="true"
>
<span id="error_1_id_clearable_file" class="invalid-feedback">
<strong>This field is required.</strong>
</span>
Expand Down
14 changes: 14 additions & 0 deletions tests/results/test_clearable_file_field_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<form method="post" enctype="multipart/form-data">
<div id="div_id_clearable_file" class="mb-3">
<label for="id_clearable_file" class="form-label requiredField">
Clearable file
<span class="asteriskField">*</span>
</label>
<div class="is-invalid">
<input type="file" name="clearable_file" class="form-control is-invalid" id="id_clearable_file" required>
<span id="error_1_id_clearable_file" class="invalid-feedback">
<strong>This field is required.</strong>
</span>
</div>
</div>
</form>
9 changes: 8 additions & 1 deletion tests/results/test_file_field_failing.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
<span class="asteriskField">*</span>
</label>
<div class="is-invalid">
<input type="file" name="file_field" class="form-control is-invalid" id="id_file_field" required>
<input
type="file"
name="file_field"
class="form-control is-invalid"
id="id_file_field"
required
aria-invalid="true"
>
<span id="error_1_id_file_field" class="invalid-feedback">
<strong>This field is required.</strong>
</span>
Expand Down
14 changes: 14 additions & 0 deletions tests/results/test_file_field_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<form method="post" enctype="multipart/form-data">
<div id="div_id_file_field" class="mb-3">
<label for="id_file_field" class="form-label requiredField">
File field
<span class="asteriskField">*</span>
</label>
<div class="is-invalid">
<input type="file" name="file_field" class="form-control is-invalid" id="id_file_field" required>
<span id="error_1_id_file_field" class="invalid-feedback">
<strong>This field is required.</strong>
</span>
</div>
</div>
</form>
4 changes: 2 additions & 2 deletions tests/results/test_floating_field_failing.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<form method="post" >
<div id="div_id_text_area" class="form-floating mb-3">
<textarea name="text_area" cols="40" rows="10" placeholder="text_area" class="textarea form-control is-invalid" required id="id_text_area">
<textarea name="text_area" cols="40" rows="10" placeholder="text_area" class="textarea form-control is-invalid" required id="id_text_area" aria-invalid="true">
</textarea>
<label for="id_text_area">
Text area<span class="asteriskField">*</span>
Expand All @@ -10,7 +10,7 @@
</span>
</div>
<div id="div_id_select_input" class="form-floating mb-3">
<select name="select_input" placeholder="select_input" class="select form-select is-invalid" id="id_select_input">
<select name="select_input" placeholder="select_input" class="select form-select is-invalid" id="id_select_input" aria-invalid="true">
<option value="1">Option one</option>
<option value="2">Option two</option>
<option value="3">Option three</option>
Expand Down
25 changes: 25 additions & 0 deletions tests/results/test_floating_field_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<form method="post" >
<div id="div_id_text_area" class="form-floating mb-3">
<textarea name="text_area" cols="40" rows="10" placeholder="text_area" class="textarea form-control is-invalid" required id="id_text_area">
</textarea>
<label for="id_text_area">
Text area<span class="asteriskField">*</span>
</label>
<span id="error_1_id_text_area" class="invalid-feedback">
<strong>This field is required.</strong>
</span>
</div>
<div id="div_id_select_input" class="form-floating mb-3">
<select name="select_input" placeholder="select_input" class="select form-select is-invalid" id="id_select_input">
<option value="1">Option one</option>
<option value="2">Option two</option>
<option value="3">Option three</option>
</select>
<label for="id_select_input">
Select input<span class="asteriskField">*</span>
</label>
<span id="error_1_id_select_input" class="invalid-feedback">
<strong>This field is required.</strong>
</span>
</div>
</form>
2 changes: 1 addition & 1 deletion tests/results/test_grouped_checkboxes.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
name="checkbox_select_multiple" type="checkbox" value="unknown"><label class="form-check-label"
for="id_checkbox_select_multiple_2">Unknown</label></div>
</div>
<div class="form-text" id="hint_id_checkbox_select_multiple">
<div class="form-text">
help
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions tests/results/test_grouped_checkboxes_failing.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
<div class="mb-3" id="div_id_checkbox_select_multiple"><label class="form-label requiredField">Checkbox select
multiple<span class="asteriskField">*</span></label>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_0"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_0"
name="checkbox_select_multiple" type="checkbox" value="vinyl"><label class="form-check-label"
for="id_checkbox_select_multiple_0_0">Vinyl</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_1"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_1"
name="checkbox_select_multiple" type="checkbox" value="cd"><label class="form-check-label"
for="id_checkbox_select_multiple_0_1">CD</label></div><strong>Video</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_1_0"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_checkbox_select_multiple_1_0"
name="checkbox_select_multiple" type="checkbox" value="vhs"><label class="form-check-label"
for="id_checkbox_select_multiple_1_0">VHS Tape</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_1_1"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_checkbox_select_multiple_1_1"
name="checkbox_select_multiple" type="checkbox" value="dvd"><label class="form-check-label"
for="id_checkbox_select_multiple_1_1">DVD</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_2"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_checkbox_select_multiple_2"
name="checkbox_select_multiple" type="checkbox" value="unknown"><label class="form-check-label"
for="id_checkbox_select_multiple_2">Unknown</label>
<p class="invalid-feedback" id="error_1_id_checkbox_select_multiple"><strong>This field is
required.</strong></p>
</div>
</div>
<div class="form-text" id="hint_id_checkbox_select_multiple">
<div class="form-text">
help
</div>
</div>
Expand Down
28 changes: 28 additions & 0 deletions tests/results/test_grouped_checkboxes_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<form method="post">
<div class="mb-3" id="div_id_checkbox_select_multiple"><label class="form-label requiredField">Checkbox select
multiple<span class="asteriskField">*</span></label>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_0"
name="checkbox_select_multiple" type="checkbox" value="vinyl"><label class="form-check-label"
for="id_checkbox_select_multiple_0_0">Vinyl</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_1"
name="checkbox_select_multiple" type="checkbox" value="cd"><label class="form-check-label"
for="id_checkbox_select_multiple_0_1">CD</label></div><strong>Video</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_1_0"
name="checkbox_select_multiple" type="checkbox" value="vhs"><label class="form-check-label"
for="id_checkbox_select_multiple_1_0">VHS Tape</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_1_1"
name="checkbox_select_multiple" type="checkbox" value="dvd"><label class="form-check-label"
for="id_checkbox_select_multiple_1_1">DVD</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_2"
name="checkbox_select_multiple" type="checkbox" value="unknown"><label class="form-check-label"
for="id_checkbox_select_multiple_2">Unknown</label>
<p class="invalid-feedback" id="error_1_id_checkbox_select_multiple"><strong>This field is
required.</strong></p>
</div>
</div>
<div class="form-text">
help
</div>
</div>
</form>
10 changes: 5 additions & 5 deletions tests/results/test_grouped_radios_failing.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<div class="mb-3" id="div_id_radio"><label class="form-label requiredField">Radio<span
class="asteriskField">*</span></label>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_radio_0_0"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_radio_0_0"
name="radio" required type="radio" value="vinyl"><label class="form-check-label"
for="id_radio_0_0">Vinyl</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_radio_0_1"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_radio_0_1"
name="radio" required type="radio" value="cd"><label class="form-check-label"
for="id_radio_0_1">CD</label></div><strong>Video</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_radio_1_0"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_radio_1_0"
name="radio" required type="radio" value="vhs"><label class="form-check-label"
for="id_radio_1_0">VHS Tape</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_radio_1_1"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_radio_1_1"
name="radio" required type="radio" value="dvd"><label class="form-check-label"
for="id_radio_1_1">DVD</label></div>
<div class="form-check"><input class="form-check-input is-invalid" id="id_radio_2" name="radio"
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_radio_2" name="radio"
required type="radio" value="unknown"><label class="form-check-label"
for="id_radio_2">Unknown</label>
<p class="invalid-feedback" id="error_1_id_radio"><strong>This field is
Expand Down
Loading