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.

Conflicts:
	client/WEB-INF/classes/resources/messages.properties
	ui/css/cloudstack3.css
	ui/index.jsp
This commit is contained in:
Brian Federle 2012-08-06 13:56:44 -07:00
parent feb2ed1d2d
commit 469e180515
7 changed files with 65 additions and 68 deletions

View File

@ -5,9 +5,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@ -17,6 +17,7 @@
#new labels (begin) **********************************************************************************************
label.edit.tags=Edit tags
label.action.enable.physical.network=Enable physical network
label.action.disable.physical.network=Disable physical network
message.action.enable.physical.network=Please confirm that you want to enable this physical network.

View File

@ -9159,6 +9159,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 {
@ -10037,6 +10050,14 @@ div.panel.ui-dialog div.list-view div.fixed-header {
background-position: -230px -615px;
}
.editTags .icon {
background-position: -228px -65px;
}
.editTags:hover .icon {
background-position: -228px -646px;
}
.label-hovered {
cursor: pointer;
color: blue !important;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

@ -43,7 +43,6 @@ under the License.
<body>
<!-- CloudStack widget content -->
<div id="cloudStack3-container"></div>
<!-- Templates -->
<div id="template">
<!-- Login form -->
@ -131,7 +130,6 @@ under the License.
</div>
</div>
</div>
<!-- Step 2: Select ISO -->
<div class="step select-iso" wizard-step-id="select-iso">
<!-- Select template -->
@ -1631,8 +1629,6 @@ under the License.
<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>
@ -1688,6 +1684,7 @@ under the License.
<script language="javascript">
dictionary = {
'label.edit.tags': '<fmt:message key="label.edit.tags"/>',
'label.action.enable.physical.network': '<fmt:message key="label.action.enable.physical.network"/>',
'label.action.disable.physical.network': '<fmt:message key="label.action.disable.physical.network"/>',
'message.action.enable.physical.network': '<fmt:message key="message.action.enable.physical.network"/>',

View File

@ -1930,19 +1930,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) {
@ -2780,19 +2767,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

@ -337,21 +337,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

@ -113,19 +113,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) {
@ -655,19 +642,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) {