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
Commit
b2e6c849
authored
Jul 04, 2014
by
Őry Máté
Committed by
Bach Dániel
Jul 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix operation view's template context
parent
3e205b4e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
circle/dashboard/templates/dashboard/_base.html
+6
-1
circle/dashboard/templates/dashboard/_modal.html
+5
-1
circle/dashboard/views.py
+5
-8
No files found.
circle/dashboard/templates/dashboard/_base.html
View file @
b2e6c849
...
@@ -14,7 +14,12 @@
...
@@ -14,7 +14,12 @@
</h3>
</h3>
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
{{ body|safe|default:"(body missing from context.)" }}
{% if template %}
{% include template %}
{% else %}
{{ body|safe|default:"(body missing from context.)" }}
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% endblock %}
circle/dashboard/templates/dashboard/_modal.html
View file @
b2e6c849
...
@@ -3,7 +3,11 @@
...
@@ -3,7 +3,11 @@
<div
class=
"modal-dialog"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
{{ body|safe|default:"(body missing from context.)" }}
{% if template %}
{% include template %}
{% else %}
{{ body|safe|default:"(body missing from context.)" }}
{% endif %}
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
</div>
</div>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
...
...
circle/dashboard/views.py
View file @
b2e6c849
...
@@ -522,11 +522,11 @@ class OperationView(DetailView):
...
@@ -522,11 +522,11 @@ class OperationView(DetailView):
def
get_url
(
self
):
def
get_url
(
self
):
return
reverse
(
self
.
get_urlname
(),
args
=
(
self
.
get_object
()
.
pk
,
))
return
reverse
(
self
.
get_urlname
(),
args
=
(
self
.
get_object
()
.
pk
,
))
def
get_
wrapper_template_name
(
self
):
def
get_
template_names
(
self
):
if
self
.
request
.
is_ajax
():
if
self
.
request
.
is_ajax
():
return
'dashboard/_modal.html'
return
[
'dashboard/_modal.html'
]
else
:
else
:
return
'dashboard/_base.html'
return
[
'dashboard/_base.html'
]
@classmethod
@classmethod
def
get_op_by_object
(
cls
,
obj
):
def
get_op_by_object
(
cls
,
obj
):
...
@@ -542,15 +542,12 @@ class OperationView(DetailView):
...
@@ -542,15 +542,12 @@ class OperationView(DetailView):
ctx
[
'op'
]
=
self
.
get_op
()
ctx
[
'op'
]
=
self
.
get_op
()
ctx
[
'opview'
]
=
self
ctx
[
'opview'
]
=
self
ctx
[
'url'
]
=
self
.
request
.
path
ctx
[
'url'
]
=
self
.
request
.
path
ctx
[
'template'
]
=
super
(
OperationView
,
self
)
.
get_template_names
()[
0
]
return
ctx
return
ctx
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
get_op
()
.
check_auth
(
request
.
user
)
self
.
get_op
()
.
check_auth
(
request
.
user
)
response
=
super
(
OperationView
,
self
)
.
get
(
request
,
*
args
,
**
kwargs
)
return
super
(
OperationView
,
self
)
.
get
(
request
,
*
args
,
**
kwargs
)
response
.
render
()
response
.
content
=
render_to_string
(
self
.
get_wrapper_template_name
(),
{
'body'
:
response
.
content
})
return
response
def
post
(
self
,
request
,
extra
=
None
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
extra
=
None
,
*
args
,
**
kwargs
):
self
.
object
=
self
.
get_object
()
self
.
object
=
self
.
get_object
()
...
...
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