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
d92716d6
authored
6 years ago
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure default lease's role selector doesn't show up
parent
48c95e94
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
circle/dashboard/templates/dashboard/lease-edit.html
+5
-3
circle/dashboard/views/template.py
+6
-0
No files found.
circle/dashboard/templates/dashboard/lease-edit.html
View file @
d92716d6
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
{% endwith %}
{% endwith %}
<form
method=
"post"
>
<form
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
<div
class=
"row"
>
<div
class=
"row
container-fluid
"
>
<div
class=
"col-md-7"
>
<div
{%
if
not
is_default
%}
class=
"col-md-7"
{%
endif
%}
>
{{ form.name|as_crispy_field }}
{{ form.name|as_crispy_field }}
<label>
Suspend in
</label>
<label>
Suspend in
</label>
<div
class=
"input-group interval-input"
>
<div
class=
"input-group interval-input"
>
...
@@ -42,10 +42,12 @@
...
@@ -42,10 +42,12 @@
<div
class=
"input-group-addon"
>
months
</div>
<div
class=
"input-group-addon"
>
months
</div>
</div>
</div>
</div>
</div>
{% if not is_default %}
<div
class=
"col-md-5"
>
<div
class=
"col-md-5"
>
{{ form.roles }}
{{ form.roles }}
</div>
</div>
<div
class=
"form-group container-fluid"
>
{% endif %}
<div
class=
"form-group"
>
<div
class=
"controls "
>
<div
class=
"controls "
>
<input
type=
"submit"
name=
"submit"
value=
"Save changes"
class=
"btn btn-primary"
id=
"submit-id-submit"
>
<input
type=
"submit"
name=
"submit"
value=
"Save changes"
class=
"btn btn-primary"
id=
"submit-id-submit"
>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
circle/dashboard/views/template.py
View file @
d92716d6
...
@@ -60,6 +60,7 @@ from .util import (
...
@@ -60,6 +60,7 @@ from .util import (
DeleteViewBase
,
TransferOwnershipConfirmView
,
TransferOwnershipView
)
DeleteViewBase
,
TransferOwnershipConfirmView
,
TransferOwnershipView
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
from
django.conf
import
settings
class
TemplateChoose
(
LoginRequiredMixin
,
TemplateView
):
class
TemplateChoose
(
LoginRequiredMixin
,
TemplateView
):
...
@@ -433,6 +434,11 @@ class LeaseDetail(LoginRequiredMixin, PolicyMixin,
...
@@ -433,6 +434,11 @@ class LeaseDetail(LoginRequiredMixin, PolicyMixin,
kwargs
[
'roles'
]
=
keystone
.
role_list
(
self
.
request
)
kwargs
[
'roles'
]
=
keystone
.
role_list
(
self
.
request
)
return
kwargs
return
kwargs
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
context
=
super
(
LeaseDetail
,
self
)
.
get_context_data
(
*
args
,
**
kwargs
)
context
[
'is_default'
]
=
settings
.
DEFAULT_LEASE_NAME
==
self
.
object
.
name
return
context
class
LeaseDelete
(
DeleteViewBase
):
class
LeaseDelete
(
DeleteViewBase
):
model
=
Lease
model
=
Lease
...
...
This diff is collapsed.
Click to expand it.
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