pax_global_header 0000666 0000000 0000000 00000000064 14520113325 0014506 g ustar 00root root 0000000 0000000 52 comment=c7be48c07fdb316ab2cb6dd1cda4715ef6e9425a crispy-bootstrap5-2023.10/ 0000775 0000000 0000000 00000000000 14520113325 0015266 5 ustar 00root root 0000000 0000000 crispy-bootstrap5-2023.10/.github/ 0000775 0000000 0000000 00000000000 14520113325 0016626 5 ustar 00root root 0000000 0000000 crispy-bootstrap5-2023.10/.github/workflows/ 0000775 0000000 0000000 00000000000 14520113325 0020663 5 ustar 00root root 0000000 0000000 crispy-bootstrap5-2023.10/.github/workflows/publish.yml 0000664 0000000 0000000 00000003036 14520113325 0023056 0 ustar 00root root 0000000 0000000 name: Publish Python Package on: release: types: [created] jobs: tests: name: Python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip wheel setuptools python -m pip install --upgrade tox - name: Run tox targets for ${{ matrix.python-version }} run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) deploy: runs-on: ubuntu-latest needs: [tests] steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: python-version: "3.10" - uses: actions/cache@v2 name: Configure pip caching with: path: ~/.cache/pip key: ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }} restore-keys: | ${{ runner.os }}-publish-pip- - name: Install dependencies run: | pip install build twine - name: Publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | python -m build twine upload dist/* crispy-bootstrap5-2023.10/.github/workflows/test.yml 0000664 0000000 0000000 00000002234 14520113325 0022366 0 ustar 00root root 0000000 0000000 name: Test on: push: branches: - main pull_request: jobs: tests: name: Python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip wheel setuptools python -m pip install --upgrade tox - name: Run tox targets for ${{ matrix.python-version }} run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.11" - name: Install dependencies run: | python -m pip install --upgrade pip tox - name: Run lint run: tox -e lint crispy-bootstrap5-2023.10/.gitignore 0000664 0000000 0000000 00000000157 14520113325 0017261 0 ustar 00root root 0000000 0000000 .venv __pycache__/ *.py[cod] *$py.class venv .eggs .pytest_cache *.egg-info .DS_Store .vscode *python-version crispy-bootstrap5-2023.10/.pre-commit-config.yaml 0000664 0000000 0000000 00000000423 14520113325 0021546 0 ustar 00root root 0000000 0000000 repos: - repo: https://github.com/psf/black rev: 23.3.0 hooks: - id: black - repo: https://github.com/pycqa/isort rev: 5.12.0 hooks: - id: isort - repo: https://github.com/pycqa/flake8 rev: 6.0.0 hooks: - id: flake8 crispy-bootstrap5-2023.10/CHANGELOG.md 0000664 0000000 0000000 00000004371 14520113325 0017104 0 ustar 00root root 0000000 0000000 # CHANGELOG FOR CRISPY-BOOTSTRAP5 ## 2023.10 (2023-10-2023) * Added Django 5.0 and 4.2 support * Added Python 3.11 and 3.12 support * Dropped Python 3.7 support * Dropped Django 3.2, 4.0 and 4.1 support * Switched to CalVer versioning See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/8?closed=1) for full change log. ## 0.7 (2022-09-28) * Added Django 4.1 support See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestones?state=closed) for for change list. ## 0.6 (2021-09-28) * Added Django 4.0 support ## 0.5 (2021-08-20) * Added support for [Accordion Flush](https://getbootstrap.com/docs/5.0/components/accordion/#flush) and [Always Open](https://getbootstrap.com/docs/5.0/components/accordion/#always-open) (#63) * Added support for grouped inputs (#64) * Added support for clearable file field (#53) * Removed various `|safe` filters in templates See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/6?closed=1) for full changelog. ## 0.4 (2021-05-27) * Added support for Bootstrap 5 Floating Labels (#42) * Dropped support for Django 3.0 * Added support for Django 3.2 See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/5?closed=1) for full changelog. ## 0.3.1(2021-03-03) * Fixed classes for `row` layout object (#36) See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/4?closed=1) for full changelog. ## 0.3 (2021-02-21) * Fixed rendering of select widgets (#31) See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/3?closed=1) for full changelog. ## 0.2 (2021-01-31) * Tested for compatibility with Bootstrap5 Beta 1 * Fixed InlineField (#28) * Implemented new Bootstrap5 accordion (#24) * Improved tests and fixed rendering of blank attributes (#23) See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/2) for full changelog. ## 0.1 (2020-11-19) * Initial release, compatibility with Bootstrap5 Alpha 3 * Converted templates from Bootstrap 4, and initial set of fixes * Brought forward Bootstrap 4 test suite and updated for Bootstrap5 See [Milestones](https://github.com/django-crispy-forms/crispy-bootstrap5/milestone/1) for full changelog. crispy-bootstrap5-2023.10/LICENSE 0000664 0000000 0000000 00000002060 14520113325 0016271 0 ustar 00root root 0000000 0000000 Copyright (c) 2020 David Smith and contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. crispy-bootstrap5-2023.10/MANIFEST.in 0000664 0000000 0000000 00000000145 14520113325 0017024 0 ustar 00root root 0000000 0000000 include LICENSE include MANIFEST.in include README.md recursive-include crispy_bootstrap5/templates * crispy-bootstrap5-2023.10/README.md 0000664 0000000 0000000 00000003757 14520113325 0016561 0 ustar 00root root 0000000 0000000 # crispy-bootstrap5 [](https://github.com/smithdc1/crispy-bootstrap5/blob/main/LICENSE) Bootstrap5 template pack for django-crispy-forms ## Installation Install this plugin using `pip`: ```bash $ pip install crispy-bootstrap5 ``` ## Usage You will need to update your project's settings file to add ``crispy_forms`` and ``crispy_bootstrap5`` to your projects ``INSTALLED_APPS``. Also set ``bootstrap5`` as and allowed template pack and as the default template pack for your project ```python INSTALLED_APPS = ( ... "crispy_forms", "crispy_bootstrap5", ... ) CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5" CRISPY_TEMPLATE_PACK = "bootstrap5" ``` ## What's new? Bootstrap 5 introduces [floating labels](https://getbootstrap.com/docs/5.0/forms/floating-labels/). This template pack include a layout object to use this input type ```python from crispy_bootstrap5.bootstrap5 import FloatingField # then in your Layout ... Layout( FloatingField("first_name"), ) ``` Accordions also have new features, such as [Accordion flush](https://getbootstrap.com/docs/5.0/components/accordion/#flush) and [Always open](https://getbootstrap.com/docs/5.0/components/accordion/#always-open). There is a new layout object to use them ```python from crispy_bootstrap5.bootstrap5 import BS5Accordion # then in your Layout # if not informed, flush and always_open default to False ... Layout( BS5Accordion( AccordionGroup("group name", "form_field_1", "form_field_2"), AccordionGroup("another group name", "form_field"), flush=True, always_open=True ) ) ``` ## Development To contribute to this library, first checkout the code. Then create a new virtual environment: ```bash cd crispy-bootstrap5 python -mvenv venv source venv/bin/activate ``` Or if you are using `pipenv`: ```bash pipenv shell ``` Now install the dependencies and tests: ```bash pip install -e '.[test]' ``` To run the tests: ```bash pytest ``` crispy-bootstrap5-2023.10/crispy_bootstrap5/ 0000775 0000000 0000000 00000000000 14520113325 0020761 5 ustar 00root root 0000000 0000000 crispy-bootstrap5-2023.10/crispy_bootstrap5/__init__.py 0000664 0000000 0000000 00000000030 14520113325 0023063 0 ustar 00root root 0000000 0000000 __version__ = "2023.10" crispy-bootstrap5-2023.10/crispy_bootstrap5/bootstrap5.py 0000664 0000000 0000000 00000001636 14520113325 0023443 0 ustar 00root root 0000000 0000000 from crispy_forms.bootstrap import Accordion from crispy_forms.layout import Field class FloatingField(Field): template = "bootstrap5/layout/floating_field.html" class BS5Accordion(Accordion): """ Bootstrap5 Accordion menu object. It wraps `AccordionGroup` objects in a container. It also allows the usage of accordion-flush, introduced in bootstrap5:: BS5Accordion( AccordionGroup("group name", "form_field_1", "form_field_2"), AccordionGroup("another group name", "form_field"), flush=True, always_open=True ) """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.flush = kwargs.pop("flush", False) self.always_open = kwargs.pop("always_open", False) if self.always_open: for accordion_group in self.fields: accordion_group.always_open = True crispy-bootstrap5-2023.10/crispy_bootstrap5/templates/ 0000775 0000000 0000000 00000000000 14520113325 0022757 5 ustar 00root root 0000000 0000000 crispy-bootstrap5-2023.10/crispy_bootstrap5/templates/bootstrap5/ 0000775 0000000 0000000 00000000000 14520113325 0025061 5 ustar 00root root 0000000 0000000 crispy-bootstrap5-2023.10/crispy_bootstrap5/templates/bootstrap5/accordion-group.html 0000664 0000000 0000000 00000001244 14520113325 0031043 0 ustar 00root root 0000000 0000000