diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..598bb76610 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,16 @@ +name: Build and publish python package + +on: + release: + types: [published] + +jobs: + publish-service-client-package: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v1.17 + with: + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/ajax_select/__init__.py b/ajax_select/__init__.py index 6ff72652e1..9b43c457f5 100644 --- a/ajax_select/__init__.py +++ b/ajax_select/__init__.py @@ -1,5 +1,5 @@ """JQuery-Ajax Autocomplete fields for Django Forms.""" -__version__ = "1.7.0" +__version__ = "2.2.0" __author__ = "crucialfelix" __contact__ = "crucialfelix@gmail.com" __homepage__ = "https://github.com/crucialfelix/django-ajax-selects/" @@ -8,14 +8,9 @@ from ajax_select.helpers import make_ajax_form, make_ajax_field # noqa from ajax_select.lookup_channel import LookupChannel # noqa -# django 1.7+ will use the new AppConfig api # It will load all your lookups.py modules # and any specified in settings.AJAX_LOOKUP_CHANNELS # It will do this after all apps are imported. from django.apps import AppConfig # noqa -# Django 3.2+ does not need default_app_config set. -# Remove this once django <3.2 support is removed -import django -if django.VERSION < (3, 2): - default_app_config = 'ajax_select.apps.AjaxSelectConfig' +default_app_config = "ajax_select.apps.AjaxSelectConfig" diff --git a/ajax_select/static/ajax_select/css/ajax_select.css b/ajax_select/static/ajax_select/css/ajax_select.css index ee23d4b006..f57d81fb6b 100644 --- a/ajax_select/static/ajax_select/css/ajax_select.css +++ b/ajax_select/static/ajax_select/css/ajax_select.css @@ -1,5 +1,4 @@ .results_on_deck .ui-icon-trash { - float: left; cursor: pointer; } @@ -20,19 +19,19 @@ html[data-theme="dark"] { .results_on_deck { padding: 0.25em 0; } -.results_on_deck > div { +.results_on_deck .item_on_deck { display: grid; grid-template-columns: auto 1fr; align-items: center; } +.results_on_deck .item_on_deck > div { + margin: 0.5em 0; +} form .aligned .results_on_deck { padding-left: 14px; margin-left: 160px; } -.results_on_deck > div { - margin: 0.5em 0; -} .ui-autocomplete-loading { background: url("../images/loading-indicator.gif") no-repeat; background-origin: content-box; diff --git a/ajax_select/static/ajax_select/js/ajax_select.js b/ajax_select/static/ajax_select/js/ajax_select.js index 4750ff68d6..1be7cd09eb 100644 --- a/ajax_select/static/ajax_select/js/ajax_select.js +++ b/ajax_select/static/ajax_select/js/ajax_select.js @@ -8,34 +8,33 @@ function receiveResult(event, ui) { if ($this.val()) { - kill(); + removeItem(); } $this.val(ui.item.pk); $text.val(""); - addKiller(ui.item.repr, ui.item.pk); + addItemOnDeck(ui.item.repr, ui.item.pk); $deck.trigger("added", [ui.item.pk, ui.item]); $this.trigger("change"); return false; } - function addKiller(repr, pk) { - var killId = "kill_" + pk + id, - killButton = - '
'; + function addItemOnDeck(repr, pk) { + var trashId = "trash_" + pk + id, + killButton = ` `; if (repr) { $deck.empty(); - $deck.append("