1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 07:47:32 +00:00

Merge pull request #883 from haiwen/new-file-icons-192

add HD images for 'shared dir' grid view
This commit is contained in:
llj 2015-11-05 14:52:04 +08:00
commit a66e768748
21 changed files with 37 additions and 37 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

BIN
media/img/file/file-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

BIN
media/img/file/pdf-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
media/img/file/pic-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

BIN
media/img/file/ppt-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

BIN
media/img/file/txt-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

BIN
media/img/file/word-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -78,41 +78,41 @@ FILEEXT_ICON_MAP = {
# normal file and unknown file
'default' : 'file.png',
# for 128 pixel icon
# for 192 pixel icon
# pdf file
'pdf-128' : 'pdf-128.png',
'pdf-192' : 'pdf-192.png',
# document file
'doc-128' : 'word-128.png',
'docx-128' : 'word-128.png',
'ppt-128' : 'ppt-128.png',
'pptx-128' : 'ppt-128.png',
'xls-128' : 'excel-128.png',
'xlsx-128' : 'excel-128.png',
'txt-128' : 'txt-128.png',
'odt-128' : 'word-128.png',
'fodt-128' : 'word-128.png',
'ods-128' : 'excel-128.png',
'fods-128' : 'excel-128.png',
'odp-128' : 'ppt-128.png',
'fodp-128' : 'ppt-128.png',
'doc-192' : 'word-192.png',
'docx-192' : 'word-192.png',
'ppt-192' : 'ppt-192.png',
'pptx-192' : 'ppt-192.png',
'xls-192' : 'excel-192.png',
'xlsx-192' : 'excel-192.png',
'txt-192' : 'txt-192.png',
'odt-192' : 'word-192.png',
'fodt-192' : 'word-192.png',
'ods-192' : 'excel-192.png',
'fods-192' : 'excel-192.png',
'odp-192' : 'ppt-192.png',
'fodp-192' : 'ppt-192.png',
# music file
'mp3-128' : 'music-128.png',
'oga-128' : 'music-128.png',
'ogg-128' : 'music-128.png',
'flac-128' : 'music-128.png',
'aac-128' : 'music-128.png',
'ac3-128' : 'music-128.png',
'wma-128' : 'music-128.png',
'mp3-192' : 'music-192.png',
'oga-192' : 'music-192.png',
'ogg-192' : 'music-192.png',
'flac-192' : 'music-192.png',
'aac-192' : 'music-192.png',
'ac3-192' : 'music-192.png',
'wma-192' : 'music-192.png',
# picture file
'jpg-128' : 'pic-128.png',
'jpeg-128' : 'pic-128.png',
'png-128' : 'pic-128.png',
'svg-128' : 'pic-128.png',
'gif-128' : 'pic-128.png',
'bmp-128' : 'pic-128.png',
'ico-128' : 'pic-128.png',
'jpg-192' : 'pic-192.png',
'jpeg-192' : 'pic-192.png',
'png-192' : 'pic-192.png',
'svg-192' : 'pic-192.png',
'gif-192' : 'pic-192.png',
'bmp-192' : 'pic-192.png',
'ico-192' : 'pic-192.png',
# normal file and unknown file
'default-128' : 'file-128.png',
'default-192' : 'file-192.png',
}
@register.filter(name='file_icon_filter')
def file_icon_filter(value, size=None):
@ -123,13 +123,13 @@ def file_icon_filter(value, size=None):
file_ext = None
if file_ext and FILEEXT_ICON_MAP.has_key(file_ext):
if size == 128:
return FILEEXT_ICON_MAP.get(file_ext + '-128')
if size == 192:
return FILEEXT_ICON_MAP.get(file_ext + '-192')
else:
return FILEEXT_ICON_MAP.get(file_ext)
else:
if size == 128:
return FILEEXT_ICON_MAP.get('default-128')
if size == 192:
return FILEEXT_ICON_MAP.get('default-192')
else:
return FILEEXT_ICON_MAP.get('default')

View File

@ -96,7 +96,7 @@
{% for dirent in dir_list %}
<li class="grid" title="{{ dirent.obj_name }}">
<a href="?p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}&mode={{mode}}" class="img-link">
<img src="{{ MEDIA_URL }}img/folder-beige-128.png" alt="" width="96" class="vam" />
<img src="{{ MEDIA_URL }}img/folder-beige-192.png" alt="" width="96" class="vam" />
</a>
<a href="?p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}&mode={{mode}}" class="text-link ellipsis">{{ dirent.obj_name }}</a>
{% if not traffic_over_limit %}
@ -114,10 +114,10 @@
{% if dirent.encoded_thumbnail_src %}
<img class="thumbnail vam" src="{{ SITE_ROOT }}{{ dirent.encoded_thumbnail_src }}" alt="" />
{% else %}
<img class="not-thumbnail vam" src="{{ MEDIA_URL }}img/file/{{ dirent.obj_name|file_icon_filter:128 }}" alt="" width="96" />
<img class="not-thumbnail vam" src="{{ MEDIA_URL }}img/file/{{ dirent.obj_name|file_icon_filter:192 }}" alt="" width="96" />
{% endif %}
{% else %}
<img class="vam" src="{{ MEDIA_URL }}img/file/{{ dirent.obj_name|file_icon_filter:128 }}" alt="" width="96" />
<img class="vam" src="{{ MEDIA_URL }}img/file/{{ dirent.obj_name|file_icon_filter:192 }}" alt="" width="96" />
{% endif %}
</a>