Improve file icons
@@ -17,7 +17,7 @@ def tsstr_sec(value):
|
||||
def file_icon_filter(value):
|
||||
"""Get file icon according to the file postfix"""
|
||||
if value.rfind('.') > 0:
|
||||
file_ext = value.split('.')[-1]
|
||||
file_ext = value.split('.')[-1].lower()
|
||||
else:
|
||||
file_ext = None
|
||||
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB |
BIN
media/img/excel-icon-24.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
media/img/folder-icon-24.png
Normal file
After Width: | Height: | Size: 833 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
media/img/ppt-icon-24.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
media/img/word-icon-24.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
19
settings.py
@@ -133,19 +133,20 @@ SEAFILE_VERSION = '0.9.2'
|
||||
# Icons will show in repo page.
|
||||
FILEEXT_ICON_MAP = {
|
||||
# pdf file
|
||||
'pdf' : 'file-extension-pdf-icon-24.png',
|
||||
'pdf' : 'pdf-icon-24.png',
|
||||
# document file
|
||||
'doc' : 'document-word-icon-24.png',
|
||||
'docx' : 'document-word-icon-24.png',
|
||||
'doc' : 'word-icon-24.png',
|
||||
'docx' : 'word-icon-24.png',
|
||||
# ppt file
|
||||
'ppt' : 'document-powerpoint-icon-24.png',
|
||||
'pptx' : 'document-powerpoint-icon-24.png',
|
||||
'ppt' : 'ppt-icon-24.png',
|
||||
'pptx' : 'ppt-icon-24.png',
|
||||
# music file
|
||||
'mp3' : 'File-Music-icon-24.png',
|
||||
'mp3' : 'music-icon-24.png',
|
||||
# picture file
|
||||
'jpg' : 'File-Pictures-icon-24.png',
|
||||
'jpeg' : 'File-Pictures-icon-24.png',
|
||||
'png' : 'File-Pictures-icon-24.png',
|
||||
'jpg' : 'pic-icon-24.png',
|
||||
'jpeg' : 'pic-icon-24.png',
|
||||
'png' : 'pic-icon-24.png',
|
||||
'svg' : 'pic-icon-24.png',
|
||||
# normal file and unkown file
|
||||
'default' : 'File-icon-default-24.png',
|
||||
}
|
||||
|
@@ -59,11 +59,11 @@
|
||||
{% for dirent in dirs %}
|
||||
<tr>
|
||||
{% if dirent.is_dir %}
|
||||
<td><img src="{{ MEDIA_URL }}/img/favicon.png" /></td>
|
||||
<td><img src="{{ MEDIA_URL }}img/folder-icon-24.png" /></td>
|
||||
<td><a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?root_id={{ dirent.obj_id }}&p={{ path }}/{{ dirent.obj_name }}">{{ dirent.obj_name }}</a></td>
|
||||
<td></td>
|
||||
{% else %}
|
||||
<td><img src="{{ MEDIA_URL }}/img/{{ dirent.obj_name|file_icon_filter }}" /></td>
|
||||
<td><img src="{{ MEDIA_URL }}img/{{ dirent.obj_name|file_icon_filter }}" /></td>
|
||||
<td>{{ dirent.props.obj_name }}</td>
|
||||
<td>
|
||||
<a class="op" href="{{ SITE_ROOT }}repo/view/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}">查看</a>
|
||||
|