Improve file icons
@@ -17,7 +17,7 @@ def tsstr_sec(value):
|
|||||||
def file_icon_filter(value):
|
def file_icon_filter(value):
|
||||||
"""Get file icon according to the file postfix"""
|
"""Get file icon according to the file postfix"""
|
||||||
if value.rfind('.') > 0:
|
if value.rfind('.') > 0:
|
||||||
file_ext = value.split('.')[-1]
|
file_ext = value.split('.')[-1].lower()
|
||||||
else:
|
else:
|
||||||
file_ext = None
|
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.
|
# Icons will show in repo page.
|
||||||
FILEEXT_ICON_MAP = {
|
FILEEXT_ICON_MAP = {
|
||||||
# pdf file
|
# pdf file
|
||||||
'pdf' : 'file-extension-pdf-icon-24.png',
|
'pdf' : 'pdf-icon-24.png',
|
||||||
# document file
|
# document file
|
||||||
'doc' : 'document-word-icon-24.png',
|
'doc' : 'word-icon-24.png',
|
||||||
'docx' : 'document-word-icon-24.png',
|
'docx' : 'word-icon-24.png',
|
||||||
# ppt file
|
# ppt file
|
||||||
'ppt' : 'document-powerpoint-icon-24.png',
|
'ppt' : 'ppt-icon-24.png',
|
||||||
'pptx' : 'document-powerpoint-icon-24.png',
|
'pptx' : 'ppt-icon-24.png',
|
||||||
# music file
|
# music file
|
||||||
'mp3' : 'File-Music-icon-24.png',
|
'mp3' : 'music-icon-24.png',
|
||||||
# picture file
|
# picture file
|
||||||
'jpg' : 'File-Pictures-icon-24.png',
|
'jpg' : 'pic-icon-24.png',
|
||||||
'jpeg' : 'File-Pictures-icon-24.png',
|
'jpeg' : 'pic-icon-24.png',
|
||||||
'png' : 'File-Pictures-icon-24.png',
|
'png' : 'pic-icon-24.png',
|
||||||
|
'svg' : 'pic-icon-24.png',
|
||||||
# normal file and unkown file
|
# normal file and unkown file
|
||||||
'default' : 'File-icon-default-24.png',
|
'default' : 'File-icon-default-24.png',
|
||||||
}
|
}
|
||||||
|
@@ -59,11 +59,11 @@
|
|||||||
{% for dirent in dirs %}
|
{% for dirent in dirs %}
|
||||||
<tr>
|
<tr>
|
||||||
{% if dirent.is_dir %}
|
{% 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><a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?root_id={{ dirent.obj_id }}&p={{ path }}/{{ dirent.obj_name }}">{{ dirent.obj_name }}</a></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
{% else %}
|
{% 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>{{ dirent.props.obj_name }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="op" href="{{ SITE_ROOT }}repo/view/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}">查看</a>
|
<a class="op" href="{{ SITE_ROOT }}repo/view/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}">查看</a>
|
||||||
|