miracle2k / django-assets

Django webassets integration.
BSD 2-Clause "Simplified" License
89 stars 79 forks source link

Fix resolve_source_to_url when using wildcards as part of a bundle item name. #8

Open jorgebastida opened 11 years ago

jorgebastida commented 11 years ago

As part of some js bundles we was using wildcards to add several js files

js_app = Bundle('js/base.js', 'js/app/*.js', 'js/utils/*.js', filters=['jsmin'], output='js/app.js')

With assets_debug = True when looping over the js_app bundle items like:

{% assets "styles" %}
   {{ ASSET_URL }}
{% endassets %}

All these urls were wrong because the filenames weren't resolved and instead js/app/*.js was printed as many times as files we have inside js/app.

This patch tries to fix this issue extracting from the filepath the right part of the path and then join it with the root url.