Refactor out a reusable widget for AJAX selects from ProductSelect
ProductSelect is a handy widget that can easily be re-purposed for other
AJAX lookups. This only required offering a general purpose way to pass
the lookup URL for the AJAX calls.
Should have no implications for backwards compatibility.
Fix ImageInput instead of re-binding image formset
@mbertheau raised a good point that rebinding the image formsets as
added in 0b373df hides any errors in the image formset.
0b373df5ab (commitcomment-5368878)
This fix undoes that change and instead alters behaviour of the
ImageInput widget to not display images that were never persisted to
disk.
Use a custom widget to show unavailable variants in dropdown
We define a custom select widget which allows certain choices to be
marked as disabled. We use this to include unavailable variants in the
add-to-basket dropdown.
The entire image handling in the dashboard isn't very pretty. But at
least we're not using full-size images for this.
We also can't assume that just prepending MEDIA_URL is the correct URL
for every image (e.g. not when using S3 backends). Passing it through
Sorl gets us the correct URL for free.