1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-28 08:06:56 +00:00

Merge pull request #1585 from haiwen/view-shared-dir

update view shared dir page
This commit is contained in:
llj
2017-05-10 18:05:11 +08:00
committed by GitHub
3 changed files with 13 additions and 16 deletions

View File

@@ -13,6 +13,7 @@
<link rel="icon" href="{{ MEDIA_URL }}{{ favicon_path }}" />
<link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.min.css" %}"/>
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/jstree_default_theme/style.min.css" />
<link rel="stylesheet" type="text/css" href="{% static "css/magnific-popup.css" %}" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/seahub.css?t=1398068110" />
{% block extra_style %}{% endblock %}
{% if branding_css != '' %}<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}{{ branding_css }}" />{% endif %}

View File

@@ -3,10 +3,6 @@
{% load seahub_tags i18n staticfiles %}
{% load url from future %}
{% block extra_style %}
<link rel="stylesheet" type="text/css" href="{% static "css/magnific-popup.css" %}" />
{% endblock %}
{% block wide_page_content %}
{% if traffic_over_limit %}
<p class="strip-tip">{% trans "File download is disabled: the share link traffic of owner is used up." %}</p>

View File

@@ -225,18 +225,18 @@ def view_shared_dir(request, fileshare):
mode = 'grid'
thumbnail_size = THUMBNAIL_DEFAULT_SIZE if mode == 'list' else THUMBNAIL_SIZE_FOR_GRID
if not repo.encrypted and ENABLE_THUMBNAIL:
for f in file_list:
file_type, file_ext = get_file_type_and_ext(f.obj_name)
if file_type == IMAGE:
f.is_img = True
if file_type == VIDEO:
f.is_video = True
if file_type == IMAGE or file_type == VIDEO:
if os.path.exists(os.path.join(THUMBNAIL_ROOT, str(thumbnail_size), f.obj_id)):
req_image_path = posixpath.join(req_path, f.obj_name)
src = get_share_link_thumbnail_src(token, thumbnail_size, req_image_path)
f.encoded_thumbnail_src = urlquote(src)
for f in file_list:
file_type, file_ext = get_file_type_and_ext(f.obj_name)
if file_type == IMAGE:
f.is_img = True
if file_type == VIDEO:
f.is_video = True
if (file_type == IMAGE or file_type == VIDEO) and ENABLE_THUMBNAIL:
if os.path.exists(os.path.join(THUMBNAIL_ROOT, str(thumbnail_size), f.obj_id)):
req_image_path = posixpath.join(req_path, f.obj_name)
src = get_share_link_thumbnail_src(token, thumbnail_size, req_image_path)
f.encoded_thumbnail_src = urlquote(src)
return render_to_response('view_shared_dir.html', {
'repo': repo,