Skip to content

Commit

Permalink
Merge pull request #287 from uploadcare/feature/update_blocks_to_v0.32.x
Browse files Browse the repository at this point in the history
Update Blocks to v0.33.2
  • Loading branch information
evgkirov committed Mar 2, 2024
2 parents 45d1713 + 77b403a commit a73c47a
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 21 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.0.1](https://github.com/uploadcare/pyuploadcare/compare/v5.0.0...v5.0.1) - unreleased

### Changed

- [Blocks](https://github.com/uploadcare/blocks) have been updated to [v0.33.2](https://github.com/uploadcare/blocks/releases)

### Fixed

- The SSL context is now cached by default, resulting in significant performance improvements when initializing the `Uploadcare` class frequently. [#279](https://github.com/uploadcare/pyuploadcare/issues/279)
Expand Down
2 changes: 1 addition & 1 deletion docs/django-widget.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Below is the full default configuration:
"use_legacy_widget": False,
"use_hosted_assets": True,
"widget": {
"version": "0.30.7",
"version": "0.33.2",
"variant": "regular",
"build": "min",
"options": {},
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyuploadcare"
version = "5.0.0"
version = "5.0.1"
description = "Python library for Uploadcare.com"
authors = ["Uploadcare Inc <hello@uploadcare.com>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion pyuploadcare/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# isort: skip_file
__version__ = "5.0.0"
__version__ = "5.0.1"

from pyuploadcare.resources.file import File # noqa: F401
from pyuploadcare.resources.file_group import FileGroup # noqa: F401
Expand Down
2 changes: 1 addition & 1 deletion pyuploadcare/dj/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class SettingsType(typing_extensions.TypedDict):
"use_legacy_widget": False,
"use_hosted_assets": True,
"widget": {
"version": "0.30.7",
"version": "0.33.2",
"variant": "regular",
"build": "min",
"options": {},
Expand Down
7 changes: 5 additions & 2 deletions pyuploadcare/dj/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ def widget_attrs(self, widget):
attrs: Dict[str, Any] = {}
if self.legacy_widget:
attrs["data-multiple"] = ""
if not self.required:
attrs["data-clearable"] = ""
else:
attrs["multiple"] = True
if not self.required:
attrs["data-clearable"] = ""
attrs["group-output"] = True
if self.required:
attrs["multiple-min"] = 1
return attrs


Expand Down
5 changes: 3 additions & 2 deletions pyuploadcare/dj/static/uploadcare/blocks.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions pyuploadcare/dj/templates/uploadcare/forms/widgets/file.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
pubkey="{{ pub_key }}"
{% for k, v in options.items %}
{{ k|escape }}="{{ v|escape }}"{% endfor %}
>
</lr-config>
></lr-config>

<lr-upload-ctx-provider
id="uploaderctx_{{ name }}"
Expand All @@ -38,15 +37,12 @@
<lr-file-uploader-{{ variant }}
css-src="{{ uploadcare_css }}"
ctx-name="{{ name }}"
></lr-file-uploader-{{ variant }}>
>
<lr-form-input
ctx-name="{{ name }}"
></lr-form-input>
</lr-file-uploader-{{ variant }}>

<lr-data-output
ctx-name="{{ name }}"
style="position: absolute;"
use-input
{% if options.multiple == "true" %}use-group{% endif %}
{% if is_required %}input-required{% endif %}
></lr-data-output>

</div>

0 comments on commit a73c47a

Please sign in to comment.