Convert document thumbnails, preview, image preview and staging files to template base widgets. Unify all updated widgets. Display resolution settings are now specified as width and height and not a single resolution value.

Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
Michael Price
2018-03-12 15:55:13 -04:00
committed by Roberto Rosario
parent d29d4ba110
commit 8590bff6e4
19 changed files with 264 additions and 471 deletions

View File

@@ -7,6 +7,7 @@ import time
import urllib
from django.core.files import File
from django.urls import reverse
from django.utils.encoding import force_text, python_2_unicode_compatible
from converter import TransformationResize, converter_class
@@ -63,6 +64,14 @@ class StagingFile(object):
file=open(self.get_full_path(), mode='rb'), name=self.filename
)
def get_api_image_url(self):
return reverse(
'rest_api:stagingfolderfile-image-view', args=(
self.staging_folder.pk,
self.encoded_filename
)
)
def get_date_time_created(self):
return time.ctime(os.path.getctime(self.get_full_path()))