Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
af05a3bd
authored
Sep 02, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-266' into 'master'
Link base template of instances
parents
8e3bcfa1
8bb412e3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
circle/dashboard/templates/dashboard/vm-detail/home.html
+6
-0
circle/dashboard/views.py
+6
-1
No files found.
circle/dashboard/templates/dashboard/vm-detail/home.html
View file @
af05a3bd
...
...
@@ -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 @
af05a3bd
...
...
@@ -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,11 @@ class VmDetailView(CheckedDetailView):
context
[
'can_change_resources'
]
=
self
.
request
.
user
.
has_perm
(
"vm.change_resources"
)
# can link template
context
[
'can_link_template'
]
=
(
instance
.
template
and
instance
.
template
.
has_level
(
user
,
"operator"
)
)
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