Skip to content

Commit

Permalink
Fix issue zostera#204
Browse files Browse the repository at this point in the history
Fix issue zostera#153
Version bump to 21.2
  • Loading branch information
isolationism committed Nov 24, 2021
1 parent c6bb055 commit 86aa857
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 21.2 (2011-11-24)

- Fixes CDN URL in BOOTSTRAP5_DEFAULTS setting for javascript dependencies (#208).
- Correct bootstrap_field.addon_[before|after]_class behavior to match documentation (#153).

## 21.1 (2021-11-01)

- Switch to a [CalVer](https://calver.org) YY.MINOR versioning scheme. MINOR is the number of the release in the given year. This is the first release in 2021 using this scheme, so its version is 21.1. The next version this year will be 21.2. The first version in 2022 will be 22.1.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
setup(
name="django-bootstrap5",
zip_safe=False,
version="21.1",
version="21.2",
description="Bootstrap 5 for Django",
long_description=README,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion src/django_bootstrap5/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"crossorigin": "anonymous",
},
"javascript_url": {
"url": "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.j",
"url": "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js",
"integrity": "sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p",
"crossorigin": "anonymous",
},
Expand Down
15 changes: 10 additions & 5 deletions src/django_bootstrap5/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,17 @@ def render(self):
errors = self.get_errors_html()

if self.is_form_control_widget():
addon_before = (
format_html('<span class="input-group-text">{}</span>', self.addon_before) if self.addon_before else ""
)
addon_after = (
format_html('<span class="input-group-text">{}</span>', self.addon_after) if self.addon_after else ""
addon_before_wrapper = self.addon_before or ""
addon_after_wrapper = self.addon_after or ""
if self.addon_before and self.addon_before_class is not None:
addon_before_wrapper = format_html(
f'<span class="{self.addon_before_class}">{self.addon_before}</span>'
)
if self.addon_after and self.addon_after_class is not None:
addon_before_wrapper = format_html(
f'<span class="{self.addon_after_class}">{self.addon_after}</span>'
)

if addon_before or addon_after:
classes = "input-group"
if self.server_side_validation and self.get_server_side_validation_classes():
Expand Down

0 comments on commit 86aa857

Please sign in to comment.