pax_global_header00006660000000000000000000000064145504506400014515gustar00rootroot0000000000000052 comment=ae77d38fa654a171977ab2c12a2facc1925d6fef crispy-bootstrap3-2024.1/000077500000000000000000000000001455045064000152145ustar00rootroot00000000000000crispy-bootstrap3-2024.1/.github/000077500000000000000000000000001455045064000165545ustar00rootroot00000000000000crispy-bootstrap3-2024.1/.github/workflows/000077500000000000000000000000001455045064000206115ustar00rootroot00000000000000crispy-bootstrap3-2024.1/.github/workflows/publish.yml000066400000000000000000000031311455045064000230000ustar00rootroot00000000000000name: Publish Python Package on: release: types: [created] jobs: test: runs-on: ubuntu-latest name: Python ${{ matrix.python-version }} strategy: matrix: python-version: - '3.8' - '3.9' - '3.10' - '3.11' steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Upgrade packaging tools run: python -m pip install --upgrade pip setuptools virtualenv wheel - name: Install dependencies run: python -m pip install --upgrade tox - name: Run tox targets for ${{ matrix.python-version }} run: | ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}") TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') tox - name: Run lint if: ${{ matrix.python-version == '3.9' }} run: | tox -e lint deploy: runs-on: ubuntu-latest needs: [test] steps: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.10" - 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-bootstrap3-2024.1/.github/workflows/test.yml000066400000000000000000000021531455045064000223140ustar00rootroot00000000000000name: CI on: push: branches: - main pull_request: jobs: tests: name: Python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: matrix: python-version: - '3.8' - '3.9' - '3.10' - '3.11' steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Upgrade packaging tools run: python -m pip install --upgrade pip setuptools virtualenv wheel - name: Install dependencies run: python -m pip install --upgrade tox - name: Run tox targets for ${{ matrix.python-version }} run: | ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}") TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') tox - name: Run lint if: ${{ matrix.python-version == '3.9' }} run: | tox -e lint crispy-bootstrap3-2024.1/.gitignore000066400000000000000000000001631455045064000172040ustar00rootroot00000000000000.venv __pycache__/ *.py[cod] *$py.class venv .eggs .pytest_cache *.egg-info .DS_Store .vscode *python-version .tox crispy-bootstrap3-2024.1/CHANGELOG.md000066400000000000000000000004351455045064000170270ustar00rootroot00000000000000# CHANGELOG FOR CRISPY-BOOTSTRAP3 ## 2024.1 * Updated supported versions: * Django 3.2, 4.2 and 5.0. * Python 3.8+. * Fixed form-control class issue with checkboxes. ## 2022.1 * Initial release to move the template pack from core crispy-forms to a standalone template pack. crispy-bootstrap3-2024.1/LICENSE000066400000000000000000000020601455045064000162170ustar00rootroot00000000000000Copyright (c) 2022 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-bootstrap3-2024.1/MANIFEST.in000066400000000000000000000003221455045064000167470ustar00rootroot00000000000000include LICENSE include MANIFEST.in recursive-include crispy_bootstrap3/templates * include *.md include tox.ini recursive-include requirements *.txt recursive-include tests *.html recursive-include tests *.py crispy-bootstrap3-2024.1/README.md000066400000000000000000000015411455045064000164740ustar00rootroot00000000000000# crispy-bootstrap3 [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/django-crispy-forms/crispy-bootstrap3/blob/main/LICENSE) Bootstrap3 template pack for django-crispy-forms. This template pack was included with the core django-crispy-forms package until version 2.0. ## Installation Install this plugin using `pip`: ```bash $ pip install crispy-bootstrap3 ``` ## Usage You will need to update your project's settings file to add `crispy_forms` and `crispy_bootstrap3` to your projects `INSTALLED_APPS`. Also set `bootstrap3` as and allowed template pack and as the default template pack for your project: ```python INSTALLED_APPS = ( ... "crispy_forms", "crispy_bootstrap3", ... ) CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap3" CRISPY_TEMPLATE_PACK = "bootstrap3" ``` crispy-bootstrap3-2024.1/crispy_bootstrap3/000077500000000000000000000000001455045064000207055ustar00rootroot00000000000000crispy-bootstrap3-2024.1/crispy_bootstrap3/__init__.py000066400000000000000000000000271455045064000230150ustar00rootroot00000000000000__version__ = "2024.1" crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/000077500000000000000000000000001455045064000227035ustar00rootroot00000000000000crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/000077500000000000000000000000001455045064000250035ustar00rootroot00000000000000crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/accordion-group.html000066400000000000000000000007111455045064000307630ustar00rootroot00000000000000

{{ div.name }}

{{ fields }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/accordion.html000066400000000000000000000001171455045064000276310ustar00rootroot00000000000000
{{ content }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/betterform.html000066400000000000000000000012341455045064000300420ustar00rootroot00000000000000{% for fieldset in form.fieldsets %}
{% if fieldset.legend %} {{ fieldset.legend }} {% endif %} {% if fieldset.description %}

{{ fieldset.description }}

{% endif %} {% for field in fieldset %} {% if field.is_hidden %} {{ field }} {% else %} {% include "bootstrap3/field.html" %} {% endif %} {% endfor %} {% if not forloop.last or not fieldset_open %}
{% endif %} {% endfor %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/display_form.html000066400000000000000000000004101455045064000303540ustar00rootroot00000000000000{% if form.form_html %} {% if include_media %}{{ form.media }}{% endif %} {% if form_show_errors %} {% include "bootstrap3/errors.html" %} {% endif %} {{ form.form_html }} {% else %} {% include "bootstrap3/uni_form.html" %} {% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/errors.html000066400000000000000000000004331455045064000272050ustar00rootroot00000000000000{% if form.non_field_errors %}
{% if form_error_title %}

{{ form_error_title }}

{% endif %}
{% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/errors_formset.html000066400000000000000000000004461455045064000307500ustar00rootroot00000000000000{% if formset.non_form_errors %}
{% if formset_error_title %}

{{ formset_error_title }}

{% endif %}
{% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/field.html000066400000000000000000000052401455045064000267550ustar00rootroot00000000000000{% load crispy_forms_field %} {% if field.is_hidden %} {{ field }} {% else %} {% if field|is_checkbox %}
{% if label_class %}
{% endif %} {% endif %} <{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" {% if not field|is_checkbox %}class="form-group{% else %}class="checkbox{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_show_errors%}{% if field.errors %} has-error{% endif %}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}"> {% if field.label and not field|is_checkbox and form_show_labels %} {% endif %} {% if field|is_checkboxselectmultiple %} {% include 'bootstrap3/layout/checkboxselectmultiple.html' %} {% endif %} {% if field|is_radioselect %} {% include 'bootstrap3/layout/radioselect.html' %} {% endif %} {% if not field|is_checkboxselectmultiple and not field|is_radioselect %} {% if field|is_checkbox %} {% if form_show_labels %} {% else %} {% crispy_field field %} {% endif %} {% include 'bootstrap3/layout/help_text_and_errors.html' %} {% else %}
{% if field|is_multivalue %} {% crispy_field field %} {% else %} {% crispy_field field 'class' 'form-control' %} {% endif %} {% include 'bootstrap3/layout/help_text_and_errors.html' %}
{% endif %} {% endif %} {% if field|is_checkbox %} {% if label_class %}
{% endif %}
{% endif %} {% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/inputs.html000066400000000000000000000005651455045064000272210ustar00rootroot00000000000000{% if inputs %}
{% if label_class %}
{% endif %}
{% for input in inputs %} {% include "bootstrap3/layout/baseinput.html" %} {% endfor %}
{% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/000077500000000000000000000000001455045064000263205ustar00rootroot00000000000000crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/alert.html000066400000000000000000000004001455045064000303070ustar00rootroot00000000000000 {% if dismiss %}{% endif %} {{ content }} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/attrs.html000066400000000000000000000002551455045064000303450ustar00rootroot00000000000000{% for name, value in widget.attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/baseinput.html000066400000000000000000000005171455045064000312030ustar00rootroot00000000000000 crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/button.html000066400000000000000000000000761455045064000305240ustar00rootroot00000000000000 crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/buttonholder.html000066400000000000000000000003171455045064000317200ustar00rootroot00000000000000
{{ fields_output }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/checkboxselectmultiple.html000066400000000000000000000015771455045064000337620ustar00rootroot00000000000000{% load crispy_forms_filters %} {% load l10n %}
{% include 'bootstrap3/layout/field_errors_block.html' %} {% for group, options, index in field|optgroups %} {% if group %}{{ group }}{% endif %} {% for option in options %} {% if not inline_class %}
{% endif %} {% if not inline_class %}
{% endif %} {% endfor %} {% endfor %} {% include 'bootstrap3/layout/help_text.html' %}
checkboxselectmultiple_inline.html000066400000000000000000000012121455045064000352230ustar00rootroot00000000000000crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout{% if field.is_hidden %} {{ field }} {% else %}
{% if field.label %} {% endif %} {% include 'bootstrap3/layout/checkboxselectmultiple.html' %}
{% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/column.html000066400000000000000000000002351455045064000305030ustar00rootroot00000000000000
{{ fields }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/div.html000066400000000000000000000002551455045064000277720ustar00rootroot00000000000000
{{ fields }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/field_errors.html000066400000000000000000000003461455045064000316700ustar00rootroot00000000000000{% if form_show_errors and field.errors %} {% for error in field.errors %} {{ error }} {% endfor %} {% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/field_errors_block.html000066400000000000000000000003401455045064000330340ustar00rootroot00000000000000{% if form_show_errors and field.errors %} {% for error in field.errors %}

{{ error }}

{% endfor %} {% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/field_with_buttons.html000066400000000000000000000017411455045064000331050ustar00rootroot00000000000000{% load crispy_forms_field %} {% if field.label and form_show_labels %} {% endif %}
{% crispy_field field %} {{ buttons }}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/fieldset.html000066400000000000000000000004151455045064000310050ustar00rootroot00000000000000
{% if legend %}{{ legend }}{% endif %} {{ fields }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/formactions.html000066400000000000000000000005701455045064000315340ustar00rootroot00000000000000 {% if label_class %}
{% endif %}
{{ fields_output }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/help_text.html000066400000000000000000000004421455045064000312020ustar00rootroot00000000000000{% if field.help_text %} {% if help_text_inline %} {{ field.help_text|safe }} {% else %}
{{ field.help_text|safe }}
{% endif %} {% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/help_text_and_errors.html000066400000000000000000000005761455045064000334300ustar00rootroot00000000000000{% if help_text_inline and not error_text_inline %} {% include 'bootstrap3/layout/help_text.html' %} {% endif %} {% if error_text_inline %} {% include 'bootstrap3/layout/field_errors.html' %} {% else %} {% include 'bootstrap3/layout/field_errors_block.html' %} {% endif %} {% if not help_text_inline %} {% include 'bootstrap3/layout/help_text.html' %} {% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/inline_field.html000066400000000000000000000015631455045064000316340ustar00rootroot00000000000000{% load crispy_forms_field %} {% if field.is_hidden %} {{ field }} {% else %} {% if field|is_checkbox %}
{% else %}
{% crispy_field field 'placeholder' field.label %}
{% endif %} {% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/modal.html000066400000000000000000000012421455045064000303010ustar00rootroot00000000000000 crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/multifield.html000066400000000000000000000015331455045064000313460ustar00rootroot00000000000000
{% if form_show_errors %} {% endif %} {% if multifield.label_html %}

{{ multifield.label_html }}

{% endif %}
{{ fields_output }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/prepended_appended_text.html000066400000000000000000000025111455045064000340570ustar00rootroot00000000000000{% load crispy_forms_field %} {% if field.is_hidden %} {{ field }} {% else %}
{% if field.label and form_show_labels %} {% endif %}
{% if crispy_prepended_text %}{{ crispy_prepended_text }}{% endif %} {% crispy_field field 'class' 'form-control' %} {% if crispy_appended_text %}{{ crispy_appended_text }}{% endif %}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
{% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/radioselect.html000066400000000000000000000015651455045064000315130ustar00rootroot00000000000000{% load crispy_forms_filters %} {% load l10n %}
{% include 'bootstrap3/layout/field_errors_block.html' %} {% for group, options, index in field|optgroups %} {% if group %}{{ group }}{% endif %} {% for option in options %} {% if not inline_class %}
{% endif %} {% if not inline_class %}
{% endif %} {% endfor %} {% endfor %} {% include 'bootstrap3/layout/help_text.html' %}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/radioselect_inline.html000066400000000000000000000012641455045064000330450ustar00rootroot00000000000000{% if field.is_hidden %} {{ field }} {% else %}
{% if field.label %} {% endif %} {% include 'bootstrap3/layout/radioselect.html' %}
{% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/row.html000066400000000000000000000002261455045064000300150ustar00rootroot00000000000000
{{ fields }}
crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/tab-link.html000066400000000000000000000002721455045064000307100ustar00rootroot00000000000000
  • {{ link.name|capfirst }}{% if tab.errors %}!{% endif %}
  • crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/tab.html000066400000000000000000000002441455045064000277540ustar00rootroot00000000000000 {{ links }}
    {{ content }}
    crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/layout/uneditable_input.html000066400000000000000000000011141455045064000325360ustar00rootroot00000000000000{% load crispy_forms_field %}
    {% crispy_field field 'disabled' 'disabled' %} {% include 'bootstrap3/layout/help_text.html' %}
    crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/multifield.html000066400000000000000000000025251455045064000300330ustar00rootroot00000000000000{% load crispy_forms_field %} {% if field.is_hidden %} {{ field }} {% else %} {% if field|is_checkbox %} {% if field.errors %}
    {% endif %}
    {% if field.label %} {% endif %} {% if field.help_text %} {{ field.help_text|safe }} {% endif %}
    {% if field.errors %}
    {% endif %} {% else %}
    {% if field.label %} {% endif %} {% crispy_field field %} {% if field.help_text %} {{ field.help_text|safe }} {% endif %}
    {% endif %} {% endif %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/table_inline_formset.html000066400000000000000000000040471455045064000320620ustar00rootroot00000000000000{% load crispy_forms_tags %} {% load crispy_forms_utils %} {% load crispy_forms_field %} {% specialspaceless %} {% if formset_tag %}
    {% endif %} {% if formset_method|lower == 'post' and not disable_csrf %} {% csrf_token %} {% endif %}
    {{ formset.management_form|crispy }}
    {% if formset.readonly and not formset.queryset.exists %} {% else %} {% for field in formset.forms.0 %} {% if field.label and not field.is_hidden %} {{ field.label }}{% if field.field.required and not field|is_checkbox %}*{% endif %} {% endif %} {% endfor %} {% endif %} {% for field in formset.empty_form %} {% include 'bootstrap3/field.html' with tag="td" form_show_labels=False %} {% endfor %} {% for form in formset %} {% if form_show_errors and not form.is_extra %} {% include "bootstrap3/errors.html" %} {% endif %} {% for field in form %} {% include 'bootstrap3/field.html' with tag="td" form_show_labels=False %} {% endfor %} {% endfor %} {% include "bootstrap3/inputs.html" %} {% if formset_tag %}{% endif %} {% endspecialspaceless %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/uni_form.html000066400000000000000000000004651455045064000275140ustar00rootroot00000000000000{% load crispy_forms_utils %} {% specialspaceless %} {% if include_media %}{{ form.media }}{% endif %} {% if form_show_errors %} {% include "bootstrap3/errors.html" %} {% endif %} {% for field in form %} {% include field_template %} {% endfor %} {% endspecialspaceless %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/uni_formset.html000066400000000000000000000003461455045064000302260ustar00rootroot00000000000000{% with formset.management_form as form %} {% include 'bootstrap3/uni_form.html' %} {% endwith %} {% for form in formset %}
    {% include 'bootstrap3/uni_form.html' %}
    {% endfor %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/whole_uni_form.html000066400000000000000000000007151455045064000307100ustar00rootroot00000000000000{% load crispy_forms_utils %} {% specialspaceless %} {% if form_tag %}
    {% endif %} {% if form_method|lower == 'post' and not disable_csrf %} {% csrf_token %} {% endif %} {% include "bootstrap3/display_form.html" %} {% include "bootstrap3/inputs.html" %} {% if form_tag %}
    {% endif %} {% endspecialspaceless %} crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/whole_uni_formset.html000066400000000000000000000015141455045064000314220ustar00rootroot00000000000000{% load crispy_forms_tags %} {% load crispy_forms_utils %} {% specialspaceless %} {% if formset_tag %}
    {% endif %} {% if formset_method|lower == 'post' and not disable_csrf %} {% csrf_token %} {% endif %}
    {{ formset.management_form|crispy }}
    {% include "bootstrap3/errors_formset.html" %} {% for form in formset %} {% include "bootstrap3/display_form.html" %} {% endfor %} {% if inputs %}
    {% for input in inputs %} {% include "bootstrap3/layout/baseinput.html" %} {% endfor %}
    {% endif %} {% if formset_tag %}
    {% endif %} {% endspecialspaceless %} crispy-bootstrap3-2024.1/pyproject.toml000066400000000000000000000030261455045064000201310ustar00rootroot00000000000000[build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] name = "crispy-bootstrap3" description = "Bootstrap3 template pack for django-crispy-forms" authors = [ { name = "David Smith" } ] license = {text = "MIT"} requires-python = ">=3.7" readme = "README.md" dependencies = [ "django-crispy-forms>=1.14.0", "django>=3.2", ] classifiers=[ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 3.2", "Framework :: Django :: 4.0", "Framework :: Django :: 4.1", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules", ] dynamic = ['version'] [project.urls] "Homepage" = "https://github.com/django-crispy-forms/crispy-bootstrap3" "Issues" = "https://github.com/django-crispy-forms/crispy-bootstrap3/issues" "CI" = "https://github.com/django-crispy-forms/crispy-bootstrap3/actions" "Changelog" = "https://github.com/django-crispy-forms/crispy-bootstrap3/releases" [tool.setuptools.dynamic] version = {attr = "crispy_bootstrap3.__version__"} [tool.isort] profile = "black" [tool.pytest.ini_options] DJANGO_SETTINGS_MODULE = "tests.test_settings" crispy-bootstrap3-2024.1/requirements/000077500000000000000000000000001455045064000177375ustar00rootroot00000000000000crispy-bootstrap3-2024.1/requirements/lint.txt000066400000000000000000000000231455045064000214410ustar00rootroot00000000000000black flake8 isort crispy-bootstrap3-2024.1/requirements/testing.txt000066400000000000000000000000511455045064000221510ustar00rootroot00000000000000coverage pytest pytest-cov pytest-django crispy-bootstrap3-2024.1/tests/000077500000000000000000000000001455045064000163565ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/__init__.py000066400000000000000000000000001455045064000204550ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/conftest.py000066400000000000000000000007221455045064000205560ustar00rootroot00000000000000import pytest from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, Submit @pytest.fixture def advanced_layout(): return Layout( Div( Div(Div("email")), Div(Field("password1")), Submit("save", "save"), Fieldset( "legend", "first_name", HTML("extra text"), ), Layout("password2"), ), "last_name", ) crispy-bootstrap3-2024.1/tests/forms.py000066400000000000000000000170331455045064000200620ustar00rootroot00000000000000from crispy_forms.helper import FormHelper from django import forms from django.db import models class SampleForm(forms.Form): is_company = forms.CharField( label="company", required=False, widget=forms.CheckboxInput() ) email = forms.EmailField( label="email", max_length=30, required=True, widget=forms.TextInput(), help_text="Insert your email", ) password1 = forms.CharField( label="password", max_length=30, required=True, widget=forms.PasswordInput() ) password2 = forms.CharField( label="re-enter password", max_length=30, required=True, widget=forms.PasswordInput(), ) first_name = forms.CharField( label="first name", max_length=5, required=True, widget=forms.TextInput() ) last_name = forms.CharField( label="last name", max_length=5, required=True, widget=forms.TextInput() ) datetime_field = forms.SplitDateTimeField( label="date time", widget=forms.SplitDateTimeWidget() ) def clean(self): super().clean() password1 = self.cleaned_data.get("password1", None) password2 = self.cleaned_data.get("password2", None) if not password1 and not password2 or password1 != password2: raise forms.ValidationError("Passwords dont match") return self.cleaned_data class SampleForm2(SampleForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper(self) class CheckboxesSampleForm(forms.Form): checkboxes = forms.MultipleChoiceField( choices=((1, "Option one"), (2, "Option two"), (3, "Option three")), initial=(1,), widget=forms.CheckboxSelectMultiple, ) alphacheckboxes = forms.MultipleChoiceField( choices=( ("option_one", "Option one"), ("option_two", "Option two"), ("option_three", "Option three"), ), initial=("option_two", "option_three"), widget=forms.CheckboxSelectMultiple, ) numeric_multiple_checkboxes = forms.MultipleChoiceField( choices=((1, "Option one"), (2, "Option two"), (3, "Option three")), initial=(1, 2), widget=forms.CheckboxSelectMultiple, ) inline_radios = forms.ChoiceField( choices=( ("option_one", "Option one"), ("option_two", "Option two"), ), widget=forms.RadioSelect, initial="option_two", ) class SimpleCheckboxSampleForm(forms.Form): is_company = forms.CharField( label="company", required=False, widget=forms.CheckboxInput() ) class SelectSampleForm(forms.Form): select = forms.ChoiceField( choices=((1, "Option one"), (2, "Option two"), (3, "Option three")), initial=(1,), widget=forms.Select, ) class CrispyTestModel(models.Model): email = models.CharField(max_length=20) password = models.CharField(max_length=20) class SampleForm3(forms.ModelForm): class Meta: model = CrispyTestModel fields = ["email", "password"] exclude = ["password"] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper(self) class SampleForm4(forms.ModelForm): class Meta: """ before Django1.6, one cannot use __all__ shortcut for fields without getting the following error: django.core.exceptions.FieldError: Unknown field(s) (a, l, _) specified for CrispyTestModel because obviously it casts the string to a set """ model = CrispyTestModel fields = "__all__" # eliminate RemovedInDjango18Warning class SampleForm5(forms.Form): choices = [ (1, 1), (2, 2), (1000, 1000), ] checkbox_select_multiple = forms.MultipleChoiceField( widget=forms.CheckboxSelectMultiple, choices=choices ) radio_select = forms.ChoiceField(widget=forms.RadioSelect, choices=choices) pk = forms.IntegerField() class SampleFormWithMedia(forms.Form): class Media: css = {"all": ("test.css",)} js = ("test.js",) class SampleFormWithMultiValueField(forms.Form): multi = forms.SplitDateTimeField() class CrispyEmptyChoiceTestModel(models.Model): fruit = models.CharField( choices=[("apple", "Apple"), ("pear", "Pear")], null=True, blank=True, max_length=20, ) class SampleForm6(forms.ModelForm): class Meta: """ When allowing null=True in a model field, the corresponding field will have a choice for the empty value. When the form is initialized by an instance with initial value None, this choice should be selected. """ model = CrispyEmptyChoiceTestModel fields = ["fruit"] widgets = {"fruit": forms.RadioSelect()} class SampleForm7(forms.ModelForm): is_company = forms.CharField( label="company", required=False, widget=forms.CheckboxInput() ) password2 = forms.CharField( label="re-enter password", max_length=30, required=True, widget=forms.PasswordInput(), ) class Meta: model = CrispyTestModel fields = ("email", "password", "password2") class SampleForm8(forms.ModelForm): is_company = forms.CharField( label="company", required=False, widget=forms.CheckboxInput() ) password2 = forms.CharField( label="re-enter password", max_length=30, required=True, widget=forms.PasswordInput(), ) class Meta: model = CrispyTestModel fields = ("email", "password2", "password") class FakeFieldFile: """ Quacks like a FieldFile (has a .url and string representation), but doesn't require us to care about storages etc. """ url = "something" def __str__(self): return self.url class FileForm(forms.Form): file_field = forms.FileField(widget=forms.FileInput) clearable_file = forms.FileField( widget=forms.ClearableFileInput, required=False, initial=FakeFieldFile() ) class AdvancedFileForm(forms.Form): file_field = forms.FileField( widget=forms.FileInput(attrs={"class": "my-custom-class"}) ) clearable_file = forms.FileField( widget=forms.ClearableFileInput(attrs={"class": "my-custom-class"}), required=False, initial=FakeFieldFile(), ) class GroupedChoiceForm(forms.Form): choices = [ ( "Audio", [ ("vinyl", "Vinyl"), ("cd", "CD"), ], ), ( "Video", [ ("vhs", "VHS Tape"), ("dvd", "DVD"), ], ), ("unknown", "Unknown"), ] checkbox_select_multiple = forms.MultipleChoiceField( widget=forms.CheckboxSelectMultiple, choices=choices ) radio = forms.MultipleChoiceField(widget=forms.RadioSelect, choices=choices) class CustomRadioSelect(forms.RadioSelect): pass class CustomCheckboxSelectMultiple(forms.CheckboxSelectMultiple): pass class SampleFormCustomWidgets(forms.Form): inline_radios = forms.ChoiceField( choices=( ("option_one", "Option one"), ("option_two", "Option two"), ), widget=CustomRadioSelect, initial="option_two", ) checkboxes = forms.MultipleChoiceField( choices=((1, "Option one"), (2, "Option two"), (3, "Option three")), initial=(1,), widget=CustomCheckboxSelectMultiple, ) crispy-bootstrap3-2024.1/tests/results/000077500000000000000000000000001455045064000200575ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/000077500000000000000000000000001455045064000221575ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/000077500000000000000000000000001455045064000255205ustar00rootroot00000000000000bootstrap_form_show_errors_bs3_false.html000066400000000000000000000050071455045064000357460ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    whatever
    Insert your email
    blabla
    foo bar
    whatever
    blabla
    bootstrap_form_show_errors_bs3_false_gte50.html000066400000000000000000000053261455045064000367560ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    whatever
    Insert your email
    blabla
    foo bar
    whatever
    blabla
    bootstrap_form_show_errors_bs3_true.html000066400000000000000000000056651455045064000356450ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    whatever
    Enter a valid email address.
    Insert your email
    blabla
    Ensure this value has at most 5 characters (it has 19).
    foo bar
    Ensure this value has at most 5 characters (it has 18).
    whatever
    blabla
    bootstrap_form_show_errors_bs3_true_gte50.html000066400000000000000000000062111455045064000366350ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    whatever
    Enter a valid email address.
    Insert your email
    blabla
    Ensure this value has at most 5 characters (it has 19).
    foo bar
    Ensure this value has at most 5 characters (it has 18).
    whatever
    blabla
    test_form_show_errors_non_field_errors_false.html000066400000000000000000000051721455045064000375550ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    Insert your email
    test_form_show_errors_non_field_errors_false_gte50.html000066400000000000000000000054231455045064000405600ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    Insert your email
    test_form_show_errors_non_field_errors_false_lte40.html000066400000000000000000000052241455045064000405630ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    Insert your email
    test_form_show_errors_non_field_errors_true.html000066400000000000000000000063621455045064000374440ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    • Passwords dont match
    This field is required.
    Insert your email
    This field is required.
    This field is required.
    This field is required.
    test_form_show_errors_non_field_errors_true_gte50.html000066400000000000000000000066131455045064000404470ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    • Passwords dont match
    This field is required.
    Insert your email
    This field is required.
    This field is required.
    This field is required.
    test_form_show_errors_non_field_errors_true_lte40.html000066400000000000000000000064131455045064000404510ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper
    • Passwords dont match
    This field is required.
    Insert your email
    This field is required.
    This field is required.
    This field is required.
    crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/000077500000000000000000000000001455045064000245335ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_layout_composition.html000066400000000000000000000043121455045064000324200ustar00rootroot00000000000000

    Some company data

    Insert your email
    crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html000066400000000000000000000044061455045064000334300ustar00rootroot00000000000000

    Some company data

    Insert your email
    crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_multiple_checkboxes.html000066400000000000000000000057371455045064000325250ustar00rootroot00000000000000
    crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_multiple_fields.html000066400000000000000000000015611455045064000316440ustar00rootroot00000000000000
    crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_radio.html000066400000000000000000000020141455045064000275530ustar00rootroot00000000000000
    crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_radio_attrs.html000066400000000000000000000013071455045064000307740ustar00rootroot00000000000000
    test_second_layout_multifield_column_buttonholder_submit_div.html000066400000000000000000000054651455045064000420740ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout

    Some company data

    Insert your email
    test_second_layout_multifield_column_buttonholder_submit_div_gte50.html000066400000000000000000000055611455045064000430750ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout

    Some company data

    Insert your email
    crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout_objects/000077500000000000000000000000001455045064000262445ustar00rootroot00000000000000crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout_objects/bootstrap_modal_no_kwargs.html000066400000000000000000000023201455045064000343720ustar00rootroot00000000000000