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
97d83242
authored
Sep 02, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: link base template of instance
Also fixing a dog issue
parent
824c85f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
circle/dashboard/templates/dashboard/vm-detail/home.html
+7
-1
circle/dashboard/views.py
+7
-1
No files found.
circle/dashboard/templates/dashboard/vm-detail/home.html
View file @
97d83242
...
@@ -94,7 +94,13 @@
...
@@ -94,7 +94,13 @@
<dt>
{% trans "Template" %}:
</dt>
<dt>
{% trans "Template" %}:
</dt>
<dd>
<dd>
{% if instance.template %}
{% if instance.template %}
{{ instance.template.name }}
{% if can_link_template %}
<a
href=
"{{ instance.template.get_absolute_url }}"
>
{{ instance.template.name }}
</a>
{% else %}
{{ instance.template.name }}
{% endif %}
{% else %}
{% else %}
-
-
{% endif %}
{% endif %}
...
...
circle/dashboard/views.py
View file @
97d83242
...
@@ -336,7 +336,7 @@ class VmDetailView(CheckedDetailView):
...
@@ -336,7 +336,7 @@ class VmDetailView(CheckedDetailView):
# resources forms
# resources forms
can_edit
=
(
can_edit
=
(
instance
in
Instance
.
get_objects_with_level
(
"owner"
,
user
)
instance
.
has_level
(
user
,
"owner"
)
and
self
.
request
.
user
.
has_perm
(
"vm.change_resources"
))
and
self
.
request
.
user
.
has_perm
(
"vm.change_resources"
))
context
[
'resources_form'
]
=
VmResourcesForm
(
context
[
'resources_form'
]
=
VmResourcesForm
(
can_edit
=
can_edit
,
instance
=
instance
)
can_edit
=
can_edit
,
instance
=
instance
)
...
@@ -349,6 +349,12 @@ class VmDetailView(CheckedDetailView):
...
@@ -349,6 +349,12 @@ class VmDetailView(CheckedDetailView):
context
[
'can_change_resources'
]
=
self
.
request
.
user
.
has_perm
(
context
[
'can_change_resources'
]
=
self
.
request
.
user
.
has_perm
(
"vm.change_resources"
)
"vm.change_resources"
)
# can link template
context
[
'can_link_template'
]
=
(
instance
.
template
.
has_level
(
user
,
"operator"
)
if
instance
.
template
else
False
)
return
context
return
context
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
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