This also selects the inputs that should have the date picker in a more
reliable fasion. The custom widget adds a data-oscarWidget attribute that
is used to select the elements to apply the widget to.
with https://github.com/smalot/bootstrap-datetimepicker
revision a68df42162
In all our tests the time sliders under the calendar were always ignored.
Also this datetimepicker looks bootstrap and thus fits visually much more
into the rest of the dashboard.
This fixes two issues:
1) The code didn't take into account that self.format will be ignored by
Django if USE_L10N=True, unless a format was specified when constructing
the Widget. Remedied by moving the code to render because the current
language is determined at request time, not at object construction time,
and looking up the correct format there.
2) The code couldn't handle date formats that include dots, like
31.12.2014.
Fixes #1440.
We only needed it because Django 1.4 shipped with a pretty old version
of six. Support for that has been removed, and Django 1.5 ships with six
1.6.1, which is more current than we required.
This nicely avoids an issue with django-extra-views pinning a six
version which caused the sandbox build to fail:
https://travis-ci.org/tangentlabs/django-oscar/jobs/32223978#L971
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.
Django 1.6 renders URLInput as <input type=url>, which causes some
browsers to require the input to be a valid absolute URL. As relative
URLS are allowed for ExtendedURLField, we must set it to TextInput.
Fixes #1092
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.