Fix ordering of conditional offers

Offers by default are sorted using Meta class ordering. However,
`get_offers` was doing two queries and combining them together.
Effecitvely bypass the ordering.

Test for ordering basket offers was written in the process not being
aware of standard ordering. I left it there as it can be useful test in
future (when somebody removes standard ordering).

Fixes #964
Update select2 to version 3.4.5
Create a new stacking context for the freakishly large z-index values used in upload-images

Without this, the image form is drawn over a datetimepicker that pops up so
that it overlaps the image form.
Use correct var for displaying transactions in dashboard order detail
PBD: Enforce one stock record matching users partners
Pass user into StockRecordForm

This would be necessary if one wishes to limit the partner selection
available in the product dashboard. As that might be a common
requirement, we just pass it along.
Pre-select partner if appropriate

If the user is not a staff user and has only one partner associated, we
pre-select that.
Extract setting initial data into own function

That makes it possible to override.
Merge pull request #1002 from tangentlabs/issue/1002/pbd_stockrecords

Improved stock record handling for permission-based dashboard
Merge pull request #1041 from LUKKIEN/bugfixes

Correct template variable for payment transactions in the dashboard order detail page
Add oscar-sagepay as community extension
CSS fixes for product image handling

The image file field was off 100px to the right, causing the browser to
display the wrong cursor when hovering over it.
Merge pull request #1026 from mbertheau/update-select2-to-3.4.5

Update select2 to version 3.4.5
Revert "Use {% static %} for all images"

I don't know what I was smoking, sorry. Media files should not be passed
through the {% static %} tag. And the url function of ImageFields
handles handing out the correct URL just fine.

This reverts commit 9f5301e6f50a8c129a29c69f8cc64034643228e3 and
c9576c9ca0cccb624339131c7cdb4a0b628cd576?.
Remove unnecessary missing image handling

That code did nothing.
Use thumbnails for ImageInput widget

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.
Merge pull request #1042 from tangentlabs/fix/media

Revert {% static %} tag for media files & tweaks
Merge pull request #964 from tangentlabs/issue/964/offer-priority

Respect priority of ConditionalOffers
Merge pull request #1030 from mbertheau/contain-productimages-z-index

Create a new CSS stacking context for dashboard's upload-image class
Permission fix for dynamic dashboard navigation

The code assumed that an application instance and it's views have the
same parent module. This is not necessarily true, as one can customise
either just a view or just an app.
The fix consists of always using get_class to load the application
instance.

@mberthau pointed out the issue and provided a first fix in #993 and #1034.