cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to 4eaa681
Date Sat, 07 Dec 2013 00:35:47 GMT
Updated Branches:
  refs/heads/master 15338e42a -> 4eaa68181


CLOUDSTACK-5354: UI > update ISO > make isExtractable, isFeatured checkbox non-editable
to normal user.


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

Branch: refs/heads/master
Commit: 4eaa68181452f7f348eeaa673a0286d6e3e3d7f6
Parents: 15338e4
Author: Jessica Wang <jessicawang@apache.org>
Authored: Fri Dec 6 16:31:31 2013 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Fri Dec 6 16:35:37 2013 -0800

----------------------------------------------------------------------
 ui/scripts/templates.js | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4eaa6818/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 1100646..bcceb89 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -625,7 +625,7 @@
                                         //zoneid: args.context.templates[0].zoneid //can't
update template/ISO in only one zone. It always get updated in all zones.
                                     };
 
-                                    //if args.data.ispublic is undefined, do not pass ispublic
to API call.
+                                    //if args.data.ispublic is undefined(i.e. checkbox is
hidden), do not pass ispublic to API call.
                                     if (args.data.ispublic == "on") {
                                         $.extend(data, {
                                             ispublic: true
@@ -635,7 +635,7 @@
                                             ispublic: false
                                         });
                                     }
-                                    //if args.data.isfeatured is undefined, do not pass isfeatured
to API call.
+                                    //if args.data.isfeatured is undefined(i.e. checkbox
is hidden), do not pass isfeatured to API call.
                                     if (args.data.isfeatured == "on") {
                                         $.extend(data, {
                                             isfeatured: true
@@ -645,7 +645,7 @@
                                             isfeatured: false
                                         });
                                     }
-                                    //if args.data.isextractable is undefined, do not pass
isextractable to API call.
+                                    //if args.data.isextractable is undefined(i.e. checkbox
is hidden), do not pass isextractable to API call.
                                     if (args.data.isextractable == "on") {
                                         $.extend(data, {
                                             isextractable: true
@@ -1441,7 +1441,7 @@
                                         id: args.context.isos[0].id,
                                         //zoneid: args.context.isos[0].zoneid //can't update
template/ISO in only one zone. It always get updated in all zones.
                                     };
-                                    //if args.data.ispublic is undefined, do not pass ispublic
to API call.
+                                    //if args.data.ispublic is undefined(i.e. checkbox is
hidden), do not pass ispublic to API call.
                                     if (args.data.ispublic == "on") {
                                         $.extend(data, {
                                             ispublic: true
@@ -1451,7 +1451,7 @@
                                             ispublic: false
                                         });
                                     }
-                                    //if args.data.isfeatured is undefined, do not pass isfeatured
to API call.
+                                    //if args.data.isfeatured is undefined(i.e. checkbox
is hidden), do not pass isfeatured to API call.
                                     if (args.data.isfeatured == "on") {
                                         $.extend(data, {
                                             isfeatured: true
@@ -1461,7 +1461,7 @@
                                             isfeatured: false
                                         });
                                     }
-                                    //if args.data.isextractable is undefined, do not pass
isextractable to API call.
+                                    //if args.data.isextractable is undefined(i.e. checkbox
is hidden), do not pass isextractable to API call.
                                     if (args.data.isextractable == "on") {
                                         $.extend(data, {
                                             isextractable: true
@@ -1701,7 +1701,12 @@
                                     isextractable: {
                                         label: 'extractable',
                                         isBoolean: true,
-                                        isEditable: true,
+                                        isEditable: function() {
+                                            if (isAdmin())
+                                                return true;
+                                            else
+                                                return false;
+                                        },
                                         converter: cloudStack.converters.toBooleanText
                                     },
                                     bootable: {
@@ -1717,7 +1722,12 @@
                                     isfeatured: {
                                         label: 'label.featured',
                                         isBoolean: true,
-                                        isEditable: true,
+                                        isEditable: function() {
+                                            if (isAdmin())
+                                                return true;
+                                            else
+                                                return false;
+                                        },
                                         converter: cloudStack.converters.toBooleanText
                                     },
                                     crossZones: {


Mime
View raw message