airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndo...@apache.org
Subject airavata-php-gateway git commit: Disable inputs when gateway Status is CANCELLED-DENIED-or-DEACTIVATED
Date Fri, 02 Sep 2016 05:38:58 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 97a9da56b -> deb8b9e5b


Disable inputs when gateway Status is CANCELLED-DENIED-or-DEACTIVATED


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/deb8b9e5
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/deb8b9e5
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/deb8b9e5

Branch: refs/heads/develop
Commit: deb8b9e5bdd4214ccd1ce460832daacda2f6e750
Parents: 97a9da5
Author: Nipurn Doshi <nipunhere@gmail.com>
Authored: Thu Sep 1 22:38:02 2016 -0700
Committer: Nipurn Doshi <nipunhere@gmail.com>
Committed: Thu Sep 1 22:38:02 2016 -0700

----------------------------------------------------------------------
 app/views/admin/manage-gateway.blade.php | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/deb8b9e5/app/views/admin/manage-gateway.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-gateway.blade.php b/app/views/admin/manage-gateway.blade.php
index 1c0792f..7801a43 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -235,7 +235,7 @@
                     </div>
                     <div class="form-group">
                         <label>Gateway Domain</label>
-                        <input type="text" name="domain" class="form-control domain" value="Domain
will become - 'airavata' . [gateway acroym]" disabled="disabled" />
+                        <input type="text" class="form-control domain" value="Domain will
become - 'airavata' . [gateway acroym]" readonly="readonly" />
                     </div>
                     <div class="form-group">
                         <label>Gateway Url</label>
@@ -284,7 +284,7 @@
 
                     <div class="form-group">
                         <label>Status</label>
-                        <input type="text" name="gatewayApprovalStatus" class="form-control
gatewayApprovalStatus" disabled="disabled" />
+                        <input type="text" name="gatewayApprovalStatus" class="form-control
gatewayApprovalStatus" readonly="readonly" />
                         <!--
                         <select name="gatewayApprovalStatus" class="form-control gatewayApprovalStatus">
                             @foreach( $gatewayApprovalStatuses as $val => $status) 
@@ -584,11 +584,18 @@
         $(".declinedReason").html( gatewayObject.declinedReason);
         $(".gatewayApprovalStatus").val(gatewayApprovalStatuses[ gatewayObject.gatewayApprovalStatus]);
         $(".onTenantComplete").addClass("hide");
+        editableInputs( $("#approve-gateway"), true);
 
         if( gatewayApprovalStatuses[ gatewayObject.gatewayApprovalStatus] == "REQUESTED"){
             $(".createdGateway").addClass("hide");
             $(".notCreatedGateway").removeClass("hide");
         }
+        else if( gatewayApprovalStatuses[ gatewayObject.gatewayApprovalStatus] == "CANCELLED"
||
+            gatewayApprovalStatuses[ gatewayObject.gatewayApprovalStatus] == "DENIED" ||
+            gatewayApprovalStatuses[ gatewayObject.gatewayApprovalStatus] == "DEACTIVATED"){
+            
+            editableInputs( $("#approve-gateway"), false);
+        }
         else
         {
             $(".createdGateway").removeClass("hide");
@@ -674,5 +681,20 @@
         'trigger':'focus'
     });
 
+    function editableInputs( elem, yes){
+        if( yes){
+            elem.find("input").removeAttr("disabled");
+            elem.find("textarea").removeAttr("disabled");
+            elem.find("select").removeAttr("disabled");
+            elem.find("button").removeAttr("disabled");
+        }
+        else{
+            elem.find("input").attr("disabled", "true");
+            elem.find("textarea").prop("disabled", "true");
+            elem.find("select").attr("disabled", "true");
+            elem.find("button").attr("disabled", "true");
+        }
+    }
+
 </script>
 @stop
\ No newline at end of file


Mime
View raw message