Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
+13
-1
circle/dashboard/templates/dashboard/vm-detail/home.html
+6
-0
circle/dashboard/views.py
+7
-1
No files found.
circle/dashboard/templates/dashboard/vm-detail/home.html
View file @
97d83242
...
...
@@ -94,7 +94,13 @@
<dt>
{% trans "Template" %}:
</dt>
<dd>
{% if instance.template %}
{% if can_link_template %}
<a
href=
"{{ instance.template.get_absolute_url }}"
>
{{ instance.template.name }}
</a>
{% else %}
{{ instance.template.name }}
{% endif %}
{% else %}
-
{% endif %}
...
...
circle/dashboard/views.py
View file @
97d83242
...
...
@@ -336,7 +336,7 @@ class VmDetailView(CheckedDetailView):
# resources forms
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"
))
context
[
'resources_form'
]
=
VmResourcesForm
(
can_edit
=
can_edit
,
instance
=
instance
)
...
...
@@ -349,6 +349,12 @@ class VmDetailView(CheckedDetailView):
context
[
'can_change_resources'
]
=
self
.
request
.
user
.
has_perm
(
"vm.change_resources"
)
# can link template
context
[
'can_link_template'
]
=
(
instance
.
template
.
has_level
(
user
,
"operator"
)
if
instance
.
template
else
False
)
return
context
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