Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
87d2c889
authored
Jul 08, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: mark new files on store list
parent
77334780
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
8 deletions
+34
-8
circle/dashboard/static/dashboard/dashboard.css
+16
-0
circle/dashboard/templates/dashboard/store/list.html
+14
-7
circle/dashboard/views.py
+4
-1
No files found.
circle/dashboard/static/dashboard/dashboard.css
View file @
87d2c889
...
@@ -753,4 +753,20 @@ textarea[name="list-new-namelist"] {
...
@@ -753,4 +753,20 @@ textarea[name="list-new-namelist"] {
display
:
none
;
display
:
none
;
border-left
:
1px
solid
#ddd
;
border-left
:
1px
solid
#ddd
;
border-right
:
1px
solid
#ddd
;
border-right
:
1px
solid
#ddd
;
position
:
relative
;
}
.store-list-item-new
{
display
:
inline-block
;
}
.store-list-item-new
.badge
{
margin-left
:
5px
;
background
:
#5bc0dc
;
}
.store-download-button
{
position
:
absolute
;
right
:
15px
;
top
:
32px
;
}
}
circle/dashboard/templates/dashboard/store/list.html
View file @
87d2c889
...
@@ -19,21 +19,28 @@
...
@@ -19,21 +19,28 @@
{% for f in root %}
{% for f in root %}
<a
class=
"list-group-item store-list-item"
data-item-type=
"{{ f.TYPE }}"
<a
class=
"list-group-item store-list-item"
data-item-type=
"{{ f.TYPE }}"
href=
"{% if f.TYPE == "
D
"
%}?
directory=
{{
f
.
path
}}{%
else
%}
href=
"{% if f.TYPE == "
D
"
%}?
directory=
{{
f
.
path
}}{%
else
%}
{%
url
"
dashboard
.
views
.
store-download
"
%}?
path=
{{
f
.
path
}}{%
endif
%}"
>
{%
url
"
dashboard
.
views
.
store-download
"
%}?
path=
{{
f
.
path
}}{%
endif
%}"
>
<div
class=
"store-list-item-icon"
>
<div
class=
"store-list-item-icon"
>
<i
class=
"
<i
class=
"
icon-{% if f.TYPE == "
D
"
%}
folder-open-alt
{%
else
%}
file-alt
{%
endif
%}"
icon-{% if f.TYPE == "
D
"
%}
folder-open-alt
{%
else
%}
file-alt
{%
endif
%}"
></i>
></i>
</div>
</div>
{{ f.NAME }}
{{ f.NAME }}
<div
class=
"store-list-item-new"
>
{% if f.is_new %}
<span
class=
"badge badge-pulse"
>
{% trans "new" %}
</span>
{% endif %}
</div>
<div
class=
"store-list-item-size"
>
<div
class=
"store-list-item-size"
>
{{ f.human_readable_size }}
{{ f.human_readable_size }}
</div>
</div>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
</a>
</a>
<div
class=
"store-list-file-infos"
style=
"position: relative;"
>
<div
class=
"store-list-file-infos"
>
<a
href=
"{% url "
dashboard
.
views
.
store-download
"
%}?
path=
{{
f
.
path
}}"
<a
href=
"{% url "
dashboard
.
views
.
store-download
"
%}?
path=
{{
f
.
path
}}"
class=
"btn btn-primary
"
style=
"position: absolute; right: 15px; top: 32px;
"
>
class=
"btn btn-primary
btn-sm store-download-button
"
>
<i
class=
"icon-download"
></i>
<i
class=
"icon-download"
></i>
Download
Download
</a>
</a>
...
...
circle/dashboard/views.py
View file @
87d2c889
...
@@ -2962,8 +2962,11 @@ class StoreList(LoginRequiredMixin, TemplateView):
...
@@ -2962,8 +2962,11 @@ class StoreList(LoginRequiredMixin, TemplateView):
content
=
store_api
.
listfolder
(
"test"
,
directory
)
content
=
store_api
.
listfolder
(
"test"
,
directory
)
for
d
in
content
:
for
d
in
content
:
d
[
'human_readable_date'
]
=
datetime
.
fromtimestamp
(
float
(
d
[
'human_readable_date'
]
=
datetime
.
utc
fromtimestamp
(
float
(
d
[
'MTIME'
]))
d
[
'MTIME'
]))
delta
=
(
datetime
.
utcnow
()
-
d
[
'human_readable_date'
]
)
.
total_seconds
()
d
[
'is_new'
]
=
delta
<
5
and
delta
>
0
d
[
'human_readable_size'
]
=
(
d
[
'human_readable_size'
]
=
(
"directory"
if
d
[
'TYPE'
]
==
"D"
else
"directory"
if
d
[
'TYPE'
]
==
"D"
else
filesizeformat
(
float
(
d
[
'SIZE'
])))
filesizeformat
(
float
(
d
[
'SIZE'
])))
...
...
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