Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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"] {
display
:
none
;
border-left
:
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 @@
{% for f in root %}
<a
class=
"list-group-item store-list-item"
data-item-type=
"{{ f.TYPE }}"
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"
>
<i
class=
"
icon-{% if f.TYPE == "
D
"
%}
folder-open-alt
{%
else
%}
file-alt
{%
endif
%}"
></i>
</div>
<i
class=
"
icon-{% if f.TYPE == "
D
"
%}
folder-open-alt
{%
else
%}
file-alt
{%
endif
%}"
></i>
</div>
{{ 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"
>
{{ f.human_readable_size }}
</div>
<div
class=
"clearfix"
></div>
</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
}}"
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>
Download
</a>
...
...
circle/dashboard/views.py
View file @
87d2c889
...
...
@@ -2962,8 +2962,11 @@ class StoreList(LoginRequiredMixin, TemplateView):
content
=
store_api
.
listfolder
(
"test"
,
directory
)
for
d
in
content
:
d
[
'human_readable_date'
]
=
datetime
.
fromtimestamp
(
float
(
d
[
'human_readable_date'
]
=
datetime
.
utc
fromtimestamp
(
float
(
d
[
'MTIME'
]))
delta
=
(
datetime
.
utcnow
()
-
d
[
'human_readable_date'
]
)
.
total_seconds
()
d
[
'is_new'
]
=
delta
<
5
and
delta
>
0
d
[
'human_readable_size'
]
=
(
"directory"
if
d
[
'TYPE'
]
==
"D"
else
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