PEP8 cleanups, specially E501 line too long.
This commit is contained in:
@@ -14,7 +14,9 @@ from documents.settings import setting_preview_size, setting_thumbnail_size
|
||||
|
||||
|
||||
def staging_file_thumbnail(staging_file, **kwargs):
|
||||
return staging_file_html_widget(staging_file, click_view='stagingfolderfile-image-view', **kwargs)
|
||||
return staging_file_html_widget(
|
||||
staging_file, click_view='stagingfolderfile-image-view', **kwargs
|
||||
)
|
||||
|
||||
|
||||
def staging_file_html_widget(staging_file, click_view=None, page=DEFAULT_PAGE_NUMBER, zoom=DEFAULT_ZOOM_LEVEL, rotation=DEFAULT_ROTATION, gallery_name=None, fancybox_class='fancybox-staging', image_class='lazy-load', title=None, size=setting_thumbnail_size.value, nolazyload=False):
|
||||
@@ -36,12 +38,25 @@ def staging_file_html_widget(staging_file, click_view=None, page=DEFAULT_PAGE_NU
|
||||
|
||||
query_string = urlencode(query_dict)
|
||||
|
||||
preview_view = '%s?%s' % (reverse('stagingfolderfile-image-view', args=[staging_file.staging_folder.pk, staging_file.encoded_filename]), query_string)
|
||||
preview_view = '%s?%s' % (
|
||||
reverse(
|
||||
'stagingfolderfile-image-view',
|
||||
args=[
|
||||
staging_file.staging_folder.pk, staging_file.encoded_filename
|
||||
]
|
||||
), query_string
|
||||
)
|
||||
|
||||
plain_template = []
|
||||
plain_template.append('<img src="%s" alt="%s" />' % (preview_view, alt_text))
|
||||
plain_template.append(
|
||||
'<img src="%s" alt="%s" />' % (preview_view, alt_text)
|
||||
)
|
||||
|
||||
result.append('<div class="tc" id="staging_file-%s-%d">' % (staging_file.filename, page if page else DEFAULT_PAGE_NUMBER))
|
||||
result.append(
|
||||
'<div class="tc" id="staging_file-%s-%d">' % (
|
||||
staging_file.filename, page if page else DEFAULT_PAGE_NUMBER
|
||||
)
|
||||
)
|
||||
|
||||
if title:
|
||||
title_template = 'title="%s"' % strip_tags(title)
|
||||
@@ -52,12 +67,35 @@ def staging_file_html_widget(staging_file, click_view=None, page=DEFAULT_PAGE_NU
|
||||
# TODO: fix this hack
|
||||
query_dict['size'] = setting_preview_size.value
|
||||
query_string = urlencode(query_dict)
|
||||
result.append('<a %s class="%s" href="%s" %s>' % (gallery_template, fancybox_class, '%s?%s' % (reverse(click_view, args=[staging_file.staging_folder.pk, staging_file.encoded_filename]), query_string), title_template))
|
||||
result.append(
|
||||
'<a %s class="%s" href="%s" %s>' % (
|
||||
gallery_template, fancybox_class,
|
||||
'%s?%s' % (
|
||||
reverse(
|
||||
click_view,
|
||||
args=[
|
||||
staging_file.staging_folder.pk,
|
||||
staging_file.encoded_filename
|
||||
]
|
||||
),
|
||||
query_string
|
||||
), title_template
|
||||
)
|
||||
)
|
||||
|
||||
if nolazyload:
|
||||
result.append('<img style="border: 1px solid black;" src="%s" alt="%s" />' % (preview_view, alt_text))
|
||||
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="%s" alt="%s" />' % (image_class, preview_view, static('appearance/images/loading.png'), alt_text))
|
||||
result.append(
|
||||
'<img class="thin_border %s" data-src="%s" src="%s" alt="%s" />' % (
|
||||
image_class, preview_view,
|
||||
static('appearance/images/loading.png'), alt_text
|
||||
)
|
||||
)
|
||||
|
||||
if click_view:
|
||||
result.append('</a>')
|
||||
|
||||
Reference in New Issue
Block a user