Instead of inserting the path of the apps into the Python app, the apps are now referenced by their full import path. This solves name clashes with external or native Python libraries. Example: Mayan statistics app vs. Python new statistics library. Every app reference is now prepended with 'mayan.apps'. Existing config.yml files need to be updated manually. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
26 lines
960 B
Python
26 lines
960 B
Python
from __future__ import unicode_literals
|
|
|
|
from django.template.loader import render_to_string
|
|
|
|
from mayan.apps.documents.settings import (
|
|
setting_preview_width, setting_preview_height, setting_thumbnail_width,
|
|
setting_thumbnail_height
|
|
)
|
|
|
|
|
|
class StagingFileThumbnailWidget(object):
|
|
def render(self, instance):
|
|
return render_to_string(
|
|
template_name='documents/widgets/document_thumbnail.html',
|
|
context={
|
|
'container_class': 'staging-file-thumbnail-container',
|
|
'disable_title_link': True,
|
|
'gallery_name': 'sources:staging_list',
|
|
'instance': instance,
|
|
'size_preview_width': setting_preview_width.value,
|
|
'size_preview_height': setting_preview_height.value,
|
|
'size_thumbnail_width': setting_thumbnail_width.value,
|
|
'size_thumbnail_height': setting_thumbnail_height.value,
|
|
}
|
|
)
|