Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
0f995dc5
authored
Apr 20, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
request: hide lease request button if no lease types are present
parent
9147fadb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
circle/dashboard/templates/dashboard/_vm-renew.html
+2
-0
circle/dashboard/views/vm.py
+2
-1
No files found.
circle/dashboard/templates/dashboard/_vm-renew.html
View file @
0f995dc5
...
...
@@ -8,11 +8,13 @@
<a
class=
"btn btn-default"
href=
"{{object.get_absolute_url}}"
data-dismiss=
"modal"
>
{% trans "Cancel" %}
</a>
{% if lease_types %}
<a
class=
"btn btn-primary"
id=
"vm-renew-request-lease-button"
href=
"{% url "
request
.
views
.
request-lease
"
vm_pk=
object.pk
%}"
>
<i
class=
"fa fa-forward"
></i>
{% trans "Request longer lease" %}
</a>
{% endif %}
<button
class=
"btn btn-{{ opview.effect }} btn-op-form-send"
type=
"submit"
id=
"op-form-send"
>
{% if opview.icon %}
<i
class=
"fa fa-fw fa-{{opview.icon}}"
></i>
{% endif %}{{ op.name|capfirst }}
</button>
...
...
circle/dashboard/views/vm.py
View file @
0f995dc5
...
...
@@ -66,7 +66,7 @@ from ..forms import (
VmPortRemoveForm
,
VmPortAddForm
,
VmRemoveInterfaceForm
,
)
from
request.models
import
TemplateAccessType
from
request.models
import
TemplateAccessType
,
LeaseType
from
request.forms
import
LeaseRequestForm
,
TemplateRequestForm
from
..models
import
Favourite
from
manager.scheduler
import
has_traits
...
...
@@ -681,6 +681,7 @@ class VmRenewView(FormOperationMixin, TokenOperationView, VmOperationView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
VmRenewView
,
self
)
.
get_context_data
(
**
kwargs
)
context
[
'lease_request_form'
]
=
LeaseRequestForm
(
request
=
self
.
request
)
context
[
'lease_types'
]
=
LeaseType
.
objects
.
exists
()
return
context
...
...
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