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
8d0363a3
authored
Mar 24, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: remove additional disk add function in vm create
parent
1069d8d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
38 deletions
+33
-38
circle/dashboard/forms.py
+29
-25
circle/dashboard/static/dashboard/vm-create.js
+4
-13
No files found.
circle/dashboard/forms.py
View file @
8d0363a3
...
...
@@ -185,32 +185,36 @@ class VmCustomizeForm(forms.Form):
HTML
(
_
(
"No disks are added!"
)),
css_id
=
"vm-create-disk-list"
,
),
AnyTag
(
"h3"
,
Div
(
AnyTag
(
"select"
,
css_class
=
"form-control"
,
css_id
=
"vm-create-disk-add-select"
,
),
Div
(
AnyTag
(
"a"
,
AnyTag
(
"i"
,
css_class
=
"icon-plus-sign"
,
),
href
=
"#"
,
css_id
=
"vm-create-disk-add-button"
,
css_class
=
"btn btn-success"
,
),
css_class
=
"input-group-btn"
),
css_class
=
"input-group"
,
style
=
"max-width: 330px;"
,
),
css_id
=
"vm-create-disk-add"
,
Div
(
HTML
(
""
),
style
=
"clear: both;"
,
),
# AnyTag(
# "h3",
# Div(
# AnyTag(
# "select",
# css_class="form-control",
# css_id="vm-create-disk-add-select",
# ),
# Div(
# AnyTag(
# "a",
# AnyTag(
# "i",
# css_class="icon-plus-sign",
# ),
# href="#",
# css_id="vm-create-disk-add-button",
# css_class="btn btn-success",
# ),
# css_class="input-group-btn"
# ),
# css_class="input-group",
# style="max-width: 330px;",
# ),
# css_id="vm-create-disk-add",
# ),
css_class
=
"no-js-hidden"
,
),
css_class
=
"col-sm-8"
,
...
...
circle/dashboard/static/dashboard/vm-create.js
View file @
8d0363a3
...
...
@@ -202,24 +202,14 @@ function vmCustomizeLoaded() {
/* remove disk */
// event for disk remove button (icon, X)
$
(
'body'
).
on
(
'click'
,
'.vm-create-remove-disk'
,
function
()
{
var
disk_pk
=
(
$
(
this
).
parent
(
'span'
).
prop
(
'id'
)).
replace
(
'
vlan
-'
,
''
)
var
disk_pk
=
(
$
(
this
).
parent
(
'span'
).
prop
(
'id'
)).
replace
(
'
disk
-'
,
''
)
$
(
this
).
parent
(
'span'
).
fadeOut
(
500
,
function
()
{
/* if ther are no more disks disabled the add button */
if
(
$
(
'#vm-create-disk-add-select option'
)[
0
].
value
==
-
1
)
{
$
(
'#vm-create-disk-add-button'
).
attr
(
'disabled'
,
false
);
$
(
'#vm-create-disk-add-select'
).
html
(
''
);
}
/* remove the disk label */
$
(
this
).
remove
();
var
disk_name
=
$
(
this
).
text
();
$
(
'#vm-create-disk-add-select'
).
append
(
$
(
'<option>'
,
{
value
:
disk_pk
,
text
:
disk_name
}));
/* remove the selection from the multiple select */
$
(
'#vm-create-disk-add-form option[value="'
+
disk_pk
+
'"]'
).
prop
(
'selected'
,
false
);
if
(
$
(
'#vm-create-disk-list'
).
children
(
'span'
).
length
<
1
)
{
...
...
@@ -300,5 +290,6 @@ function vmCreateNetworkLabel(pk, name, managed) {
function
vmCreateDiskLabel
(
pk
,
name
)
{
return
'<span id="vlan-'
+
pk
+
'" class="label label-primary"><i class="icon-file"></i> '
+
name
+
' <a href="#" class="hover-black vm-create-remove-disk"><i class="icon-remove-sign"></i></a></span> '
;
var
style
=
"float: left; margin: 5px;"
;
return
'<span id="disk-'
+
pk
+
'" class="label label-primary" style="'
+
style
+
'"><i class="icon-file"></i> '
+
name
+
' <a href="#" class="hover-black vm-create-remove-disk"><i class="icon-remove-sign"></i></a></span> '
;
}
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