django-cotton-bs5 0.5.1__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/PKG-INFO +91 -6
- django_cotton_bs5-0.6.0/README.md +142 -0
- django_cotton_bs5-0.6.0/cotton_bs5/fixtures.py +217 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/accordion/index.html +1 -1
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/accordion/item.html +14 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/breadcrumbs/item.html +10 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/button/index.html +8 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/cotton_bs5/document.html +8 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/dropdown/item.html +6 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/grid/col.html +5 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/grid/index.html +6 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/hstack.html +4 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/list_group/index.html +5 -3
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/list_group/item.html +8 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/nav/item.html +4 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton/vstack.html +4 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templates/cotton_bs5/document_component.html +101 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templatetags/__init__.py +0 -0
- django_cotton_bs5-0.6.0/cotton_bs5/templatetags/cotton_bs5.py +267 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/pyproject.toml +21 -6
- django_cotton_bs5-0.5.1/README.md +0 -58
- django_cotton_bs5-0.5.1/cotton_bs5/templates/cotton/accordion/item.html +0 -8
- django_cotton_bs5-0.5.1/cotton_bs5/templates/cotton/breadcrumbs/item.html +0 -13
- django_cotton_bs5-0.5.1/cotton_bs5/templates/cotton/button/index.html +0 -15
- django_cotton_bs5-0.5.1/cotton_bs5/templates/cotton/dropdown/item.html +0 -15
- django_cotton_bs5-0.5.1/cotton_bs5/templates/cotton/grid/col.html +0 -5
- django_cotton_bs5-0.5.1/cotton_bs5/templates/cotton/grid/index.html +0 -5
- django_cotton_bs5-0.5.1/cotton_bs5/templates/cotton/list_group/item.html +0 -9
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/LICENSE +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/__init__.py +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/apps.py +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/_variables.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_accordion.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_alert.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_badge.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_breadcrumb.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_button-group.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_buttons.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_card.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_carousel.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_close.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_containers.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_dropdown.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_forms.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_functions.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_grid.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_helpers.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_images.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_list-group.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_maps.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_mixins.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_modal.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_nav.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_navbar.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_offcanvas.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_pagination.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_placeholders.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_popover.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_progress.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_reboot.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_root.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_spinners.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_tables.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_toasts.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_tooltip.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_transitions.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_type.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_utilities.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_variables-dark.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/_variables.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/bootstrap-grid.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/bootstrap-reboot.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/bootstrap-utilities.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/bootstrap.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_floating-labels.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_form-check.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_form-control.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_form-range.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_form-select.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_form-text.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_input-group.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_labels.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/forms/_validation.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_clearfix.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_color-bg.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_colored-links.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_focus-ring.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_icon-link.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_position.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_ratio.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_stacks.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_stretched-link.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_text-truncation.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_visually-hidden.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/helpers/_vr.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_alert.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_backdrop.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_banner.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_border-radius.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_box-shadow.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_breakpoints.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_buttons.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_caret.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_clearfix.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_color-mode.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_color-scheme.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_container.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_deprecate.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_forms.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_gradients.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_grid.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_image.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_list-group.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_lists.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_pagination.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_reset-text.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_resize.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_table-variants.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_text-truncate.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_transition.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_utilities.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/mixins/_visually-hidden.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/utilities/_api.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/bs5/vendor/_rfs.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/static/stylesheet.scss +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/accordion/body.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/accordion/header.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/alert.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/badge.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/breadcrumbs/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/button/dismiss.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/button_group.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/card/body.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/card/footer.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/card/header.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/card/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/card/subtitle.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/card/title.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/carousel/button.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/carousel/caption.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/carousel/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/carousel/item.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/collapse.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/dropdown/divider.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/dropdown/header.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/dropdown/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/dropdown/toggle.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/modal/body.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/modal/footer.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/modal/header.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/modal/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/modal/title.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/nav/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/nav/link.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/navbar/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/navbar/link.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/navbar/links.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/offcanvas/body.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/offcanvas/footer.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/offcanvas/header.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/offcanvas/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/offcanvas/title.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/pagination/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/pagination/link.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/pagination/wrapper.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/placeholder.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/progress.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/ratio.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/spinner.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/table.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/tabs/content.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/tabs/index.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/tabs/item.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/tabs/pane.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/toast/activate.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/toast/body.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/toast/header.html +0 -0
- {django_cotton_bs5-0.5.1 → django_cotton_bs5-0.6.0}/cotton_bs5/templates/cotton/toast/index.html +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-cotton-bs5
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Bootstrap 5 components for use with Django Cotton.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Sam
|
|
7
7
|
Author-email: samuel.scott.jennings@gmail.com
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.12,<4.00
|
|
9
|
+
Classifier: Framework :: Django
|
|
10
|
+
Classifier: Framework :: Pytest
|
|
9
11
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
12
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Provides-Extra: django-compressor
|
|
15
|
+
Requires-Dist: beautifulsoup4 (>=4.14.3,<5.0.0)
|
|
15
16
|
Requires-Dist: django-compressor (>=4.5.1,<5.0.0) ; extra == "django-compressor"
|
|
16
|
-
Requires-Dist: django-cotton (>=2.3.
|
|
17
|
-
Requires-Dist: django-libsass (>=0.9,<0.10)
|
|
17
|
+
Requires-Dist: django-cotton (>=2.6.1,<3.0.0)
|
|
18
|
+
Requires-Dist: django-libsass (>=0.9,<0.10) ; extra == "django-compressor"
|
|
18
19
|
Description-Content-Type: text/markdown
|
|
19
20
|
|
|
20
21
|
# Django Cotton BS5
|
|
@@ -62,6 +63,90 @@ The following Bootstrap 5 components are currently available as Django Cotton co
|
|
|
62
63
|
|
|
63
64
|
More components are planned. Please request additional Bootstrap 5 components or features via the [issue tracker](https://github.com/SamuelJennings/cotton-bs5/issues).
|
|
64
65
|
|
|
66
|
+
## Testing Components
|
|
67
|
+
|
|
68
|
+
This package provides four pytest fixtures for testing Django Cotton components:
|
|
69
|
+
|
|
70
|
+
### `cotton_render` Fixture
|
|
71
|
+
|
|
72
|
+
Renders a component and returns the raw HTML as a string.
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
def test_alert_component(cotton_render):
|
|
76
|
+
html = cotton_render(
|
|
77
|
+
'cotton_bs5.alert',
|
|
78
|
+
message="Hello World",
|
|
79
|
+
variant="success"
|
|
80
|
+
)
|
|
81
|
+
assert 'alert-success' in html
|
|
82
|
+
assert 'Hello World' in html
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### `cotton_render_soup` Fixture
|
|
86
|
+
|
|
87
|
+
Renders a component and returns a BeautifulSoup parsed HTML object for easier DOM traversal and assertions.
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
def test_alert_component(cotton_render_soup):
|
|
91
|
+
soup = cotton_render_soup(
|
|
92
|
+
'cotton_bs5.alert',
|
|
93
|
+
message="Hello World",
|
|
94
|
+
variant="success"
|
|
95
|
+
)
|
|
96
|
+
alert_div = soup.find('div', class_='alert')
|
|
97
|
+
assert 'alert-success' in alert_div['class']
|
|
98
|
+
assert alert_div.get_text() == 'Hello World'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `cotton_render_string` Fixture
|
|
102
|
+
|
|
103
|
+
Compiles and renders template strings containing Cotton component syntax. Useful for testing multi-component markup and complex layouts inline without creating separate template files.
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
def test_button_inline(cotton_render_string):
|
|
107
|
+
html = cotton_render_string("<c-button variant='primary'>Click me</c-button>")
|
|
108
|
+
assert 'btn-primary' in html
|
|
109
|
+
|
|
110
|
+
def test_nested_components(cotton_render_string):
|
|
111
|
+
html = cotton_render_string(
|
|
112
|
+
"<c-ul><c-li text='first' /><c-li text='second' /></c-ul>"
|
|
113
|
+
)
|
|
114
|
+
assert 'first' in html
|
|
115
|
+
assert 'second' in html
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### `cotton_render_string_soup` Fixture
|
|
119
|
+
|
|
120
|
+
Combines `cotton_render_string` with BeautifulSoup parsing for easier DOM traversal and assertions on multi-component structures.
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
def test_nested_list(cotton_render_string_soup):
|
|
124
|
+
soup = cotton_render_string_soup(
|
|
125
|
+
"<c-ul><c-li text='first' /><c-li text='second' /></c-ul>"
|
|
126
|
+
)
|
|
127
|
+
items = soup.find_all('li')
|
|
128
|
+
assert len(items) == 2
|
|
129
|
+
assert items[0].get_text() == 'first'
|
|
130
|
+
|
|
131
|
+
def test_complex_layout(cotton_render_string_soup):
|
|
132
|
+
template = '''
|
|
133
|
+
<c-card>
|
|
134
|
+
<c-card.title>{{ title }}</c-card.title>
|
|
135
|
+
<c-card.body>
|
|
136
|
+
<c-button variant='primary'>{{ action }}</c-button>
|
|
137
|
+
</c-card.body>
|
|
138
|
+
</c-card>
|
|
139
|
+
'''
|
|
140
|
+
soup = cotton_render_string_soup(template, context={
|
|
141
|
+
'title': 'My Card',
|
|
142
|
+
'action': 'Click Here'
|
|
143
|
+
})
|
|
144
|
+
assert soup.find('h5').get_text() == 'My Card'
|
|
145
|
+
assert 'btn-primary' in soup.find('button')['class']
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
All fixtures automatically inject a request object, so you don't need to create one manually.
|
|
149
|
+
|
|
65
150
|
## Contributing
|
|
66
151
|
|
|
67
152
|
This library follows django-cotton conventions and Bootstrap 5 standards. When adding new components:
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Django Cotton BS5
|
|
2
|
+
|
|
3
|
+
Bootstrap 5 components for Django Cotton - A comprehensive library of reusable, modular components.
|
|
4
|
+
|
|
5
|
+
**Note:** This project is currently a work in progress. Users are encouraged to request new components or features via the [issue tracker](https://github.com/SamuelJennings/cotton-bs5/issues).
|
|
6
|
+
|
|
7
|
+
[View demo](https://samueljennings.github.io/cotton-bs5/)
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install django-cotton-bs5
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Add `cotton_bs5` to your `INSTALLED_APPS` in `settings.py`:
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
INSTALLED_APPS = [
|
|
19
|
+
...
|
|
20
|
+
"django_cotton",
|
|
21
|
+
"cotton_bs5",
|
|
22
|
+
...
|
|
23
|
+
]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Available Components
|
|
27
|
+
|
|
28
|
+
The following Bootstrap 5 components are currently available as Django Cotton components:
|
|
29
|
+
|
|
30
|
+
- **Alert** (`<c-alert>`) — Bootstrap alerts with variants, dismissible, slot/text support
|
|
31
|
+
- **Accordion** (`<c-accordion>`, `<c-accordion.item>`, `<c-accordion.header>`) — Collapsible accordion panels
|
|
32
|
+
- **Breadcrumbs** (`<c-breadcrumbs>`, `<c-breadcrumbs.item>`) — Navigation breadcrumbs
|
|
33
|
+
- **Button** (`<c-button>`) — Button/link with variants, outline, icon, slot/text
|
|
34
|
+
- **Button Group** (`<c-button_group>`) — Grouped buttons, vertical/size/label support
|
|
35
|
+
- **Card** (`<c-card>`, `<c-card.body>`, `<c-card.title>`) — Card container, body, and title
|
|
36
|
+
- **List Group** (`<c-list_group>`, `<c-list_group.item>`) — List group and items, horizontal/numbered/active/disabled
|
|
37
|
+
- **Modal** (`<c-modal>`, `<c-modal.title>`, `<c-modal.body>`) — Modal dialog, title, and body
|
|
38
|
+
- **Navbar** (`<c-navbar>`) — Responsive navigation bar with brand, expand, toggler
|
|
39
|
+
- **Progress** (`<c-progress>`) — Progress bar with value, min/max, variant, striped, animated, label
|
|
40
|
+
- **Spinner** (`<c-spinner>`) — Loading spinner, border/grow, size, variant, label
|
|
41
|
+
- **Table** (`<c-table>`) — Responsive table, striped, bordered, hover, small, variant, caption
|
|
42
|
+
- **Tabs** (`<c-tabs>`, `<c-tabs.item>`, `<c-tabs.pane>`) — Tab navigation and tab panes
|
|
43
|
+
|
|
44
|
+
More components are planned. Please request additional Bootstrap 5 components or features via the [issue tracker](https://github.com/SamuelJennings/cotton-bs5/issues).
|
|
45
|
+
|
|
46
|
+
## Testing Components
|
|
47
|
+
|
|
48
|
+
This package provides four pytest fixtures for testing Django Cotton components:
|
|
49
|
+
|
|
50
|
+
### `cotton_render` Fixture
|
|
51
|
+
|
|
52
|
+
Renders a component and returns the raw HTML as a string.
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
def test_alert_component(cotton_render):
|
|
56
|
+
html = cotton_render(
|
|
57
|
+
'cotton_bs5.alert',
|
|
58
|
+
message="Hello World",
|
|
59
|
+
variant="success"
|
|
60
|
+
)
|
|
61
|
+
assert 'alert-success' in html
|
|
62
|
+
assert 'Hello World' in html
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### `cotton_render_soup` Fixture
|
|
66
|
+
|
|
67
|
+
Renders a component and returns a BeautifulSoup parsed HTML object for easier DOM traversal and assertions.
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
def test_alert_component(cotton_render_soup):
|
|
71
|
+
soup = cotton_render_soup(
|
|
72
|
+
'cotton_bs5.alert',
|
|
73
|
+
message="Hello World",
|
|
74
|
+
variant="success"
|
|
75
|
+
)
|
|
76
|
+
alert_div = soup.find('div', class_='alert')
|
|
77
|
+
assert 'alert-success' in alert_div['class']
|
|
78
|
+
assert alert_div.get_text() == 'Hello World'
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `cotton_render_string` Fixture
|
|
82
|
+
|
|
83
|
+
Compiles and renders template strings containing Cotton component syntax. Useful for testing multi-component markup and complex layouts inline without creating separate template files.
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
def test_button_inline(cotton_render_string):
|
|
87
|
+
html = cotton_render_string("<c-button variant='primary'>Click me</c-button>")
|
|
88
|
+
assert 'btn-primary' in html
|
|
89
|
+
|
|
90
|
+
def test_nested_components(cotton_render_string):
|
|
91
|
+
html = cotton_render_string(
|
|
92
|
+
"<c-ul><c-li text='first' /><c-li text='second' /></c-ul>"
|
|
93
|
+
)
|
|
94
|
+
assert 'first' in html
|
|
95
|
+
assert 'second' in html
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### `cotton_render_string_soup` Fixture
|
|
99
|
+
|
|
100
|
+
Combines `cotton_render_string` with BeautifulSoup parsing for easier DOM traversal and assertions on multi-component structures.
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
def test_nested_list(cotton_render_string_soup):
|
|
104
|
+
soup = cotton_render_string_soup(
|
|
105
|
+
"<c-ul><c-li text='first' /><c-li text='second' /></c-ul>"
|
|
106
|
+
)
|
|
107
|
+
items = soup.find_all('li')
|
|
108
|
+
assert len(items) == 2
|
|
109
|
+
assert items[0].get_text() == 'first'
|
|
110
|
+
|
|
111
|
+
def test_complex_layout(cotton_render_string_soup):
|
|
112
|
+
template = '''
|
|
113
|
+
<c-card>
|
|
114
|
+
<c-card.title>{{ title }}</c-card.title>
|
|
115
|
+
<c-card.body>
|
|
116
|
+
<c-button variant='primary'>{{ action }}</c-button>
|
|
117
|
+
</c-card.body>
|
|
118
|
+
</c-card>
|
|
119
|
+
'''
|
|
120
|
+
soup = cotton_render_string_soup(template, context={
|
|
121
|
+
'title': 'My Card',
|
|
122
|
+
'action': 'Click Here'
|
|
123
|
+
})
|
|
124
|
+
assert soup.find('h5').get_text() == 'My Card'
|
|
125
|
+
assert 'btn-primary' in soup.find('button')['class']
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
All fixtures automatically inject a request object, so you don't need to create one manually.
|
|
129
|
+
|
|
130
|
+
## Contributing
|
|
131
|
+
|
|
132
|
+
This library follows django-cotton conventions and Bootstrap 5 standards. When adding new components:
|
|
133
|
+
|
|
134
|
+
1. Use `<c-vars />` for default values
|
|
135
|
+
2. Include proper accessibility attributes
|
|
136
|
+
3. Support all relevant Bootstrap 5 options
|
|
137
|
+
4. Maintain consistent naming conventions
|
|
138
|
+
5. Test with various configurations
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"""Pytest fixtures for testing Django Cotton BS5 components."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from bs4 import BeautifulSoup
|
|
5
|
+
from django.template import Context, Template
|
|
6
|
+
from django.test import RequestFactory
|
|
7
|
+
from django_cotton import render_component
|
|
8
|
+
from django_cotton.compiler_regex import CottonCompiler
|
|
9
|
+
|
|
10
|
+
compiler = CottonCompiler()
|
|
11
|
+
|
|
12
|
+
@pytest.fixture
|
|
13
|
+
def cotton_render():
|
|
14
|
+
"""
|
|
15
|
+
Fixture that renders Django-Cotton components and returns raw HTML.
|
|
16
|
+
|
|
17
|
+
Automatically provides a request object to be DRY. Component variables
|
|
18
|
+
are passed as kwargs.
|
|
19
|
+
|
|
20
|
+
Usage:
|
|
21
|
+
def test_something(cotton_render):
|
|
22
|
+
html = cotton_render(
|
|
23
|
+
'cotton_bs5.alert',
|
|
24
|
+
message="Hello",
|
|
25
|
+
type="success"
|
|
26
|
+
)
|
|
27
|
+
assert 'alert-success' in html
|
|
28
|
+
"""
|
|
29
|
+
factory = RequestFactory()
|
|
30
|
+
|
|
31
|
+
def _render(component_name, context=None, **kwargs):
|
|
32
|
+
"""
|
|
33
|
+
Render a Cotton component with automatic request injection.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
component_name: Component name in dotted notation (e.g., "cotton_bs5.alert")
|
|
37
|
+
context: Optional context dict to pass as component attributes
|
|
38
|
+
**kwargs: Component attributes (alternative to context dict)
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
Rendered HTML string
|
|
42
|
+
"""
|
|
43
|
+
request = factory.get("/")
|
|
44
|
+
return render_component(request, component_name, context, **kwargs)
|
|
45
|
+
|
|
46
|
+
return _render
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@pytest.fixture
|
|
50
|
+
def cotton_render_soup():
|
|
51
|
+
"""
|
|
52
|
+
Fixture that renders Django-Cotton components and returns BeautifulSoup parsed HTML.
|
|
53
|
+
|
|
54
|
+
Automatically provides a request object and parses the result for easy testing.
|
|
55
|
+
Component variables are passed as kwargs.
|
|
56
|
+
|
|
57
|
+
Usage:
|
|
58
|
+
def test_something(cotton_render_soup):
|
|
59
|
+
soup = cotton_render_soup(
|
|
60
|
+
'cotton_bs5.alert',
|
|
61
|
+
message="Hello",
|
|
62
|
+
type="success"
|
|
63
|
+
)
|
|
64
|
+
assert soup.find('div')['class'] == ['alert', 'alert-success']
|
|
65
|
+
"""
|
|
66
|
+
factory = RequestFactory()
|
|
67
|
+
|
|
68
|
+
def _render(component_name, context=None, **kwargs):
|
|
69
|
+
"""
|
|
70
|
+
Render a Cotton component with automatic request injection and parse with BeautifulSoup.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
component_name: Component name in dotted notation (e.g., "cotton_bs5.alert")
|
|
74
|
+
context: Optional context dict to pass as component attributes
|
|
75
|
+
**kwargs: Component attributes (alternative to context dict)
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
BeautifulSoup parsed HTML object
|
|
79
|
+
"""
|
|
80
|
+
request = factory.get("/")
|
|
81
|
+
html = render_component(request, component_name, context, **kwargs)
|
|
82
|
+
return BeautifulSoup(html, "html.parser")
|
|
83
|
+
|
|
84
|
+
return _render
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@pytest.fixture
|
|
88
|
+
def cotton_render_string():
|
|
89
|
+
"""
|
|
90
|
+
Fixture that compiles and renders Django template strings containing Cotton component syntax.
|
|
91
|
+
|
|
92
|
+
This fixture takes a raw template string with Cotton components (e.g., <c-button>),
|
|
93
|
+
compiles it through django-cotton's compiler, then renders it through Django's
|
|
94
|
+
Template system. Useful for testing inline component markup without creating
|
|
95
|
+
separate template files.
|
|
96
|
+
|
|
97
|
+
Usage:
|
|
98
|
+
def test_button_in_template(cotton_render_string):
|
|
99
|
+
html = cotton_render_string("<c-button variant='primary'>Click me</c-button>")
|
|
100
|
+
assert 'btn-primary' in html
|
|
101
|
+
|
|
102
|
+
def test_with_context(cotton_render_string):
|
|
103
|
+
html = cotton_render_string(
|
|
104
|
+
"<c-alert>{{ message }}</c-alert>",
|
|
105
|
+
context={'message': 'Hello World'}
|
|
106
|
+
)
|
|
107
|
+
assert 'Hello World' in html
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
A callable function that accepts:
|
|
111
|
+
- template_string (str): Django template string with Cotton component syntax
|
|
112
|
+
- context (dict, optional): Template context variables
|
|
113
|
+
|
|
114
|
+
The function returns the rendered HTML as a string.
|
|
115
|
+
"""
|
|
116
|
+
factory = RequestFactory()
|
|
117
|
+
|
|
118
|
+
def _render(template_string, context=None):
|
|
119
|
+
"""
|
|
120
|
+
Compile and render a template string with Cotton components.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
template_string: The Django template string containing Cotton component syntax
|
|
124
|
+
context: Optional context dict for template variables
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
Rendered HTML string
|
|
128
|
+
"""
|
|
129
|
+
if context is None:
|
|
130
|
+
context = {}
|
|
131
|
+
request = factory.get("/")
|
|
132
|
+
context['request'] = request
|
|
133
|
+
|
|
134
|
+
# Compile Cotton component syntax into Django template syntax
|
|
135
|
+
compiled_template = compiler.process(template_string)
|
|
136
|
+
|
|
137
|
+
# Render through Django's Template system
|
|
138
|
+
django_template = Template(compiled_template)
|
|
139
|
+
django_context = Context(context)
|
|
140
|
+
return django_template.render(django_context)
|
|
141
|
+
|
|
142
|
+
return _render
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
@pytest.fixture
|
|
146
|
+
def cotton_render_string_soup():
|
|
147
|
+
"""
|
|
148
|
+
Fixture that compiles and renders Django template strings with Cotton components,
|
|
149
|
+
returning BeautifulSoup parsed HTML.
|
|
150
|
+
|
|
151
|
+
This fixture combines the capabilities of cotton_render_string with BeautifulSoup
|
|
152
|
+
parsing for easier DOM traversal and assertions. Particularly useful for testing
|
|
153
|
+
multi-component features where you need to verify nested structure and relationships.
|
|
154
|
+
|
|
155
|
+
Usage:
|
|
156
|
+
def test_nested_list(cotton_render_string_soup):
|
|
157
|
+
soup = cotton_render_string_soup(
|
|
158
|
+
"<c-ul><c-li text='first' /><c-li text='second' /></c-ul>"
|
|
159
|
+
)
|
|
160
|
+
items = soup.find_all('li')
|
|
161
|
+
assert len(items) == 2
|
|
162
|
+
assert items[0].get_text() == 'first'
|
|
163
|
+
assert items[1].get_text() == 'second'
|
|
164
|
+
|
|
165
|
+
def test_complex_layout_with_context(cotton_render_string_soup):
|
|
166
|
+
template = '''
|
|
167
|
+
<c-card>
|
|
168
|
+
<c-card.title>{{ title }}</c-card.title>
|
|
169
|
+
<c-card.body>
|
|
170
|
+
<c-button variant='primary'>{{ action }}</c-button>
|
|
171
|
+
</c-card.body>
|
|
172
|
+
</c-card>
|
|
173
|
+
'''
|
|
174
|
+
soup = cotton_render_string_soup(template, context={
|
|
175
|
+
'title': 'My Card',
|
|
176
|
+
'action': 'Click Here'
|
|
177
|
+
})
|
|
178
|
+
assert soup.find('h5').get_text() == 'My Card'
|
|
179
|
+
assert 'btn-primary' in soup.find('button')['class']
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
A callable function that accepts:
|
|
183
|
+
- template_string (str): Django template string with Cotton component syntax
|
|
184
|
+
- context (dict, optional): Template context variables
|
|
185
|
+
|
|
186
|
+
The function returns a BeautifulSoup parsed HTML object.
|
|
187
|
+
"""
|
|
188
|
+
factory = RequestFactory()
|
|
189
|
+
|
|
190
|
+
def _render(template_string, context=None):
|
|
191
|
+
"""
|
|
192
|
+
Compile, render, and parse a template string with Cotton components.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
template_string: The Django template string containing Cotton component syntax
|
|
196
|
+
context: Optional context dict for template variables
|
|
197
|
+
|
|
198
|
+
Returns:
|
|
199
|
+
BeautifulSoup parsed HTML object
|
|
200
|
+
"""
|
|
201
|
+
if context is None:
|
|
202
|
+
context = {}
|
|
203
|
+
request = factory.get("/")
|
|
204
|
+
context['request'] = request
|
|
205
|
+
|
|
206
|
+
# Compile Cotton component syntax into Django template syntax
|
|
207
|
+
compiled_template = compiler.process(template_string)
|
|
208
|
+
|
|
209
|
+
# Render through Django's Template system
|
|
210
|
+
django_template = Template(compiled_template)
|
|
211
|
+
django_context = Context(context)
|
|
212
|
+
html = django_template.render(django_context)
|
|
213
|
+
|
|
214
|
+
# Parse with BeautifulSoup for easy DOM traversal
|
|
215
|
+
return BeautifulSoup(html, "html.parser")
|
|
216
|
+
|
|
217
|
+
return _render
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{% load cotton_bs5 %}
|
|
2
|
+
<c-vars id text target header class show />
|
|
3
|
+
{% cotton_parent as parent %}
|
|
4
|
+
{% genid "accordion-item" as uid %}
|
|
5
|
+
{% firstof id uid as target %}
|
|
6
|
+
<div class="accordion-item {{ class }}" {{ attrs }}>
|
|
7
|
+
{% if text %}<c-accordion.header target="{{ target }}" :attrs="attrs" />{% endif %}
|
|
8
|
+
{{ header }}
|
|
9
|
+
<c-accordion.body id="{{ target }}"
|
|
10
|
+
parent="{{ parent.id }}"
|
|
11
|
+
:attrs="attrs">
|
|
12
|
+
{{ slot }}
|
|
13
|
+
</c-accordion.body>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<c-vars text class />
|
|
2
|
+
{% with element=href|yesno:"a,span" %}
|
|
3
|
+
{# djlint:off #}
|
|
4
|
+
<li class="breadcrumb-item{% if element == 'span' %} active{% endif %} {{ class }}"{% if element == 'span' %} aria-current="page"{% endif %}>
|
|
5
|
+
<{{ element }}{% if href %} class="link-underline link-underline-opacity-0 link-underline-opacity-75-hover"{% endif %} {{ attrs }}>
|
|
6
|
+
{{ text }}{{ slot }}
|
|
7
|
+
</{{ element }}>
|
|
8
|
+
</li>
|
|
9
|
+
{# djlint:on #}
|
|
10
|
+
{% endwith %}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<c-vars variant="primary" size="" outline="" text class />
|
|
2
|
+
{# djlint:off #}
|
|
3
|
+
{% with element=href|yesno:"a,button" %}
|
|
4
|
+
<{{ element }} class="btn{% if outline %} btn-outline-{{ variant }}{% else %} btn-{{ variant }}{% endif %}{% if size %} btn-{{ size }}{% endif %} {{ class }}" {{ attrs }}>
|
|
5
|
+
{{ slot }} {{ text }}
|
|
6
|
+
</{{ element }}>
|
|
7
|
+
{% endwith %}
|
|
8
|
+
{# djlint:on #}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<c-vars text active disabled class />
|
|
2
|
+
{% with element=href|yesno:"a,button" %}
|
|
3
|
+
{# djlint:off #}
|
|
4
|
+
<{{ element }} class="dropdown-item{% if active %} active{% endif %}{% if disabled %} disabled{% endif %}{% if class %} {{ class }}{% endif %}"{% if element == "button" %} type="button"{% endif %}{% if disabled %}{% if element == "a" %} tabindex="-1" aria-disabled="true"{% else %} disabled{% endif %}{% endif %} {{ attrs }}>{{ text }}{{ slot }}</{{ element }}>
|
|
5
|
+
{# djlint:on #}
|
|
6
|
+
{% endwith %}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<c-vars cols=1 gap="1" sm md lg xl xxl class />
|
|
2
|
+
<div class="row{% if cols %} row-cols-{{ cols }}{% endif %}{% if gap %} g-{{ gap }}{% endif %}{% if sm %} row-cols-sm-{{ sm }}{% endif %}{% if md %} row-cols-md-{{ sm }}{% endif %}{% if lg %} row-cols-lg-{{ lg }}{% endif %}{% if xl %} row-cols-xl-{{ xl }}{% endif %}{% if xl %} row-cols-xl-{{ xl }}{% endif %}{% if xxl %} row-cols-xxl-{{ xxl }}{% endif %}{{ class }}"
|
|
3
|
+
{{ attrs }}>
|
|
4
|
+
{{ slot }}
|
|
5
|
+
</div>
|
|
6
|
+
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
:horizontal="False"
|
|
4
4
|
class />
|
|
5
5
|
{# djlint:off #}
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
{% with numbered|yesno:"ol,ul" as element %}
|
|
7
|
+
<{{ element }}
|
|
8
|
+
class="list-group{% if flush %} list-group-flush{% endif %}{% if horizontal %} list-group-horizontal{% if horizontal != True %}-{{ horizontal }}{% endif %}{% endif %} {{ class }}"
|
|
8
9
|
{{ attrs }}>
|
|
9
10
|
{{ slot }}
|
|
10
|
-
</{
|
|
11
|
+
</{{ element }}>
|
|
12
|
+
{% endwith %}
|
|
11
13
|
{# djlint:on #}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<c-vars text active disabled variant class />
|
|
2
|
+
{# djlint:off #}
|
|
3
|
+
{% with element=href|yesno:"a,li" %}
|
|
4
|
+
<{{ element }} class="list-group-item{% if href %} list-group-item-action{% endif %}{% if active %} active{% elif disabled %} disabled{% endif %}{% if variant %} list-group-item-{{ variant }}{% endif %} {{ class }}"{% if active %} aria-current="true"{% elif disabled %} aria-disabled="true"{% endif %} {{ attrs }}>
|
|
5
|
+
{{ text }}{{ slot }}
|
|
6
|
+
</{{ element }}>
|
|
7
|
+
{% endwith %}
|
|
8
|
+
{# djlint:on #}
|