Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
79703087
authored
Jul 22, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: icons by file type
parent
f7675ebe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
3 deletions
+50
-3
circle/dashboard/store_api.py
+47
-0
circle/dashboard/templates/dashboard/store/_list-box.html
+1
-1
circle/dashboard/templates/dashboard/store/index-files.html
+2
-2
No files found.
circle/dashboard/store_api.py
View file @
79703087
from
os.path
import
splitext
import
json
import
json
import
logging
import
logging
from
urlparse
import
urljoin
from
urlparse
import
urljoin
...
@@ -133,4 +134,50 @@ class Store(object):
...
@@ -133,4 +134,50 @@ class Store(object):
if
d
[
'TYPE'
]
==
"D"
:
if
d
[
'TYPE'
]
==
"D"
:
d
[
'path'
]
+=
"/"
d
[
'path'
]
+=
"/"
d
[
'ext'
]
=
splitext
(
d
[
'path'
])[
1
]
d
[
'icon'
]
=
(
"folder-open"
if
not
d
[
'ext'
]
else
file_icons
.
get
(
d
[
'ext'
],
"file-o"
))
return
sorted
(
content
,
key
=
lambda
k
:
k
[
'TYPE'
])
return
sorted
(
content
,
key
=
lambda
k
:
k
[
'TYPE'
])
file_icons
=
{
'.txt'
:
"file-text-o"
,
'.pdf'
:
"file-pdf-o"
,
'.jpg'
:
"file-image-o"
,
'.jpeg'
:
"file-image-o"
,
'.png'
:
"file-image-o"
,
'.gif'
:
"file-image-o"
,
'.avi'
:
"file-video-o"
,
'.mkv'
:
"file-video-o"
,
'.mp4'
:
"file-video-o"
,
'.mov'
:
"file-video-o"
,
'.mp3'
:
"file-sound-o"
,
'.flac'
:
"file-sound-o"
,
'.wma'
:
"file-sound-o"
,
'.pptx'
:
"file-powerpoint-o"
,
'.ppt'
:
"file-powerpoint-o"
,
'.doc'
:
"file-word-o"
,
'.docx'
:
"file-word-o"
,
'.xlsx'
:
"file-excel-o"
,
'.xls'
:
"file-excel-o"
,
'.rar'
:
"file-archive-o"
,
'.zip'
:
"file-archive-o"
,
'.7z'
:
"file-archive-o"
,
'.tar'
:
"file-archive-o"
,
'.gz'
:
"file-archive-o"
,
'.py'
:
"file-code-o"
,
'.html'
:
"file-code-o"
,
'.js'
:
"file-code-o"
,
'.css'
:
"file-code-o"
,
'.c'
:
"file-code-o"
,
'.cpp'
:
"file-code-o"
,
'.h'
:
"file-code-o"
,
'.sh'
:
"file-code-o"
,
}
circle/dashboard/templates/dashboard/store/_list-box.html
View file @
79703087
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
>
>
<div
class=
"store-list-item-icon"
>
<div
class=
"store-list-item-icon"
>
<i
class=
"
<i
class=
"
fa fa-{
% if f.TYPE == "
D
"
%}
folder-open
store-list-item-icon-directory
{%
else
%}
file
{%
endif
%}"
fa fa-{
{ f.icon }}{% if f.TYPE == "
D
"
%}
store-list-item-icon-directory
{%
endif
%}"
></i>
></i>
</div>
</div>
<div
class=
"store-list-item-name"
>
<div
class=
"store-list-item-name"
>
...
...
circle/dashboard/templates/dashboard/store/index-files.html
View file @
79703087
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
{% for t in toplist %}
{% for t in toplist %}
{% if t.TYPE == "F" %}
{% if t.TYPE == "F" %}
<div
class=
"list-group-item"
>
<div
class=
"list-group-item"
>
<i
class=
"fa fa-
file
dashboard-toplist-icon"
></i>
<i
class=
"fa fa-
{{ t.icon }}
dashboard-toplist-icon"
></i>
<div
class=
"store-list-item-name"
>
<div
class=
"store-list-item-name"
>
{{ t.NAME }}
{{ t.NAME }}
</div>
</div>
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
{% else %}
{% else %}
<a
href=
"{% url "
dashboard
.
views
.
store-list
"
%}?
directory=
{{
t
.
path
}}"
<a
href=
"{% url "
dashboard
.
views
.
store-list
"
%}?
directory=
{{
t
.
path
}}"
class=
"list-group-item"
>
class=
"list-group-item"
>
<i
class=
"fa fa-
folder-open
dashboard-toplist-icon"
></i>
<i
class=
"fa fa-
{{ t.icon }}
dashboard-toplist-icon"
></i>
<div
class=
"store-list-item-name"
>
<div
class=
"store-list-item-name"
>
{{ t.NAME }}
{{ t.NAME }}
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment