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
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 @@
</h3>
</div>
<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>
{% endblock %}
circle/dashboard/templates/dashboard/_modal.html
View file @
b2e6c849
...
...
@@ -3,7 +3,11 @@
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<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>
<div
class=
"clearfix"
></div>
...
...
circle/dashboard/views.py
View file @
b2e6c849
...
...
@@ -522,11 +522,11 @@ class OperationView(DetailView):
def
get_url
(
self
):
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
():
return
'dashboard/_modal.html'
return
[
'dashboard/_modal.html'
]
else
:
return
'dashboard/_base.html'
return
[
'dashboard/_base.html'
]
@classmethod
def
get_op_by_object
(
cls
,
obj
):
...
...
@@ -542,15 +542,12 @@ class OperationView(DetailView):
ctx
[
'op'
]
=
self
.
get_op
()
ctx
[
'opview'
]
=
self
ctx
[
'url'
]
=
self
.
request
.
path
ctx
[
'template'
]
=
super
(
OperationView
,
self
)
.
get_template_names
()[
0
]
return
ctx
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
get_op
()
.
check_auth
(
request
.
user
)
response
=
super
(
OperationView
,
self
)
.
get
(
request
,
*
args
,
**
kwargs
)
response
.
render
()
response
.
content
=
render_to_string
(
self
.
get_wrapper_template_name
(),
{
'body'
:
response
.
content
})
return
response
return
super
(
OperationView
,
self
)
.
get
(
request
,
*
args
,
**
kwargs
)
def
post
(
self
,
request
,
extra
=
None
,
*
args
,
**
kwargs
):
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