diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c6e78c0..c92b88c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -6,6 +6,9 @@ on: - main pull_request: +permissions: + contents: read + jobs: tests: name: Python ${{ matrix.python-version }} @@ -51,3 +54,43 @@ jobs: flags: unittests name: codecov-umbrella fail_ci_if_error: false + + + deploy: + name: Deploy + needs: [tests] + runs-on: ubuntu-latest + if: github.ref=='refs/heads/main' && github.event_name!='pull_request' + + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Check release + id: check_release + run: | + python -m pip install autopub + python -m pip install https://github.com/j0057/github-release/archive/master.zip + autopub check + + - name: Publish + if: ${{ steps.check_release.outputs.autopub_release=='true' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + autopub prepare + autopub commit + autopub build + autopub githubrelease + + - name: Upload package to PyPI + if: ${{ steps.check_release.outputs.autopub_release=='true' }} + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 08fd69d..8ff32a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ -# CHANGELOG for crispy-tailwind +CHANGELOG +========= -## Next Release (tbc) +1.0.0 - 2024-01-09 +------------------ -## 1.0 (2024-01-09) * Added support for Django 5.0 (#142) * Added support for Python 3.11 and 3.12 (#142) * Added support for Python 3.10 (#116) @@ -15,7 +16,9 @@ * Added docs about Tailwind CLI template discovery management command (#144) * Fixed bug with select template and disabled property (#118) -## 0.5 (2021-04-21) +0.5.0 - 2021-04-21 +------------------ + * Added support for custom widgets (#92) * Confirmed support for Django 3.2 (#91) * Dropped support for Django 3.1 (#91) @@ -23,14 +26,18 @@ See [Release Notes](https://github.com/django-crispy-forms/crispy-tailwind/milestone/5?closed=1) for full change log. -## 0.4 (2021-03-22) +0.4.0 - 2021-03-22 +------------------ + * Fixed compatibility with django-crispy-forms 1.11.2 (#86) * Fixed field names when using formsets (#84) See [Release Notes](https://github.com/django-crispy-forms/crispy-tailwind/milestone/4?closed=1) for full change log. -## 0.3 (2021-02-14) +0.3.0 - 2021-02-14 +------------------ + * Fixed non form errors (#77) * Various documentation improvements * Python 3.9 (#60) and Django 3.1 (#56) support @@ -38,7 +45,8 @@ for full change log. See [Release Notes](https://github.com/django-crispy-forms/crispy-tailwind/milestone/3?closed=1) for full change log. -## 0.2 (2020-07-11) +0.2.0 - 2020-07-11 +------------------ * Support for Formsets * Prepended and Appended inputs @@ -50,7 +58,8 @@ for full change log. See [Release Notes](https://github.com/django-crispy-forms/crispy-tailwind/milestone/2?closed=1) for full change log. -## 0.1 (2020-06-09) +0.1.0 - 2020-06-09 +------------------ * First Release, please do come and test! * Opinionated forms can be rendered with crispy filter diff --git a/crispy_tailwind/templates/tailwind/layout/attrs.html b/crispy_tailwind/templates/tailwind/layout/attrs.html new file mode 100644 index 0000000..c52de9e --- /dev/null +++ b/crispy_tailwind/templates/tailwind/layout/attrs.html @@ -0,0 +1 @@ +{% for name, value in widget.attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %} diff --git a/crispy_tailwind/templates/tailwind/layout/select.html b/crispy_tailwind/templates/tailwind/layout/select.html index 6feb33e..fedda40 100644 --- a/crispy_tailwind/templates/tailwind/layout/select.html +++ b/crispy_tailwind/templates/tailwind/layout/select.html @@ -1,15 +1,21 @@ {% load crispy_forms_filters %} +{% load tailwind_filters %} {% load l10n %}