multiEdit: better handling for tag widget

Place tagging widget in a separate action and dialog class; it is
indicated by a 'tag' icon for better clarity.

-- This removes the requirement to specify a dummy 'edit' action on
multi-rules; instead, the separate tag action will appear automatically
as long as 'tags' is specified under the multiEdit's properties.
This commit is contained in:
Brian Federle 2012-08-06 13:56:44 -07:00
parent ba5a72d73e
commit 31fbc7bf80
7 changed files with 63 additions and 66 deletions

View File

@ -1,4 +1,5 @@
#new labels (begin) **********************************************************************************************
label.edit.tags=Edit tags
label.network.rate.megabytes=Network Rate (MB/s)
label.action.enable.physical.network=Enable physical network
label.action.disable.physical.network=Disable physical network

View File

@ -9156,6 +9156,19 @@ div.panel.ui-dialog div.list-view div.fixed-header {
/** Dialog tagger*/
.ui-dialog .tagger {
width: 375px;
}
.ui-dialog .tagger .tag-info {
display: none;
}
.ui-dialog.editTags .ui-button {
float: right;
}
.ui-dialog.editTags .ui-dialog-buttonpane {
float: right;
}
.ui-dialog .tagger .field {
@ -10257,3 +10270,11 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
background-position: -230px -615px;
}
.editTags .icon {
background-position: -228px -65px;
}
.editTags:hover .icon {
background-position: -228px -646px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

@ -25,7 +25,6 @@
<body>
<!-- CloudStack widget content -->
<div id="cloudStack3-container"></div>
<!-- Templates -->
<div id="template">
<!-- Login form -->
@ -113,7 +112,6 @@
</div>
</div>
</div>
<!-- Step 2: Select ISO -->
<div class="step select-iso" wizard-step-id="select-iso">
<!-- Select template -->
@ -1598,8 +1596,6 @@
<script src="lib/flot/jquery.flot.stack.js" type="text/javascript"></script>
<script src="lib/flot/jquery.flot.symbol.js" type="text/javascript"></script>
<script src="lib/flot/jquery.flot.threshold.js" type="text/javascript"></script>
<!-- CloudStack -->
<script type="text/javascript" src="scripts/ui/core.js?t=<%=now%>"></script>
<script type="text/javascript" src="scripts/ui/utils.js?t=<%=now%>"></script>
@ -1656,6 +1652,7 @@
</html>
<script language="javascript">
dictionary = {
'label.edit.tags': '<fmt:message key="label.edit.tags"/>',
'label.network.rate.megabytes': '<fmt:message key="label.network.rate.megabytes"/>',
'message.setup.physical.network.during.zone.creation.basic': '<fmt:message key="message.setup.physical.network.during.zone.creation.basic"/>',
'label.traffic.label': '<fmt:message key="label.traffic.label"/>',

View File

@ -1933,19 +1933,6 @@
}
},
actions: {
edit: {
label: 'label.edit',
// Blank -- edit is just for tags right now
action: function(args) {
args.response.success({
notification: {
label: 'Edit firewall rule',
poll: function(args) { args.complete(); }
}
});
}
},
destroy: {
label: 'label.action.delete.firewall',
action: function(args) {
@ -2804,19 +2791,6 @@
}
},
actions: {
edit: {
label: 'label.edit',
// Blank -- edit is just for tags right now
action: function(args) {
args.response.success({
notification: {
label: 'label.edit.pf',
poll: function(args) { args.complete(); }
}
});
}
},
destroy: {
label: 'label.remove.pf',
action: function(args) {

View File

@ -345,21 +345,51 @@
} });
}
});
if (options.tags) {
$(':ui-dialog:last').append(
$('<div>').addClass('multi-edit-tags').tagger($.extend(true, {}, options.tags, {
context: $.extend(true, {}, options.context, {
multiRule: [multiRule]
})
}))
);
}
}
})
);
});
// Add tagger action
if (options.tags) {
$actions.prepend(
$('<div></div>')
.addClass('action editTags')
.attr('title', _l('label.edit.tags'))
.append($('<span></span>').addClass('icon'))
.click(function() {
$('<div>')
.dialog({
dialogClass: 'editTags',
title: _l('label.edit.tags'),
width: 400,
buttons: [
{
text: _l('label.done'),
'class': 'ok',
click: function() {
$(this).dialog('destroy');
$('div.overlay:last').remove();
return true;
}
}
]
})
.append(
$('<div></div>').addClass('multi-edit-tags').tagger($.extend(true, {}, options.tags, {
context: $.extend(true, {}, options.context, {
multiRule: [multiRule]
})
}))
)
.closest('.ui-dialog').overlay();
return false;
})
)
}
// Add expandable listing, for multiple-item
if (options.multipleAdd) {
// Create expandable box

View File

@ -107,19 +107,6 @@
}
},
actions: {
edit: {
label: 'label.edit',
// Blank -- edit is just for tags right now
action: function(args) {
args.response.success({
notification: {
label: 'Edit ACL item',
poll: function(args) { args.complete(); }
}
});
}
},
destroy: {
label: 'Remove ACL',
action: function(args) {
@ -649,19 +636,6 @@
}
},
actions: {
edit: {
label: 'label.edit',
// Blank -- edit is just for tags right now
action: function(args) {
args.response.success({
notification: {
label: 'Edit static route',
poll: function(args) { args.complete(); }
}
});
}
},
destroy: {
label: 'Remove static route',
action: function(args) {