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
4c14305e
authored
Apr 14, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: if no more networks disabled the button
parent
deeeddce
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
circle/dashboard/templates/dashboard/vm-detail/network.html
+4
-4
circle/dashboard/views.py
+1
-1
No files found.
circle/dashboard/templates/dashboard/vm-detail/network.html
View file @
4c14305e
...
...
@@ -121,15 +121,15 @@
{% csrf_token %}
<div
class=
"input-group"
style=
"max-width: 330px;"
>
<select
name=
"new_network_vlan"
class=
"form-control"
>
{% if vlans|length == 0 %}
<option
value=
"-1"
>
No more networks!
</option>
{% endif %}
{% for v in vlans %}
<option
value=
"{{ v.pk }}"
>
{{ v.name }}
</option>
{% empty %}
<option
value=
"-1"
>
No more networks!
</option>
{% endfor %}
</select>
<div
class=
"input-group-btn"
>
<button
type=
"submit"
class=
"btn btn-success"
><i
class=
"icon-plus-sign"
></i></button>
<button
{%
if
vlans
|
length =
=
0
%}
disabled
{%
endif
%}
type=
"submit"
class=
"btn btn-success"
><i
class=
"icon-plus-sign"
></i></button>
</div>
</div>
</form>
...
...
circle/dashboard/views.py
View file @
4c14305e
...
...
@@ -400,7 +400,7 @@ class VmDetailView(CheckedDetailView):
if
not
self
.
object
.
has_level
(
request
.
user
,
'owner'
):
raise
PermissionDenied
()
vlan
=
Vlan
.
objects
.
get
(
pk
=
request
.
POST
.
get
(
"new_network_vlan"
))
vlan
=
get_object_or_404
(
Vlan
,
pk
=
request
.
POST
.
get
(
"new_network_vlan"
))
if
not
vlan
.
has_level
(
request
.
user
,
'user'
):
raise
PermissionDenied
()
try
:
...
...
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