Use proper static media URL generation
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.html import strip_tags
|
||||
from django.utils.http import urlencode
|
||||
@@ -118,7 +119,7 @@ def document_html_widget(document, click_view=None, click_view_arguments=None, p
|
||||
if nolazyload:
|
||||
result.append('<img class="img-nolazyload" src="%s" alt="%s" />' % (preview_view, alt_text))
|
||||
else:
|
||||
result.append('<img class="thin_border %s" data-src="%s" data-post-load-class="%s" src="%smain/icons/hourglass.png" alt="%s" />' % (image_class, preview_view, post_load_class, settings.STATIC_URL, alt_text))
|
||||
result.append('<img class="thin_border %s" data-src="%s" data-post-load-class="%s" src="%s" alt="%s" />' % (image_class, preview_view, post_load_class, static('main/icons/hourglass.png'), alt_text))
|
||||
|
||||
if click_view:
|
||||
result.append('</a>')
|
||||
|
||||
@@ -16,7 +16,6 @@ def search_form(context):
|
||||
context.update({
|
||||
'form': SearchForm(initial={'q': context.get('query_string', {}).get('q'), 'source': 'sidebar'}),
|
||||
'request': context['request'],
|
||||
'STATIC_URL': context['STATIC_URL'],
|
||||
'form_action': reverse('search'),
|
||||
'form_title': _('Search'),
|
||||
'submit_label': _('Search'),
|
||||
@@ -34,7 +33,6 @@ def recent_searches_template(context):
|
||||
|
||||
context.update({
|
||||
'request': context['request'],
|
||||
'STATIC_URL': context['STATIC_URL'],
|
||||
'side_bar': True,
|
||||
'title': _('Recent searches (maximum of %d)') % RECENT_COUNT,
|
||||
'paragraphs': [
|
||||
|
||||
@@ -3,11 +3,11 @@ from __future__ import absolute_import, unicode_literals
|
||||
import urlparse
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.template import RequestContext, Variable
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.contrib.staticfiles.storage import staticfiles_storage
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from permissions.models import Permission
|
||||
@@ -48,7 +48,7 @@ def render_widget(request, link):
|
||||
</p>\
|
||||
</a>' % {
|
||||
'url': reverse(link['view']) if 'view' in link else link['url'],
|
||||
'static_url': staticfiles_storage.url('main/icons/{0}'.format(link.get('icon', 'link_button.png'))),
|
||||
'static_url': static('main/icons/{0}'.format(link.get('icon', 'link_button.png'))),
|
||||
'string': link['text'],
|
||||
'image_alt': _('Icon'),
|
||||
})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.html import strip_tags
|
||||
from django.utils.http import urlencode
|
||||
@@ -56,7 +57,7 @@ def staging_file_html_widget(staging_file, click_view=None, page=DEFAULT_PAGE_NU
|
||||
if nolazyload:
|
||||
result.append('<img style="border: 1px solid black;" src="%s" alt="%s" />' % (preview_view, alt_text))
|
||||
else:
|
||||
result.append('<img class="thin_border %s" data-src="%s" src="%smain/icons/hourglass.png" alt="%s" />' % (image_class, preview_view, settings.STATIC_URL, alt_text))
|
||||
result.append('<img class="thin_border %s" data-src="%s" src="%s" alt="%s" />' % (image_class, preview_view, static('main/icons/hourglass.png'), alt_text))
|
||||
|
||||
if click_view:
|
||||
result.append('</a>')
|
||||
|
||||
Reference in New Issue
Block a user