1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-22 20:08:19 +00:00

[repo] removed image 'thumbnail' & 'preview', bugfix for 'path link'

This commit is contained in:
llj
2015-08-10 13:26:29 +08:00
parent da7e022b11
commit 818434c65b
5 changed files with 5 additions and 133 deletions

View File

@@ -297,14 +297,6 @@ def list_dir(request, repo_id):
uploadlink = get_uploadlink(repo.id, username, path)
dir_shared_upload_link = get_dir_shared_upload_link(uploadlink)
for f in file_list:
file_path = posixpath.join(path, f.obj_name)
if allow_generate_thumbnail(request, repo_id, file_path):
f.allow_generate_thumbnail = True
if os.path.exists(os.path.join(THUMBNAIL_ROOT, str(THUMBNAIL_DEFAULT_SIZE), f.obj_id)):
src = get_thumbnail_src(repo.id, THUMBNAIL_DEFAULT_SIZE, file_path)
f.encoded_thumbnail_src = urlquote(src)
ctx = {
'repo': repo,
'zipped': zipped,
@@ -324,7 +316,6 @@ def list_dir(request, repo_id):
'enable_upload_folder': settings.ENABLE_UPLOAD_FOLDER,
'current_commit': head_commit,
'info_commit': info_commit,
'ENABLE_THUMBNAIL': ENABLE_THUMBNAIL,
}
html = render_to_string('snippets/repo_dir_data.html', ctx,
context_instance=RequestContext(request))
@@ -388,14 +379,6 @@ def list_dir_more(request, repo_id):
if dirent_more:
more_start = offset + 100
for f in file_list:
file_path = posixpath.join(path, f.obj_name)
if allow_generate_thumbnail(request, repo_id, file_path):
f.allow_generate_thumbnail = True
if os.path.exists(os.path.join(THUMBNAIL_ROOT, str(THUMBNAIL_DEFAULT_SIZE), f.obj_id)):
src = get_thumbnail_src(repo.id, THUMBNAIL_DEFAULT_SIZE, file_path)
f.encoded_thumbnail_src = urlquote(src)
ctx = {
'repo': repo,
'user_perm': user_perm,
@@ -405,7 +388,6 @@ def list_dir_more(request, repo_id):
'file_list': file_list,
'ENABLE_SUB_LIBRARY': ENABLE_SUB_LIBRARY,
'sub_lib_enabled': sub_lib_enabled,
'ENABLE_THUMBNAIL': ENABLE_THUMBNAIL,
}
html = render_to_string('snippets/repo_dirents.html', ctx,
context_instance=RequestContext(request))