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/4.3 to 90d29ac
Date Sat, 07 Dec 2013 00:35:02 GMT
Updated Branches:
  refs/heads/4.3 d931718ab -> 90d29ac86


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/90d29ac8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/90d29ac8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/90d29ac8

Branch: refs/heads/4.3
Commit: 90d29ac86aa8a8031a9ea7d7155b0e0fda982d92
Parents: d931718
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:34:49 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/90d29ac8/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index f45c2d2..abadee8 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -623,7 +623,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
@@ -633,7 +633,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
@@ -643,7 +643,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
@@ -1439,7 +1439,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
@@ -1449,7 +1449,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
@@ -1459,7 +1459,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
@@ -1699,7 +1699,12 @@
                                     isextractable: {
                                         label: 'extractable',
                                         isBoolean: true,
-                                        isEditable: true,
+                                        isEditable: function() {
+                                            if (isAdmin())
+                                                return true;
+                                            else
+                                                return false;
+                                        },
                                         converter: cloudStack.converters.toBooleanText
                                     },
                                     bootable: {
@@ -1715,7 +1720,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