cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [6/7] git commit: Add header fields
Date Tue, 10 Jul 2012 21:58:52 GMT
Add header fields


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/081f1e33
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/081f1e33
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/081f1e33

Branch: refs/heads/master
Commit: 081f1e335dadaf1a0c79d79dbf042b3482aad123
Parents: b000b80
Author: Brian Federle <brian.federle@citrix.com>
Authored: Tue Jul 10 13:31:40 2012 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue Jul 10 14:57:05 2012 -0700

----------------------------------------------------------------------
 ui/css/cloudstack3.css             |   27 +++++++++++++++++++++++++++
 ui/scripts/network.js              |   31 +++++++++++++++++++++++++++++++
 ui/scripts/ui/widgets/multiEdit.js |   18 ++++++++++++++++++
 3 files changed, 76 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/081f1e33/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index f2d1a0d..2a25a0a 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -6926,6 +6926,33 @@ div.panel.ui-dialog div.list-view div.fixed-header {
   margin: 0 22px 0 0;
 }
 
+/** Header fields*/
+.multi-edit .header-fields {
+  float: left;
+  height: 32px;
+  width: 100%;
+  margin-left: 8px;
+}
+
+.multi-edit .header-fields .form-item {
+  margin-bottom: 32px;
+  float: left;
+}
+
+.multi-edit .header-fields .form-item .name,
+.multi-edit .header-fields .form-item .value {
+  float: left;
+}
+
+.multi-edit .header-fields .form-item .name {
+  font-size: 14px;
+  padding: 5px;
+  color: #55687A;
+}
+
+.multi-edit .header-fields input[type=submit] {
+}
+
 /*Security Rules*/
 .security-rules .multi-edit input {
   width: 69px;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/081f1e33/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index baeb972..d12fa30 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1949,6 +1949,21 @@
                         }
                       }
                     }),
+                    headerFields: {
+                      tier: {
+                        label: 'Tier',
+                        select: function(args) {
+                          args.response.success({
+                            data: [
+                              { id: '-1', name: '', description: 'None' },
+                              { id: '1', name: 'tier1', description: 'tier1' },
+                              { id: '2', name: 'tier2', description: 'tier2' },
+                              { id: '3', name: 'tier3', description: 'tier3' }
+                            ]
+                          });
+                        }
+                      }
+                    },
                     multipleAdd: true,
                     fields: {
                       'name': { edit: true, label: 'label.name', isEditable: true },
@@ -1967,6 +1982,7 @@
                           });
                         }
                       },
+
                       'sticky': {
                         label: 'label.stickiness',
                         custom: {
@@ -2278,6 +2294,21 @@
 
                   // Port forwarding rules
                   portForwarding: {
+                    headerFields: {
+                      tier: {
+                        label: 'Tier',
+                        select: function(args) {
+                          args.response.success({
+                            data: [
+                              { id: '-1', name: '', description: 'None' },
+                              { id: '1', name: 'tier1', description: 'tier1' },
+                              { id: '2', name: 'tier2', description: 'tier2' },
+                              { id: '3', name: 'tier3', description: 'tier3' }
+                            ]
+                          });
+                        }
+                      }
+                    },
                     listView: $.extend(true, {}, cloudStack.sections.instances, {
                       listView: {
                         dataProvider: function(args) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/081f1e33/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index 0481dda..8eac506 100644
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -755,6 +755,24 @@
       }
     });
 
+    // Setup header fields
+    var showHeaderFields = args.headerFields ? true : false;
+    var headerForm = showHeaderFields ? cloudStack.dialog.createForm({
+      noDialog: true,
+      form: {
+        fields: args.headerFields
+      },
+      after: function(args) {
+        // Form fields are handled by main 'add' action
+      }
+    }) : null;
+    var $headerFields = $('<div>').addClass('header-fields');
+
+    if (headerForm) {
+      $headerFields.append(headerForm.$formContainer)
+        .prependTo($multi);
+    }
+
     if (args.actions && !args.noHeaderActionsColumn) {
       $thead.append($('<th></th>').html(_l('label.actions')).addClass('multi-actions'));
       $inputForm.append($('<td></td>').addClass('multi-actions'));


Mime
View raw message