Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
833bb0b6
authored
Mar 18, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-hide-node-activities' into 'master'
Feature hide node activities
✅
See merge request !311
parents
ffbca82d
dcb0f9f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
circle/dashboard/templates/dashboard/node-detail/_activity-timeline.html
+12
-0
circle/dashboard/views/node.py
+9
-2
No files found.
circle/dashboard/templates/dashboard/node-detail/_activity-timeline.html
View file @
833bb0b6
...
@@ -39,3 +39,15 @@
...
@@ -39,3 +39,15 @@
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{% if show_show_all %}
<div
id=
"show-all-activities-container"
>
<a
id=
"show-all-activities"
href=
"#"
>
{% if activities|length > 10 %}
{% trans "Show less activities" %}
<i
class=
"fa fa-angle-double-up"
></i>
{% else %}
{% trans "Show all activities" %}
<i
class=
"fa fa-angle-double-down"
></i>
{% endif %}
</a>
</div>
{% endif %}
circle/dashboard/views/node.py
View file @
833bb0b6
...
@@ -102,7 +102,8 @@ class NodeDetailView(LoginRequiredMixin,
...
@@ -102,7 +102,8 @@ class NodeDetailView(LoginRequiredMixin,
)
.
order_by
(
'-started'
)
.
select_related
()
)
.
order_by
(
'-started'
)
.
select_related
()
context
[
'ops'
]
=
get_operations
(
self
.
object
,
self
.
request
.
user
)
context
[
'ops'
]
=
get_operations
(
self
.
object
,
self
.
request
.
user
)
context
[
'op'
]
=
{
i
.
op
:
i
for
i
in
context
[
'ops'
]}
context
[
'op'
]
=
{
i
.
op
:
i
for
i
in
context
[
'ops'
]}
context
[
'activities'
]
=
na
context
[
'show_show_all'
]
=
len
(
na
)
>
10
context
[
'activities'
]
=
na
[:
10
]
context
[
'trait_form'
]
=
form
context
[
'trait_form'
]
=
form
context
[
'graphite_enabled'
]
=
(
context
[
'graphite_enabled'
]
=
(
settings
.
GRAPHITE_URL
is
not
None
)
settings
.
GRAPHITE_URL
is
not
None
)
...
@@ -294,15 +295,21 @@ class NodeAddTraitView(SuperuserRequiredMixin, DetailView):
...
@@ -294,15 +295,21 @@ class NodeAddTraitView(SuperuserRequiredMixin, DetailView):
class
NodeActivityView
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
View
):
class
NodeActivityView
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
View
):
def
get
(
self
,
request
,
pk
):
def
get
(
self
,
request
,
pk
):
show_all
=
request
.
GET
.
get
(
"show_all"
,
"false"
)
==
"true"
node
=
Node
.
objects
.
get
(
pk
=
pk
)
node
=
Node
.
objects
.
get
(
pk
=
pk
)
activities
=
NodeActivity
.
objects
.
filter
(
activities
=
NodeActivity
.
objects
.
filter
(
node
=
node
,
parent
=
None
)
.
order_by
(
'-started'
)
.
select_related
()
node
=
node
,
parent
=
None
)
.
order_by
(
'-started'
)
.
select_related
()
show_show_all
=
len
(
activities
)
>
10
if
not
show_all
:
activities
=
activities
[:
10
]
response
=
{
response
=
{
'activities'
:
render_to_string
(
'activities'
:
render_to_string
(
"dashboard/node-detail/_activity-timeline.html"
,
"dashboard/node-detail/_activity-timeline.html"
,
RequestContext
(
request
,
{
'activities'
:
activities
}))
RequestContext
(
request
,
{
'activities'
:
activities
,
'show_show_all'
:
show_show_all
}))
}
}
return
HttpResponse
(
return
HttpResponse
(
...
...
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