You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2016/10/28 20:04:47 UTC

[01/18] airavata-php-gateway git commit: AIRAVATA-2152 Initial attempt at user compute resources page

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop e47baa67a -> 6d121230c


AIRAVATA-2152 Initial attempt at user compute resources page


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/0be549c6
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/0be549c6
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/0be549c6

Branch: refs/heads/develop
Commit: 0be549c613690aae7b55dd0b72c1e3ac1d0d2d97
Parents: e47baa6
Author: Marcus Christie <ma...@gmail.com>
Authored: Wed Oct 12 17:19:22 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 13:11:11 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php           |  13 +-
 app/views/account/compute-resources.blade.php   |  17 ---
 .../account/user-compute-resources.blade.php    |  62 +++++++++
 .../user-compute-resource-preferences.blade.php | 128 +++++++++++++++++++
 4 files changed, 201 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0be549c6/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 2b3eced..183a427 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -537,8 +537,17 @@ class AccountController extends BaseController
 
     public function getComputeResources(){
         $userResourceProfile = URPUtilities::get_or_create_user_resource_profile();
-        return View::make("account/compute-resources", array(
-            "userResourceProfile" => $userResourceProfile
+        $allCRs = CRUtilities::getAllCRObjects();
+        // TODO: actually get all of the user's credential store tokens, including description
+        $tokens = array(
+            $userResourceProfile->credentialStoreToken => "Default SSH Key"
+        );
+        return View::make("account/user-compute-resources", array(
+            "userResourceProfile" => $userResourceProfile,
+            "computeResources" => $allCRs,
+            // TODO: only show compute resources that user hasn't already configured with an account
+            "unselectedCRs" => $allCRs,
+            "tokens" => $tokens
         ));
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0be549c6/app/views/account/compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/compute-resources.blade.php b/app/views/account/compute-resources.blade.php
deleted file mode 100644
index 89d64a8..0000000
--- a/app/views/account/compute-resources.blade.php
+++ /dev/null
@@ -1,17 +0,0 @@
-@extends('layout.basic')
-
-@section('page-header')
-@parent
-@stop
-
-@section('content')
-<div class="container">
-{{var_dump($userResourceProfile)}}
-</div>
-
-@stop
-
-@section('scripts')
-@parent
-<script></script>
-@stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0be549c6/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
new file mode 100644
index 0000000..7838623
--- /dev/null
+++ b/app/views/account/user-compute-resources.blade.php
@@ -0,0 +1,62 @@
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+@stop
+
+@section('content')
+<!-- TODO: datepicker for reservation date doesn't work yet -->
+@foreach( (array)$computeResources as $index => $cr)
+@include('partials/user-compute-resource-preferences', array('computeResource' => $cr))
+@endforeach
+<div class="container">
+    <h1>Compute Resource Accounts</h1>
+    <div class="row">
+        <div class="col-md-12">
+            <button class="btn btn-default add-user-cr">
+                <span class="glyphicon glyphicon-plus"></span> Add a Compute Resource Account
+            </button>
+        </div>
+    </div>
+</div>
+<div class="add-user-compute-resource-block hide">
+    <div class="well">
+        <!-- TODO: need to implement /add-user-crp -->
+        <form action="{{URL::to('/')}}/account/add-user-crp" method="POST">
+            <input type="hidden" name="gatewayId" id="gatewayId" value="{{$userResourceProfile->gatewayID}}">
+
+            <div class="input-group">
+                <select name="computeResourceId" class="cr-select form-control">
+                    <option value="">Select a Compute Resource and configure your account</option>
+                    @foreach( (array)$unselectedCRs as $index => $cr)
+                    <option value="{{ $cr->computeResourceId}}">{{ $cr->hostName }}</option>
+                    @endforeach
+                </select>
+                <!-- TODO: implement the remove behavior -->
+                <span class="input-group-addon remove-cr" style="cursor:pointer;">x</span>
+            </div>
+            <div class="user-cr-pref-space form-horizontal"></div>
+        </form>
+    </div>
+</div>
+<pre>
+    {{var_dump($userResourceProfile)}}
+</pre>
+@stop
+
+@section('scripts')
+@parent
+<script>
+
+$('.add-user-cr').on('click', function(){
+
+    $(this).after( $(".add-user-compute-resource-block").html() );
+});
+$("body").on("change", ".cr-select", function(){
+    crId = $(this).val();
+    //This is done as Jquery creates problems when using period(.) in id or class.
+    crId = crId.replace(/\./g,"_");
+    $(".user-cr-pref-space").html($("#cr-" + crId).html());
+});
+</script>
+@stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0be549c6/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
new file mode 100644
index 0000000..e930e53
--- /dev/null
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -0,0 +1,128 @@
+<!-- String replace is done as Jquery creates problems when using period(.) in id or class. -->
+<div id="cr-{{ str_replace( '.', "_", $computeResource->computeResourceId) }}" class="@if(isset( $show) ) @if( !$show) hide @endif @else hide @endif">
+<h3 class="text-center">Set Preferences</h3>
+<div class="form-group">
+    <label class="control-label col-md-3">Login Username</label>
+
+    <div class="col-md-9">
+        <input type="text" name="loginUserName" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif"/>
+    </div>
+</div>
+<div class="form-group">
+    <label class="control-label col-md-3">Preferred Batch Queue</label>
+
+    <div class="col-md-9">
+        <select name="preferredBatchQueue" class="form-control">
+            <option value="">Select a Queue from list</option>
+            @foreach( (array)$computeResource->batchQueues as $index => $queue)
+            <option value="{{ $queue->queueName}}"
+            @if( isset( $preferences) ) @if( $preferences->preferredBatchQueue == $queue->queueName) selected @endif
+            @endif>{{ $queue->queueName}}</option>
+            @endforeach
+        </select>
+    </div>
+</div>
+<div class="form-group">
+    <label class="control-label col-md-3">Scratch Location</label>
+
+    <div class="col-md-9">
+        <input type="text" name="scratchLocation" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->scratchLocation}}@endif"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Allocation Project Number</label>
+
+    <div class="col-md-9">
+        <input type="text" name="allocationProjectNumber" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->allocationProjectNumber}}@endif"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Resource Specific Credential Store Token</label>
+
+    <div class="col-md-9">
+        <select class="form-control gateway-credential-store-token" name="resourceSpecificCredentialStoreToken" >
+            <option value="">Select a Credential Token from Store</option>
+            @foreach( $tokens as $token => $description )
+                <option value="{{$token}}" @if( isset( $preferences) ) @if( $token == $preferences->resourceSpecificCredentialStoreToken) selected @endif @endif>{{$description}}</option>
+            @endforeach
+            <option value="">DO-NO-SET</option>
+        </select>
+        <!--
+        <input type="text" name="resourceSpecificCredentialStoreToken" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->resourceSpecificCredentialStoreToken}}@endif"/>
+        -->
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Quality of Service</label>
+
+    <div class="col-md-9">
+        <input type="text" name="qualityOfService" class="qualityOfService form-control"
+               value="@if( isset( $preferences) ){{$preferences->qualityOfService}}@endif" data-toggle="popover" data-placement="bottom" data-content="Format: <queue name1>=<qos1>,<queue name2>=<qos2>"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Reservation Name</label>
+
+    <div class="col-md-9">
+        <input type="text" name="reservation" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->reservation}}@endif"/>
+    </div>
+</div>
+<?php
+//to add or remove time according to local hours.
+$timeDifference = Session::get("user_timezone");
+$addOrSubtract = "-";
+if( $timeDifference < 0)
+    $addOrSubtract = "+";
+
+$reservationStartTime = "";
+if( isset( $preferences) && $preferences->reservationStartTime != '')
+    $reservationStartTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", $preferences->reservationStartTime/1000);
+
+$reservationEndTime = "";
+if( isset( $preferences) && $preferences->reservationEndTime != '')
+    $reservationEndTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", $preferences->reservationEndTime/1000);
+
+?>
+<div class="form-group col-md-6">
+    <label class="control-label col-md-3">Reservation Start Time</label>
+
+    <div class="input-group date datetimepicker1">
+        <input type="text" name="reservationStartTime" class="form-control"
+               value="@if( isset( $preferences) )@if( trim($preferences->reservationStartTime) != '' || $preferences->reservationStartTime != null){{date('m/d/Y h:i:s A', intval( $reservationStartTime))}}@endif @endif"/>
+        <span class="input-group-addon">
+            <span class="glyphicon glyphicon-calendar"></span>
+        </span>
+    </div>
+</div>
+
+<div class="form-group col-md-6">
+    <label class="control-label col-md-3">Reservation End Time</label>
+
+    <div class="input-group date datetimepicker2">
+        <input type="text" name="reservationEndTime" class="form-control"
+               value="@if( isset( $preferences) )@if( trim($preferences->reservationEndTime) != ''|| $preferences->reservationStartTime != null){{date('m/d/Y h:i:s A', intval($reservationEndTime))}}@endif @endif"/>
+        <span class="input-group-addon">
+            <span class="glyphicon glyphicon-calendar"></span>
+        </span>
+    </div>
+</div>
+
+<div class="form-group text-center">
+    <input type="submit" class="btn btn-primary submit-user-crp-form" value="Save"/>
+</div>
+</div>
+
+<div class="loading-gif text-center hide">
+    <img  src='{{URL::to('/')}}/assets/ajax-loader.gif'/>
+</div>
+<div class="col-md-offset-2 col-md-8 alert alert-success hide">Compute Resource Preferences have been updated.</div>
+<div class="col-md-offset-2 col-md-8 alert alert-danger hide">An error has occurred.</div>
\ No newline at end of file


[07/18] airavata-php-gateway git commit: AIRAVATA-2152 Add missing semicolons

Posted by sm...@apache.org.
AIRAVATA-2152 Add missing semicolons


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/95e34c21
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/95e34c21
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/95e34c21

Branch: refs/heads/develop
Commit: 95e34c21b22ec83dfd8dd6dc33c61c7610f47104
Parents: d7cffc6
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Oct 20 10:34:36 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:04:30 2016 -0400

----------------------------------------------------------------------
 app/views/partials/user-compute-resource-preferences.blade.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/95e34c21/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
index af0872e..531975d 100644
--- a/app/views/partials/user-compute-resource-preferences.blade.php
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -85,11 +85,11 @@
 //to add or remove time according to local hours.
 $reservationStartTime = "";
 if( isset( $preferences) && $preferences->reservationStartTime != '')
-    $reservationStartTime = CommonUtilities::convertUTCToLocal($preferences->reservationStartTime/1000)
+    $reservationStartTime = CommonUtilities::convertUTCToLocal($preferences->reservationStartTime/1000);
 
 $reservationEndTime = "";
 if( isset( $preferences) && $preferences->reservationEndTime != '')
-    $reservationEndTime = CommonUtilities::convertUTCToLocal($preferences->reservationEndTime/1000)
+    $reservationEndTime = CommonUtilities::convertUTCToLocal($preferences->reservationEndTime/1000);
 
 ?>
 


[13/18] airavata-php-gateway git commit: AIRAVATA-2152 Fix reservation times datetimepicker

Posted by sm...@apache.org.
AIRAVATA-2152 Fix reservation times datetimepicker

Fixes bug when value of datetimepicker is " ". Now it is either a date
time string or an empty string.

I couldn't get setMinDate/setMaxDate to work so I just removed it.

Updated the name of datetimepicker to include version number. The
version we are using comes from
https://github.com/Eonasdan/bootstrap-datetimepicker/tree/v3.1.3


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/3a790190
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3a790190
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3a790190

Branch: refs/heads/develop
Commit: 3a790190744b22e9fd79d7cb5afc7141b65ee236
Parents: 95e34c2
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Oct 20 11:49:23 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:04:31 2016 -0400

----------------------------------------------------------------------
 app/views/account/user-compute-resources.blade.php  | 12 +-----------
 app/views/admin/manage-experiments.blade.php        |  2 +-
 app/views/admin/manage-gateway.blade.php            |  2 +-
 app/views/admin/manage-notices.blade.php            |  2 +-
 app/views/experiment/browse.blade.php               |  2 +-
 app/views/experiment/no-sharing-browse.blade.php    |  2 +-
 .../user-compute-resource-preferences.blade.php     | 16 ++++++++++------
 public/js/datetimepicker-3.1.3.js                   |  1 +
 public/js/datetimepicker.js                         |  1 -
 9 files changed, 17 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index e46f37e..4d451ba 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -15,7 +15,6 @@ button.add-user-cr {
 @stop
 
 @section('content')
-<!-- TODO: datepicker for reservation date doesn't work yet -->
 @foreach( (array)$computeResources as $index => $cr)
 @include('partials/user-compute-resource-preferences', array('computeResource' => $cr))
 @endforeach
@@ -122,7 +121,7 @@ button.add-user-cr {
 @section('scripts')
 @parent
 {{ HTML::script('js/moment.js')}}
-{{ HTML::script('js/datetimepicker.js')}}
+{{ HTML::script('js/datetimepicker-3.1.3.js')}}
 <script>
 
 $('.add-user-cr').on('click', function(){
@@ -156,14 +155,5 @@ $(".datetimepicker1 input").focus( function(){
 $(".datetimepicker2 input").focus( function(){
     $(this).parent().find(".glyphicon-calendar").click();
 });
-
-$(".datetimepicker1").on("dp.change", function (e) {
-    $('.datetimepicker2').data("DateTimePicker").setMinDate(e.date);
-    $(this).find(".glyphicon-calendar").click();
-});
-$(".datetimepicker2").on("dp.change", function (e) {
-    $('.datetimepicker1').data("DateTimePicker").setMaxDate(e.date);
-    $(this).find(".glyphicon-calendar").click();
-});
 </script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/app/views/admin/manage-experiments.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-experiments.blade.php b/app/views/admin/manage-experiments.blade.php
index 8949f4a..c2fad49 100644
--- a/app/views/admin/manage-experiments.blade.php
+++ b/app/views/admin/manage-experiments.blade.php
@@ -312,7 +312,7 @@
 @parent
 {{ HTML::script('js/gateway.js') }}
 {{ HTML::script('js/moment.js')}}
-{{ HTML::script('js/datetimepicker.js')}}
+{{ HTML::script('js/datetimepicker-3.1.3.js')}}
 
 <!-- Morris Charts JavaScript -->
 <!--

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/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 1883fa2..d65d212 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -425,7 +425,7 @@
 @parent
 {{ HTML::script('js/gateway.js') }}
 {{ HTML::script('js/moment.js')}}
-{{ HTML::script('js/datetimepicker.js')}}
+{{ HTML::script('js/datetimepicker-3.1.3.js')}}
 
 <script>
     //make first tab of accordion open by default.

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/app/views/admin/manage-notices.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-notices.blade.php b/app/views/admin/manage-notices.blade.php
index bec0ee9..ff3c29e 100644
--- a/app/views/admin/manage-notices.blade.php
+++ b/app/views/admin/manage-notices.blade.php
@@ -212,7 +212,7 @@
 @parent
 
 {{ HTML::script('js/moment.js')}}
-{{ HTML::script('js/datetimepicker.js')}}
+{{ HTML::script('js/datetimepicker-3.1.3.js')}}
 
 <script>
         $(".create-notice-button").click( function(){

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/app/views/experiment/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/browse.blade.php b/app/views/experiment/browse.blade.php
index 5b76914..09e9929 100755
--- a/app/views/experiment/browse.blade.php
+++ b/app/views/experiment/browse.blade.php
@@ -121,7 +121,7 @@
 @section('scripts')
 @parent
 {{ HTML::script('js/moment.js')}}
-{{ HTML::script('js/datetimepicker.js')}}
+{{ HTML::script('js/datetimepicker-3.1.3.js')}}
 
 <script type="text/javascript">
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/app/views/experiment/no-sharing-browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/no-sharing-browse.blade.php b/app/views/experiment/no-sharing-browse.blade.php
index 5b76914..09e9929 100755
--- a/app/views/experiment/no-sharing-browse.blade.php
+++ b/app/views/experiment/no-sharing-browse.blade.php
@@ -121,7 +121,7 @@
 @section('scripts')
 @parent
 {{ HTML::script('js/moment.js')}}
-{{ HTML::script('js/datetimepicker.js')}}
+{{ HTML::script('js/datetimepicker-3.1.3.js')}}
 
 <script type="text/javascript">
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
index 531975d..8753f6c 100644
--- a/app/views/partials/user-compute-resource-preferences.blade.php
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -84,12 +84,16 @@
 <?php
 //to add or remove time according to local hours.
 $reservationStartTime = "";
-if( isset( $preferences) && $preferences->reservationStartTime != '')
-    $reservationStartTime = CommonUtilities::convertUTCToLocal($preferences->reservationStartTime/1000);
+if( isset( $preferences) && trim($preferences->reservationStartTime) != '') {
+    $reservationStartTimeLocal = CommonUtilities::convertUTCToLocal($preferences->reservationStartTime/1000);
+    $reservationStartTime = date('m/d/Y h:i:s A', $reservationStartTimeLocal);
+}
 
 $reservationEndTime = "";
-if( isset( $preferences) && $preferences->reservationEndTime != '')
-    $reservationEndTime = CommonUtilities::convertUTCToLocal($preferences->reservationEndTime/1000);
+if( isset( $preferences) && $preferences->reservationEndTime != '') {
+    $reservationEndTimeLocal = CommonUtilities::convertUTCToLocal($preferences->reservationEndTime/1000);
+    $reservationEndTime = date('m/d/Y h:i:s A', $reservationEndTimeLocal);
+}
 
 ?>
 
@@ -99,7 +103,7 @@ if( isset( $preferences) && $preferences->reservationEndTime != '')
 
         <div class="input-group date datetimepicker1">
             <input type="text" name="reservationStartTime" class="form-control"
-                   value="@if( isset( $preferences) )@if( trim($preferences->reservationStartTime) != '' || $preferences->reservationStartTime != null){{date('m/d/Y h:i:s A', intval( $reservationStartTime))}}@endif @endif"/>
+                   value="{{$reservationStartTime}}"/>
             <span class="input-group-addon">
                 <span class="glyphicon glyphicon-calendar"></span>
             </span>
@@ -111,7 +115,7 @@ if( isset( $preferences) && $preferences->reservationEndTime != '')
 
         <div class="input-group date datetimepicker2">
             <input type="text" name="reservationEndTime" class="form-control"
-                   value="@if( isset( $preferences) )@if( trim($preferences->reservationEndTime) != ''|| $preferences->reservationStartTime != null){{date('m/d/Y h:i:s A', intval($reservationEndTime))}}@endif @endif"/>
+                   value="{{$reservationEndTime}}"/>
             <span class="input-group-addon">
                 <span class="glyphicon glyphicon-calendar"></span>
             </span>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/public/js/datetimepicker-3.1.3.js
----------------------------------------------------------------------
diff --git a/public/js/datetimepicker-3.1.3.js b/public/js/datetimepicker-3.1.3.js
new file mode 100644
index 0000000..cdba4b1
--- /dev/null
+++ b/public/js/datetimepicker-3.1.3.js
@@ -0,0 +1 @@
+!function(a,b){"use strict";if("function"==typeof define&&define.amd)define(["jquery","moment"],b);else if("object"==typeof exports)b(require("jquery"),require("moment"));else{if(!jQuery)throw new Error("bootstrap-datetimepicker requires jQuery to be loaded first");if(!moment)throw new Error("bootstrap-datetimepicker requires moment.js to be loaded first");b(a.jQuery,moment)}}(this,function(a,b){"use strict";if("undefined"==typeof b)throw new Error("momentjs is required");var c=0,d=function(d,e){var f,g=a.fn.datetimepicker.defaults,h={time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},i=this,j=!1,k=function(){var f,j,k=!1;if(i.options=a.extend({},g,e),i.options.icons=a.extend({},h,i.options.icons),i.element=a(d),m(),!i.options.pickTime&&!i.options.pickDate)throw new Error("Must choose at least one picker");if(i.id=c++,b.locale(i.options.language),i.date=b(),i.unset=!1,i.isInput=i.element.is
 ("input"),i.component=!1,i.element.hasClass("input-group")&&(i.component=i.element.find(0===i.element.find(".datepickerbutton").size()?'[class^="input-group-"]':".datepickerbutton")),i.format=i.options.format,f=b().localeData(),i.format||(i.format=i.options.pickDate?f.longDateFormat("L"):"",i.options.pickDate&&i.options.pickTime&&(i.format+=" "),i.format+=i.options.pickTime?f.longDateFormat("LT"):"",i.options.useSeconds&&(-1!==f.longDateFormat("LT").indexOf(" A")?i.format=i.format.split(" A")[0]+":ss A":i.format+=":ss")),i.use24hours=i.format.toLowerCase().indexOf("a")<0&&i.format.indexOf("h")<0,i.component&&(k=i.component.find("span")),i.options.pickTime&&k&&k.addClass(i.options.icons.time),i.options.pickDate&&k&&(k.removeClass(i.options.icons.time),k.addClass(i.options.icons.date)),i.options.widgetParent="string"==typeof i.options.widgetParent&&i.options.widgetParent||i.element.parents().filter(function(){return"scroll"===a(this).css("overflow-y")}).get(0)||"body",i.widget=a(Q()).
 appendTo(i.options.widgetParent),i.minViewMode=i.options.minViewMode||0,"string"==typeof i.minViewMode)switch(i.minViewMode){case"months":i.minViewMode=1;break;case"years":i.minViewMode=2;break;default:i.minViewMode=0}if(i.viewMode=i.options.viewMode||0,"string"==typeof i.viewMode)switch(i.viewMode){case"months":i.viewMode=1;break;case"years":i.viewMode=2;break;default:i.viewMode=0}i.viewMode=Math.max(i.viewMode,i.minViewMode),i.options.disabledDates=O(i.options.disabledDates),i.options.enabledDates=O(i.options.enabledDates),i.startViewMode=i.viewMode,i.setMinDate(i.options.minDate),i.setMaxDate(i.options.maxDate),r(),s(),u(),v(),w(),q(),E(),l().prop("disabled")||F(),""!==i.options.defaultDate&&""===l().val()&&i.setValue(i.options.defaultDate),1!==i.options.minuteStepping&&(j=i.options.minuteStepping,i.date.minutes(Math.round(i.date.minutes()/j)*j%60).seconds(0))},l=function(){var a;if(i.isInput)return i.element;if(a=i.element.find(".datepickerinput"),0===a.size())a=i.element.find("
 input");else if(!a.is("input"))throw new Error('CSS class "datepickerinput" cannot be applied to non input element');return a},m=function(){var a;a=i.element.is("input")?i.element.data():i.element.find("input").data(),void 0!==a.dateFormat&&(i.options.format=a.dateFormat),void 0!==a.datePickdate&&(i.options.pickDate=a.datePickdate),void 0!==a.datePicktime&&(i.options.pickTime=a.datePicktime),void 0!==a.dateUseminutes&&(i.options.useMinutes=a.dateUseminutes),void 0!==a.dateUseseconds&&(i.options.useSeconds=a.dateUseseconds),void 0!==a.dateUsecurrent&&(i.options.useCurrent=a.dateUsecurrent),void 0!==a.calendarWeeks&&(i.options.calendarWeeks=a.calendarWeeks),void 0!==a.dateMinutestepping&&(i.options.minuteStepping=a.dateMinutestepping),void 0!==a.dateMindate&&(i.options.minDate=a.dateMindate),void 0!==a.dateMaxdate&&(i.options.maxDate=a.dateMaxdate),void 0!==a.dateShowtoday&&(i.options.showToday=a.dateShowtoday),void 0!==a.dateCollapse&&(i.options.collapse=a.dateCollapse),void 0!==a.da
 teLanguage&&(i.options.language=a.dateLanguage),void 0!==a.dateDefaultdate&&(i.options.defaultDate=a.dateDefaultdate),void 0!==a.dateDisableddates&&(i.options.disabledDates=a.dateDisableddates),void 0!==a.dateEnableddates&&(i.options.enabledDates=a.dateEnableddates),void 0!==a.dateIcons&&(i.options.icons=a.dateIcons),void 0!==a.dateUsestrict&&(i.options.useStrict=a.dateUsestrict),void 0!==a.dateDirection&&(i.options.direction=a.dateDirection),void 0!==a.dateSidebyside&&(i.options.sideBySide=a.dateSidebyside),void 0!==a.dateDaysofweekdisabled&&(i.options.daysOfWeekDisabled=a.dateDaysofweekdisabled)},n=function(){var b,c="absolute",d=i.component?i.component.offset():i.element.offset(),e=a(window);i.width=i.component?i.component.outerWidth():i.element.outerWidth(),d.top=d.top+i.element.outerHeight(),"up"===i.options.direction?b="top":"bottom"===i.options.direction?b="bottom":"auto"===i.options.direction&&(b=d.top+i.widget.height()>e.height()+e.scrollTop()&&i.widget.height()+i.element.o
 uterHeight()<d.top?"top":"bottom"),"top"===b?(d.bottom=e.height()-d.top+i.element.outerHeight()+3,i.widget.addClass("top").removeClass("bottom")):(d.top+=1,i.widget.addClass("bottom").removeClass("top")),void 0!==i.options.width&&i.widget.width(i.options.width),"left"===i.options.orientation&&(i.widget.addClass("left-oriented"),d.left=d.left-i.widget.width()+20),J()&&(c="fixed",d.top-=e.scrollTop(),d.left-=e.scrollLeft()),e.width()<d.left+i.widget.outerWidth()?(d.right=e.width()-d.left-i.width,d.left="auto",i.widget.addClass("pull-right")):(d.right="auto",i.widget.removeClass("pull-right")),i.widget.css("top"===b?{position:c,bottom:d.bottom,top:"auto",left:d.left,right:d.right}:{position:c,top:d.top,bottom:"auto",left:d.left,right:d.right})},o=function(a,c){(!b(i.date).isSame(b(a))||j)&&(j=!1,i.element.trigger({type:"dp.change",date:b(i.date),oldDate:b(a)}),"change"!==c&&i.element.change())},p=function(a){j=!0,i.element.trigger({type:"dp.error",date:b(a,i.format,i.options.useStrict)
 })},q=function(a){b.locale(i.options.language);var c=a;c||(c=l().val(),c&&(i.date=b(c,i.format,i.options.useStrict)),i.date||(i.date=b())),i.viewDate=b(i.date).startOf("month"),t(),x()},r=function(){b.locale(i.options.language);var c,d=a("<tr>"),e=b.weekdaysMin();if(i.options.calendarWeeks===!0&&d.append('<th class="cw">#</th>'),0===b().localeData()._week.dow)for(c=0;7>c;c++)d.append('<th class="dow">'+e[c]+"</th>");else for(c=1;8>c;c++)d.append(7===c?'<th class="dow">'+e[0]+"</th>":'<th class="dow">'+e[c]+"</th>");i.widget.find(".datepicker-days thead").append(d)},s=function(){b.locale(i.options.language);var a,c="",d=b.monthsShort();for(a=0;12>a;a++)c+='<span class="month">'+d[a]+"</span>";i.widget.find(".datepicker-months td").append(c)},t=function(){if(i.options.pickDate){b.locale(i.options.language);var c,d,e,f,g,h,j,k,l,m=i.viewDate.year(),n=i.viewDate.month(),o=i.options.minDate.year(),p=i.options.minDate.month(),q=i.options.maxDate.year(),r=i.options.maxDate.month(),s=[],t=b
 .months();for(i.widget.find(".datepicker-days").find(".disabled").removeClass("disabled"),i.widget.find(".datepicker-months").find(".disabled").removeClass("disabled"),i.widget.find(".datepicker-years").find(".disabled").removeClass("disabled"),i.widget.find(".datepicker-days th:eq(1)").text(t[n]+" "+m),d=b(i.viewDate,i.format,i.options.useStrict).subtract(1,"months"),j=d.daysInMonth(),d.date(j).startOf("week"),(m===o&&p>=n||o>m)&&i.widget.find(".datepicker-days th:eq(0)").addClass("disabled"),(m===q&&n>=r||m>q)&&i.widget.find(".datepicker-days th:eq(2)").addClass("disabled"),e=b(d).add(42,"d");d.isBefore(e);){if(d.weekday()===b().startOf("week").weekday()&&(f=a("<tr>"),s.push(f),i.options.calendarWeeks===!0&&f.append('<td class="cw">'+d.week()+"</td>")),g="",d.year()<m||d.year()===m&&d.month()<n?g+=" old":(d.year()>m||d.year()===m&&d.month()>n)&&(g+=" new"),d.isSame(b({y:i.date.year(),M:i.date.month(),d:i.date.date()}))&&(g+=" active"),(M(d,"day")||!N(d))&&(g+=" disabled"),i.option
 s.showToday===!0&&d.isSame(b(),"day")&&(g+=" today"),i.options.daysOfWeekDisabled)for(h=0;h<i.options.daysOfWeekDisabled.length;h++)if(d.day()===i.options.daysOfWeekDisabled[h]){g+=" disabled";break}f.append('<td class="day'+g+'">'+d.date()+"</td>"),c=d.date(),d.add(1,"d"),c===d.date()&&d.add(1,"d")}for(i.widget.find(".datepicker-days tbody").empty().append(s),l=i.date.year(),t=i.widget.find(".datepicker-months").find("th:eq(1)").text(m).end().find("span").removeClass("active"),l===m&&t.eq(i.date.month()).addClass("active"),o>m-1&&i.widget.find(".datepicker-months th:eq(0)").addClass("disabled"),m+1>q&&i.widget.find(".datepicker-months th:eq(2)").addClass("disabled"),h=0;12>h;h++)m===o&&p>h||o>m?a(t[h]).addClass("disabled"):(m===q&&h>r||m>q)&&a(t[h]).addClass("disabled");for(s="",m=10*parseInt(m/10,10),k=i.widget.find(".datepicker-years").find("th:eq(1)").text(m+"-"+(m+9)).parents("table").find("td"),i.widget.find(".datepicker-years").find("th").removeClass("disabled"),o>m&&i.widget
 .find(".datepicker-years").find("th:eq(0)").addClass("disabled"),m+9>q&&i.widget.find(".datepicker-years").find("th:eq(2)").addClass("disabled"),m-=1,h=-1;11>h;h++)s+='<span class="year'+(-1===h||10===h?" old":"")+(l===m?" active":"")+(o>m||m>q?" disabled":"")+'">'+m+"</span>",m+=1;k.html(s)}},u=function(){b.locale(i.options.language);var a,c,d,e=i.widget.find(".timepicker .timepicker-hours table"),f="";if(e.parent().hide(),i.use24hours)for(a=0,c=0;6>c;c+=1){for(f+="<tr>",d=0;4>d;d+=1)f+='<td class="hour">'+P(a.toString())+"</td>",a++;f+="</tr>"}else for(a=1,c=0;3>c;c+=1){for(f+="<tr>",d=0;4>d;d+=1)f+='<td class="hour">'+P(a.toString())+"</td>",a++;f+="</tr>"}e.html(f)},v=function(){var a,b,c=i.widget.find(".timepicker .timepicker-minutes table"),d="",e=0,f=i.options.minuteStepping;for(c.parent().hide(),1===f&&(f=5),a=0;a<Math.ceil(60/f/4);a++){for(d+="<tr>",b=0;4>b;b+=1)60>e?(d+='<td class="minute">'+P(e.toString())+"</td>",e+=f):d+="<td></td>";d+="</tr>"}c.html(d)},w=function(){va
 r a,b,c=i.widget.find(".timepicker .timepicker-seconds table"),d="",e=0;for(c.parent().hide(),a=0;3>a;a++){for(d+="<tr>",b=0;4>b;b+=1)d+='<td class="second">'+P(e.toString())+"</td>",e+=5;d+="</tr>"}c.html(d)},x=function(){if(i.date){var a=i.widget.find(".timepicker span[data-time-component]"),b=i.date.hours(),c=i.date.format("A");i.use24hours||(0===b?b=12:12!==b&&(b%=12),i.widget.find(".timepicker [data-action=togglePeriod]").text(c)),a.filter("[data-time-component=hours]").text(P(b)),a.filter("[data-time-component=minutes]").text(P(i.date.minutes())),a.filter("[data-time-component=seconds]").text(P(i.date.second()))}},y=function(c){c.stopPropagation(),c.preventDefault(),i.unset=!1;var d,e,f,g,h=a(c.target).closest("span, td, th"),j=b(i.date);if(1===h.length&&!h.is(".disabled"))switch(h[0].nodeName.toLowerCase()){case"th":switch(h[0].className){case"picker-switch":E(1);break;case"prev":case"next":f=R.modes[i.viewMode].navStep,"prev"===h[0].className&&(f=-1*f),i.viewDate.add(f,R.mod
 es[i.viewMode].navFnc),t()}break;case"span":h.is(".month")?(d=h.parent().find("span").index(h),i.viewDate.month(d)):(e=parseInt(h.text(),10)||0,i.viewDate.year(e)),i.viewMode===i.minViewMode&&(i.date=b({y:i.viewDate.year(),M:i.viewDate.month(),d:i.viewDate.date(),h:i.date.hours(),m:i.date.minutes(),s:i.date.seconds()}),K(),o(j,c.type)),E(-1),t();break;case"td":h.is(".day")&&(g=parseInt(h.text(),10)||1,d=i.viewDate.month(),e=i.viewDate.year(),h.is(".old")?0===d?(d=11,e-=1):d-=1:h.is(".new")&&(11===d?(d=0,e+=1):d+=1),i.date=b({y:e,M:d,d:g,h:i.date.hours(),m:i.date.minutes(),s:i.date.seconds()}),i.viewDate=b({y:e,M:d,d:Math.min(28,g)}),t(),K(),o(j,c.type))}},z={incrementHours:function(){L("add","hours",1)},incrementMinutes:function(){L("add","minutes",i.options.minuteStepping)},incrementSeconds:function(){L("add","seconds",1)},decrementHours:function(){L("subtract","hours",1)},decrementMinutes:function(){L("subtract","minutes",i.options.minuteStepping)},decrementSeconds:function(){L("s
 ubtract","seconds",1)},togglePeriod:function(){var a=i.date.hours();a>=12?a-=12:a+=12,i.date.hours(a)},showPicker:function(){i.widget.find(".timepicker > div:not(.timepicker-picker)").hide(),i.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){i.widget.find(".timepicker .timepicker-picker").hide(),i.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){i.widget.find(".timepicker .timepicker-picker").hide(),i.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){i.widget.find(".timepicker .timepicker-picker").hide(),i.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(b){var c=parseInt(a(b.target).text(),10);i.use24hours||(i.date.hours()>=12?12!==c&&(c+=12):12===c&&(c=0)),i.date.hours(c),z.showPicker.call(i)},selectMinute:function(b){i.date.minutes(parseInt(a(b.target).text(),10)),z.showPicker.call(i)},selectSecond:function(b){i.date.seconds(parseInt(a(b.target).text(),10)),z.showPicker.call
 (i)}},A=function(c){var d=b(i.date),e=a(c.currentTarget).data("action"),f=z[e].apply(i,arguments);return B(c),i.date||(i.date=b({y:1970})),K(),x(),o(d,c.type),f},B=function(a){a.stopPropagation(),a.preventDefault()},C=function(a){27===a.keyCode&&i.hide()},D=function(c){b.locale(i.options.language);var d=a(c.target),e=b(i.date),f=b(d.val(),i.format,i.options.useStrict);f.isValid()&&!M(f)&&N(f)?(q(),i.setValue(f),o(e,c.type),K()):(i.viewDate=e,i.unset=!0,o(e,c.type),p(f))},E=function(a){a&&(i.viewMode=Math.max(i.minViewMode,Math.min(2,i.viewMode+a))),i.widget.find(".datepicker > div").hide().filter(".datepicker-"+R.modes[i.viewMode].clsName).show()},F=function(){var b,c,d,e,f;i.widget.on("click",".datepicker *",a.proxy(y,this)),i.widget.on("click","[data-action]",a.proxy(A,this)),i.widget.on("mousedown",a.proxy(B,this)),i.element.on("keydown",a.proxy(C,this)),i.options.pickDate&&i.options.pickTime&&i.widget.on("click.togglePicker",".accordion-toggle",function(g){if(g.stopPropagation()
 ,b=a(this),c=b.closest("ul"),d=c.find(".in"),e=c.find(".collapse:not(.in)"),d&&d.length){if(f=d.data("collapse"),f&&f.transitioning)return;d.collapse("hide"),e.collapse("show"),b.find("span").toggleClass(i.options.icons.time+" "+i.options.icons.date),i.component&&i.component.find("span").toggleClass(i.options.icons.time+" "+i.options.icons.date)}}),i.isInput?i.element.on({click:a.proxy(i.show,this),focus:a.proxy(i.show,this),change:a.proxy(D,this),blur:a.proxy(i.hide,this)}):(i.element.on({change:a.proxy(D,this)},"input"),i.component?(i.component.on("click",a.proxy(i.show,this)),i.component.on("mousedown",a.proxy(B,this))):i.element.on("click",a.proxy(i.show,this)))},G=function(){a(window).on("resize.datetimepicker"+i.id,a.proxy(n,this)),i.isInput||a(document).on("mousedown.datetimepicker"+i.id,a.proxy(i.hide,this))},H=function(){i.widget.off("click",".datepicker *",i.click),i.widget.off("click","[data-action]"),i.widget.off("mousedown",i.stopEvent),i.options.pickDate&&i.options.pic
 kTime&&i.widget.off("click.togglePicker"),i.isInput?i.element.off({focus:i.show,change:D,click:i.show,blur:i.hide}):(i.element.off({change:D},"input"),i.component?(i.component.off("click",i.show),i.component.off("mousedown",i.stopEvent)):i.element.off("click",i.show))},I=function(){a(window).off("resize.datetimepicker"+i.id),i.isInput||a(document).off("mousedown.datetimepicker"+i.id)},J=function(){if(i.element){var b,c=i.element.parents(),d=!1;for(b=0;b<c.length;b++)if("fixed"===a(c[b]).css("position")){d=!0;break}return d}return!1},K=function(){b.locale(i.options.language);var a="";i.unset||(a=b(i.date).format(i.format)),l().val(a),i.element.data("date",a),i.options.pickTime||i.hide()},L=function(a,c,d){b.locale(i.options.language);var e;return"add"===a?(e=b(i.date),23===e.hours()&&e.add(d,c),e.add(d,c)):e=b(i.date).subtract(d,c),M(b(e.subtract(d,c)))||M(e)?void p(e.format(i.format)):("add"===a?i.date.add(d,c):i.date.subtract(d,c),void(i.unset=!1))},M=function(a,c){b.locale(i.optio
 ns.language);var d=b(i.options.maxDate,i.format,i.options.useStrict),e=b(i.options.minDate,i.format,i.options.useStrict);return c&&(d=d.endOf(c),e=e.startOf(c)),a.isAfter(d)||a.isBefore(e)?!0:i.options.disabledDates===!1?!1:i.options.disabledDates[a.format("YYYY-MM-DD")]===!0},N=function(a){return b.locale(i.options.language),i.options.enabledDates===!1?!0:i.options.enabledDates[a.format("YYYY-MM-DD")]===!0},O=function(a){var c,d={},e=0;for(c=0;c<a.length;c++)f=b.isMoment(a[c])||a[c]instanceof Date?b(a[c]):b(a[c],i.format,i.options.useStrict),f.isValid()&&(d[f.format("YYYY-MM-DD")]=!0,e++);return e>0?d:!1},P=function(a){return a=a.toString(),a.length>=2?a:"0"+a},Q=function(){var a='<thead><tr><th class="prev">&lsaquo;</th><th colspan="'+(i.options.calendarWeeks?"6":"5")+'" class="picker-switch"></th><th class="next">&rsaquo;</th></tr></thead>',b='<tbody><tr><td colspan="'+(i.options.calendarWeeks?"8":"7")+'"></td></tr></tbody>',c='<div class="datepicker-days"><table class="table-con
 densed">'+a+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+a+b+'</table></div><div class="datepicker-years"><table class="table-condensed">'+a+b+"</table></div>",d="";return i.options.pickDate&&i.options.pickTime?(d='<div class="bootstrap-datetimepicker-widget'+(i.options.sideBySide?" timepicker-sbs":"")+(i.use24hours?" usetwentyfour":"")+' dropdown-menu" style="z-index:9999 !important;">',d+=i.options.sideBySide?'<div class="row"><div class="col-sm-6 datepicker">'+c+'</div><div class="col-sm-6 timepicker">'+S.getTemplate()+"</div></div>":'<ul class="list-unstyled"><li'+(i.options.collapse?' class="collapse in"':"")+'><div class="datepicker">'+c+'</div></li><li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="'+i.options.icons.time+'"></span></a></li><li'+(i.options.collapse?' class="collapse"':"")+'><div class="timepicker">'+S.getTemplate()+"</div></li></ul>",d+="</div>"):i.options.pickTime?'<div cl
 ass="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker">'+S.getTemplate()+"</div></div>":'<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker">'+c+"</div></div>"},R={modes:[{clsName:"days",navFnc:"month",navStep:1},{clsName:"months",navFnc:"year",navStep:1},{clsName:"years",navFnc:"year",navStep:10}]},S={hourTemplate:'<span data-action="showHours"   data-time-component="hours"   class="timepicker-hour"></span>',minuteTemplate:'<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',secondTemplate:'<span data-action="showSeconds"  data-time-component="seconds" class="timepicker-second"></span>'};S.getTemplate=function(){return'<div class="timepicker-picker"><table class="table-condensed"><tr><td><a href="#" class="btn" data-action="incrementHours"><span class="'+i.options.icons.up+'"></span></a></td><td class="separator"></td><td>'+(i.options.useMinutes?'<a href="#" class="btn" data-action="inc
 rementMinutes"><span class="'+i.options.icons.up+'"></span></a>':"")+"</td>"+(i.options.useSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="'+i.options.icons.up+'"></span></a></td>':"")+(i.use24hours?"":'<td class="separator"></td>')+"</tr><tr><td>"+S.hourTemplate+'</td> <td class="separator">:</td><td>'+(i.options.useMinutes?S.minuteTemplate:'<span class="timepicker-minute">00</span>')+"</td> "+(i.options.useSeconds?'<td class="separator">:</td><td>'+S.secondTemplate+"</td>":"")+(i.use24hours?"":'<td class="separator"></td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>')+'</tr><tr><td><a href="#" class="btn" data-action="decrementHours"><span class="'+i.options.icons.down+'"></span></a></td><td class="separator"></td><td>'+(i.options.useMinutes?'<a href="#" class="btn" data-action="decrementMinutes"><span class="'+i.options.icons.down+'"></span></a>':"")+"</td>"+(i.options.useSec
 onds?'<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="'+i.options.icons.down+'"></span></a></td>':"")+(i.use24hours?"":'<td class="separator"></td>')+'</tr></table></div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"></table></div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"></table></div>'+(i.options.useSeconds?'<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>':"")},i.destroy=function(){H(),I(),i.widget.remove(),i.element.removeData("DateTimePicker"),i.component&&i.component.removeData("DateTimePicker")},i.show=function(a){if(!l().prop("disabled")){if(i.options.useCurrent&&""===l().val()){if(1!==i.options.minuteStepping){var c=b(),d=i.options.minuteStepping;c.minutes(Math.round(c.minutes()/d)*d%60).seconds(0),i.setValue(c.format(i.format))}else i.setValue(b().format(i.format));o("",a.type)}a&&"
 click"===a.type&&i.isInput&&i.widget.hasClass("picker-open")||(i.widget.hasClass("picker-open")?(i.widget.hide(),i.widget.removeClass("picker-open")):(i.widget.show(),i.widget.addClass("picker-open")),i.height=i.component?i.component.outerHeight():i.element.outerHeight(),n(),i.element.trigger({type:"dp.show",date:b(i.date)}),G(),a&&B(a))}},i.disable=function(){var a=l();a.prop("disabled")||(a.prop("disabled",!0),H())},i.enable=function(){var a=l();a.prop("disabled")&&(a.prop("disabled",!1),F())},i.hide=function(){var a,c,d=i.widget.find(".collapse");for(a=0;a<d.length;a++)if(c=d.eq(a).data("collapse"),c&&c.transitioning)return;i.widget.hide(),i.widget.removeClass("picker-open"),i.viewMode=i.startViewMode,E(),i.element.trigger({type:"dp.hide",date:b(i.date)}),I()},i.setValue=function(a){b.locale(i.options.language),a?i.unset=!1:(i.unset=!0,K()),a=b.isMoment(a)?a.locale(i.options.language):a instanceof Date?b(a):b(a,i.format,i.options.useStrict),a.isValid()?(i.date=a,K(),i.viewDate=b(
 {y:i.date.year(),M:i.date.month()}),t(),x()):p(a)},i.getDate=function(){return i.unset?null:b(i.date)},i.setDate=function(a){var c=b(i.date);i.setValue(a?a:null),o(c,"function")},i.setDisabledDates=function(a){i.options.disabledDates=O(a),i.viewDate&&q()},i.setEnabledDates=function(a){i.options.enabledDates=O(a),i.viewDate&&q()},i.setMaxDate=function(a){void 0!==a&&(i.options.maxDate=b.isMoment(a)||a instanceof Date?b(a):b(a,i.format,i.options.useStrict),i.viewDate&&q())},i.setMinDate=function(a){void 0!==a&&(i.options.minDate=b.isMoment(a)||a instanceof Date?b(a):b(a,i.format,i.options.useStrict),i.viewDate&&q())},k()};a.fn.datetimepicker=function(b){return this.each(function(){var c=a(this),e=c.data("DateTimePicker");e||c.data("DateTimePicker",new d(this,b))})},a.fn.datetimepicker.defaults={format:!1,pickDate:!0,pickTime:!0,useMinutes:!0,useSeconds:!1,useCurrent:!0,calendarWeeks:!1,minuteStepping:1,minDate:b({y:1900}),maxDate:b().add(100,"y"),showToday:!0,collapse:!0,language:b.lo
 cale(),defaultDate:"",disabledDates:!1,enabledDates:!1,icons:{},useStrict:!1,direction:"auto",sideBySide:!1,daysOfWeekDisabled:[],widgetParent:!1}});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a790190/public/js/datetimepicker.js
----------------------------------------------------------------------
diff --git a/public/js/datetimepicker.js b/public/js/datetimepicker.js
deleted file mode 100644
index cdba4b1..0000000
--- a/public/js/datetimepicker.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(a,b){"use strict";if("function"==typeof define&&define.amd)define(["jquery","moment"],b);else if("object"==typeof exports)b(require("jquery"),require("moment"));else{if(!jQuery)throw new Error("bootstrap-datetimepicker requires jQuery to be loaded first");if(!moment)throw new Error("bootstrap-datetimepicker requires moment.js to be loaded first");b(a.jQuery,moment)}}(this,function(a,b){"use strict";if("undefined"==typeof b)throw new Error("momentjs is required");var c=0,d=function(d,e){var f,g=a.fn.datetimepicker.defaults,h={time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},i=this,j=!1,k=function(){var f,j,k=!1;if(i.options=a.extend({},g,e),i.options.icons=a.extend({},h,i.options.icons),i.element=a(d),m(),!i.options.pickTime&&!i.options.pickDate)throw new Error("Must choose at least one picker");if(i.id=c++,b.locale(i.options.language),i.date=b(),i.unset=!1,i.isInput=i.element.is
 ("input"),i.component=!1,i.element.hasClass("input-group")&&(i.component=i.element.find(0===i.element.find(".datepickerbutton").size()?'[class^="input-group-"]':".datepickerbutton")),i.format=i.options.format,f=b().localeData(),i.format||(i.format=i.options.pickDate?f.longDateFormat("L"):"",i.options.pickDate&&i.options.pickTime&&(i.format+=" "),i.format+=i.options.pickTime?f.longDateFormat("LT"):"",i.options.useSeconds&&(-1!==f.longDateFormat("LT").indexOf(" A")?i.format=i.format.split(" A")[0]+":ss A":i.format+=":ss")),i.use24hours=i.format.toLowerCase().indexOf("a")<0&&i.format.indexOf("h")<0,i.component&&(k=i.component.find("span")),i.options.pickTime&&k&&k.addClass(i.options.icons.time),i.options.pickDate&&k&&(k.removeClass(i.options.icons.time),k.addClass(i.options.icons.date)),i.options.widgetParent="string"==typeof i.options.widgetParent&&i.options.widgetParent||i.element.parents().filter(function(){return"scroll"===a(this).css("overflow-y")}).get(0)||"body",i.widget=a(Q()).
 appendTo(i.options.widgetParent),i.minViewMode=i.options.minViewMode||0,"string"==typeof i.minViewMode)switch(i.minViewMode){case"months":i.minViewMode=1;break;case"years":i.minViewMode=2;break;default:i.minViewMode=0}if(i.viewMode=i.options.viewMode||0,"string"==typeof i.viewMode)switch(i.viewMode){case"months":i.viewMode=1;break;case"years":i.viewMode=2;break;default:i.viewMode=0}i.viewMode=Math.max(i.viewMode,i.minViewMode),i.options.disabledDates=O(i.options.disabledDates),i.options.enabledDates=O(i.options.enabledDates),i.startViewMode=i.viewMode,i.setMinDate(i.options.minDate),i.setMaxDate(i.options.maxDate),r(),s(),u(),v(),w(),q(),E(),l().prop("disabled")||F(),""!==i.options.defaultDate&&""===l().val()&&i.setValue(i.options.defaultDate),1!==i.options.minuteStepping&&(j=i.options.minuteStepping,i.date.minutes(Math.round(i.date.minutes()/j)*j%60).seconds(0))},l=function(){var a;if(i.isInput)return i.element;if(a=i.element.find(".datepickerinput"),0===a.size())a=i.element.find("
 input");else if(!a.is("input"))throw new Error('CSS class "datepickerinput" cannot be applied to non input element');return a},m=function(){var a;a=i.element.is("input")?i.element.data():i.element.find("input").data(),void 0!==a.dateFormat&&(i.options.format=a.dateFormat),void 0!==a.datePickdate&&(i.options.pickDate=a.datePickdate),void 0!==a.datePicktime&&(i.options.pickTime=a.datePicktime),void 0!==a.dateUseminutes&&(i.options.useMinutes=a.dateUseminutes),void 0!==a.dateUseseconds&&(i.options.useSeconds=a.dateUseseconds),void 0!==a.dateUsecurrent&&(i.options.useCurrent=a.dateUsecurrent),void 0!==a.calendarWeeks&&(i.options.calendarWeeks=a.calendarWeeks),void 0!==a.dateMinutestepping&&(i.options.minuteStepping=a.dateMinutestepping),void 0!==a.dateMindate&&(i.options.minDate=a.dateMindate),void 0!==a.dateMaxdate&&(i.options.maxDate=a.dateMaxdate),void 0!==a.dateShowtoday&&(i.options.showToday=a.dateShowtoday),void 0!==a.dateCollapse&&(i.options.collapse=a.dateCollapse),void 0!==a.da
 teLanguage&&(i.options.language=a.dateLanguage),void 0!==a.dateDefaultdate&&(i.options.defaultDate=a.dateDefaultdate),void 0!==a.dateDisableddates&&(i.options.disabledDates=a.dateDisableddates),void 0!==a.dateEnableddates&&(i.options.enabledDates=a.dateEnableddates),void 0!==a.dateIcons&&(i.options.icons=a.dateIcons),void 0!==a.dateUsestrict&&(i.options.useStrict=a.dateUsestrict),void 0!==a.dateDirection&&(i.options.direction=a.dateDirection),void 0!==a.dateSidebyside&&(i.options.sideBySide=a.dateSidebyside),void 0!==a.dateDaysofweekdisabled&&(i.options.daysOfWeekDisabled=a.dateDaysofweekdisabled)},n=function(){var b,c="absolute",d=i.component?i.component.offset():i.element.offset(),e=a(window);i.width=i.component?i.component.outerWidth():i.element.outerWidth(),d.top=d.top+i.element.outerHeight(),"up"===i.options.direction?b="top":"bottom"===i.options.direction?b="bottom":"auto"===i.options.direction&&(b=d.top+i.widget.height()>e.height()+e.scrollTop()&&i.widget.height()+i.element.o
 uterHeight()<d.top?"top":"bottom"),"top"===b?(d.bottom=e.height()-d.top+i.element.outerHeight()+3,i.widget.addClass("top").removeClass("bottom")):(d.top+=1,i.widget.addClass("bottom").removeClass("top")),void 0!==i.options.width&&i.widget.width(i.options.width),"left"===i.options.orientation&&(i.widget.addClass("left-oriented"),d.left=d.left-i.widget.width()+20),J()&&(c="fixed",d.top-=e.scrollTop(),d.left-=e.scrollLeft()),e.width()<d.left+i.widget.outerWidth()?(d.right=e.width()-d.left-i.width,d.left="auto",i.widget.addClass("pull-right")):(d.right="auto",i.widget.removeClass("pull-right")),i.widget.css("top"===b?{position:c,bottom:d.bottom,top:"auto",left:d.left,right:d.right}:{position:c,top:d.top,bottom:"auto",left:d.left,right:d.right})},o=function(a,c){(!b(i.date).isSame(b(a))||j)&&(j=!1,i.element.trigger({type:"dp.change",date:b(i.date),oldDate:b(a)}),"change"!==c&&i.element.change())},p=function(a){j=!0,i.element.trigger({type:"dp.error",date:b(a,i.format,i.options.useStrict)
 })},q=function(a){b.locale(i.options.language);var c=a;c||(c=l().val(),c&&(i.date=b(c,i.format,i.options.useStrict)),i.date||(i.date=b())),i.viewDate=b(i.date).startOf("month"),t(),x()},r=function(){b.locale(i.options.language);var c,d=a("<tr>"),e=b.weekdaysMin();if(i.options.calendarWeeks===!0&&d.append('<th class="cw">#</th>'),0===b().localeData()._week.dow)for(c=0;7>c;c++)d.append('<th class="dow">'+e[c]+"</th>");else for(c=1;8>c;c++)d.append(7===c?'<th class="dow">'+e[0]+"</th>":'<th class="dow">'+e[c]+"</th>");i.widget.find(".datepicker-days thead").append(d)},s=function(){b.locale(i.options.language);var a,c="",d=b.monthsShort();for(a=0;12>a;a++)c+='<span class="month">'+d[a]+"</span>";i.widget.find(".datepicker-months td").append(c)},t=function(){if(i.options.pickDate){b.locale(i.options.language);var c,d,e,f,g,h,j,k,l,m=i.viewDate.year(),n=i.viewDate.month(),o=i.options.minDate.year(),p=i.options.minDate.month(),q=i.options.maxDate.year(),r=i.options.maxDate.month(),s=[],t=b
 .months();for(i.widget.find(".datepicker-days").find(".disabled").removeClass("disabled"),i.widget.find(".datepicker-months").find(".disabled").removeClass("disabled"),i.widget.find(".datepicker-years").find(".disabled").removeClass("disabled"),i.widget.find(".datepicker-days th:eq(1)").text(t[n]+" "+m),d=b(i.viewDate,i.format,i.options.useStrict).subtract(1,"months"),j=d.daysInMonth(),d.date(j).startOf("week"),(m===o&&p>=n||o>m)&&i.widget.find(".datepicker-days th:eq(0)").addClass("disabled"),(m===q&&n>=r||m>q)&&i.widget.find(".datepicker-days th:eq(2)").addClass("disabled"),e=b(d).add(42,"d");d.isBefore(e);){if(d.weekday()===b().startOf("week").weekday()&&(f=a("<tr>"),s.push(f),i.options.calendarWeeks===!0&&f.append('<td class="cw">'+d.week()+"</td>")),g="",d.year()<m||d.year()===m&&d.month()<n?g+=" old":(d.year()>m||d.year()===m&&d.month()>n)&&(g+=" new"),d.isSame(b({y:i.date.year(),M:i.date.month(),d:i.date.date()}))&&(g+=" active"),(M(d,"day")||!N(d))&&(g+=" disabled"),i.option
 s.showToday===!0&&d.isSame(b(),"day")&&(g+=" today"),i.options.daysOfWeekDisabled)for(h=0;h<i.options.daysOfWeekDisabled.length;h++)if(d.day()===i.options.daysOfWeekDisabled[h]){g+=" disabled";break}f.append('<td class="day'+g+'">'+d.date()+"</td>"),c=d.date(),d.add(1,"d"),c===d.date()&&d.add(1,"d")}for(i.widget.find(".datepicker-days tbody").empty().append(s),l=i.date.year(),t=i.widget.find(".datepicker-months").find("th:eq(1)").text(m).end().find("span").removeClass("active"),l===m&&t.eq(i.date.month()).addClass("active"),o>m-1&&i.widget.find(".datepicker-months th:eq(0)").addClass("disabled"),m+1>q&&i.widget.find(".datepicker-months th:eq(2)").addClass("disabled"),h=0;12>h;h++)m===o&&p>h||o>m?a(t[h]).addClass("disabled"):(m===q&&h>r||m>q)&&a(t[h]).addClass("disabled");for(s="",m=10*parseInt(m/10,10),k=i.widget.find(".datepicker-years").find("th:eq(1)").text(m+"-"+(m+9)).parents("table").find("td"),i.widget.find(".datepicker-years").find("th").removeClass("disabled"),o>m&&i.widget
 .find(".datepicker-years").find("th:eq(0)").addClass("disabled"),m+9>q&&i.widget.find(".datepicker-years").find("th:eq(2)").addClass("disabled"),m-=1,h=-1;11>h;h++)s+='<span class="year'+(-1===h||10===h?" old":"")+(l===m?" active":"")+(o>m||m>q?" disabled":"")+'">'+m+"</span>",m+=1;k.html(s)}},u=function(){b.locale(i.options.language);var a,c,d,e=i.widget.find(".timepicker .timepicker-hours table"),f="";if(e.parent().hide(),i.use24hours)for(a=0,c=0;6>c;c+=1){for(f+="<tr>",d=0;4>d;d+=1)f+='<td class="hour">'+P(a.toString())+"</td>",a++;f+="</tr>"}else for(a=1,c=0;3>c;c+=1){for(f+="<tr>",d=0;4>d;d+=1)f+='<td class="hour">'+P(a.toString())+"</td>",a++;f+="</tr>"}e.html(f)},v=function(){var a,b,c=i.widget.find(".timepicker .timepicker-minutes table"),d="",e=0,f=i.options.minuteStepping;for(c.parent().hide(),1===f&&(f=5),a=0;a<Math.ceil(60/f/4);a++){for(d+="<tr>",b=0;4>b;b+=1)60>e?(d+='<td class="minute">'+P(e.toString())+"</td>",e+=f):d+="<td></td>";d+="</tr>"}c.html(d)},w=function(){va
 r a,b,c=i.widget.find(".timepicker .timepicker-seconds table"),d="",e=0;for(c.parent().hide(),a=0;3>a;a++){for(d+="<tr>",b=0;4>b;b+=1)d+='<td class="second">'+P(e.toString())+"</td>",e+=5;d+="</tr>"}c.html(d)},x=function(){if(i.date){var a=i.widget.find(".timepicker span[data-time-component]"),b=i.date.hours(),c=i.date.format("A");i.use24hours||(0===b?b=12:12!==b&&(b%=12),i.widget.find(".timepicker [data-action=togglePeriod]").text(c)),a.filter("[data-time-component=hours]").text(P(b)),a.filter("[data-time-component=minutes]").text(P(i.date.minutes())),a.filter("[data-time-component=seconds]").text(P(i.date.second()))}},y=function(c){c.stopPropagation(),c.preventDefault(),i.unset=!1;var d,e,f,g,h=a(c.target).closest("span, td, th"),j=b(i.date);if(1===h.length&&!h.is(".disabled"))switch(h[0].nodeName.toLowerCase()){case"th":switch(h[0].className){case"picker-switch":E(1);break;case"prev":case"next":f=R.modes[i.viewMode].navStep,"prev"===h[0].className&&(f=-1*f),i.viewDate.add(f,R.mod
 es[i.viewMode].navFnc),t()}break;case"span":h.is(".month")?(d=h.parent().find("span").index(h),i.viewDate.month(d)):(e=parseInt(h.text(),10)||0,i.viewDate.year(e)),i.viewMode===i.minViewMode&&(i.date=b({y:i.viewDate.year(),M:i.viewDate.month(),d:i.viewDate.date(),h:i.date.hours(),m:i.date.minutes(),s:i.date.seconds()}),K(),o(j,c.type)),E(-1),t();break;case"td":h.is(".day")&&(g=parseInt(h.text(),10)||1,d=i.viewDate.month(),e=i.viewDate.year(),h.is(".old")?0===d?(d=11,e-=1):d-=1:h.is(".new")&&(11===d?(d=0,e+=1):d+=1),i.date=b({y:e,M:d,d:g,h:i.date.hours(),m:i.date.minutes(),s:i.date.seconds()}),i.viewDate=b({y:e,M:d,d:Math.min(28,g)}),t(),K(),o(j,c.type))}},z={incrementHours:function(){L("add","hours",1)},incrementMinutes:function(){L("add","minutes",i.options.minuteStepping)},incrementSeconds:function(){L("add","seconds",1)},decrementHours:function(){L("subtract","hours",1)},decrementMinutes:function(){L("subtract","minutes",i.options.minuteStepping)},decrementSeconds:function(){L("s
 ubtract","seconds",1)},togglePeriod:function(){var a=i.date.hours();a>=12?a-=12:a+=12,i.date.hours(a)},showPicker:function(){i.widget.find(".timepicker > div:not(.timepicker-picker)").hide(),i.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){i.widget.find(".timepicker .timepicker-picker").hide(),i.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){i.widget.find(".timepicker .timepicker-picker").hide(),i.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){i.widget.find(".timepicker .timepicker-picker").hide(),i.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(b){var c=parseInt(a(b.target).text(),10);i.use24hours||(i.date.hours()>=12?12!==c&&(c+=12):12===c&&(c=0)),i.date.hours(c),z.showPicker.call(i)},selectMinute:function(b){i.date.minutes(parseInt(a(b.target).text(),10)),z.showPicker.call(i)},selectSecond:function(b){i.date.seconds(parseInt(a(b.target).text(),10)),z.showPicker.call
 (i)}},A=function(c){var d=b(i.date),e=a(c.currentTarget).data("action"),f=z[e].apply(i,arguments);return B(c),i.date||(i.date=b({y:1970})),K(),x(),o(d,c.type),f},B=function(a){a.stopPropagation(),a.preventDefault()},C=function(a){27===a.keyCode&&i.hide()},D=function(c){b.locale(i.options.language);var d=a(c.target),e=b(i.date),f=b(d.val(),i.format,i.options.useStrict);f.isValid()&&!M(f)&&N(f)?(q(),i.setValue(f),o(e,c.type),K()):(i.viewDate=e,i.unset=!0,o(e,c.type),p(f))},E=function(a){a&&(i.viewMode=Math.max(i.minViewMode,Math.min(2,i.viewMode+a))),i.widget.find(".datepicker > div").hide().filter(".datepicker-"+R.modes[i.viewMode].clsName).show()},F=function(){var b,c,d,e,f;i.widget.on("click",".datepicker *",a.proxy(y,this)),i.widget.on("click","[data-action]",a.proxy(A,this)),i.widget.on("mousedown",a.proxy(B,this)),i.element.on("keydown",a.proxy(C,this)),i.options.pickDate&&i.options.pickTime&&i.widget.on("click.togglePicker",".accordion-toggle",function(g){if(g.stopPropagation()
 ,b=a(this),c=b.closest("ul"),d=c.find(".in"),e=c.find(".collapse:not(.in)"),d&&d.length){if(f=d.data("collapse"),f&&f.transitioning)return;d.collapse("hide"),e.collapse("show"),b.find("span").toggleClass(i.options.icons.time+" "+i.options.icons.date),i.component&&i.component.find("span").toggleClass(i.options.icons.time+" "+i.options.icons.date)}}),i.isInput?i.element.on({click:a.proxy(i.show,this),focus:a.proxy(i.show,this),change:a.proxy(D,this),blur:a.proxy(i.hide,this)}):(i.element.on({change:a.proxy(D,this)},"input"),i.component?(i.component.on("click",a.proxy(i.show,this)),i.component.on("mousedown",a.proxy(B,this))):i.element.on("click",a.proxy(i.show,this)))},G=function(){a(window).on("resize.datetimepicker"+i.id,a.proxy(n,this)),i.isInput||a(document).on("mousedown.datetimepicker"+i.id,a.proxy(i.hide,this))},H=function(){i.widget.off("click",".datepicker *",i.click),i.widget.off("click","[data-action]"),i.widget.off("mousedown",i.stopEvent),i.options.pickDate&&i.options.pic
 kTime&&i.widget.off("click.togglePicker"),i.isInput?i.element.off({focus:i.show,change:D,click:i.show,blur:i.hide}):(i.element.off({change:D},"input"),i.component?(i.component.off("click",i.show),i.component.off("mousedown",i.stopEvent)):i.element.off("click",i.show))},I=function(){a(window).off("resize.datetimepicker"+i.id),i.isInput||a(document).off("mousedown.datetimepicker"+i.id)},J=function(){if(i.element){var b,c=i.element.parents(),d=!1;for(b=0;b<c.length;b++)if("fixed"===a(c[b]).css("position")){d=!0;break}return d}return!1},K=function(){b.locale(i.options.language);var a="";i.unset||(a=b(i.date).format(i.format)),l().val(a),i.element.data("date",a),i.options.pickTime||i.hide()},L=function(a,c,d){b.locale(i.options.language);var e;return"add"===a?(e=b(i.date),23===e.hours()&&e.add(d,c),e.add(d,c)):e=b(i.date).subtract(d,c),M(b(e.subtract(d,c)))||M(e)?void p(e.format(i.format)):("add"===a?i.date.add(d,c):i.date.subtract(d,c),void(i.unset=!1))},M=function(a,c){b.locale(i.optio
 ns.language);var d=b(i.options.maxDate,i.format,i.options.useStrict),e=b(i.options.minDate,i.format,i.options.useStrict);return c&&(d=d.endOf(c),e=e.startOf(c)),a.isAfter(d)||a.isBefore(e)?!0:i.options.disabledDates===!1?!1:i.options.disabledDates[a.format("YYYY-MM-DD")]===!0},N=function(a){return b.locale(i.options.language),i.options.enabledDates===!1?!0:i.options.enabledDates[a.format("YYYY-MM-DD")]===!0},O=function(a){var c,d={},e=0;for(c=0;c<a.length;c++)f=b.isMoment(a[c])||a[c]instanceof Date?b(a[c]):b(a[c],i.format,i.options.useStrict),f.isValid()&&(d[f.format("YYYY-MM-DD")]=!0,e++);return e>0?d:!1},P=function(a){return a=a.toString(),a.length>=2?a:"0"+a},Q=function(){var a='<thead><tr><th class="prev">&lsaquo;</th><th colspan="'+(i.options.calendarWeeks?"6":"5")+'" class="picker-switch"></th><th class="next">&rsaquo;</th></tr></thead>',b='<tbody><tr><td colspan="'+(i.options.calendarWeeks?"8":"7")+'"></td></tr></tbody>',c='<div class="datepicker-days"><table class="table-con
 densed">'+a+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+a+b+'</table></div><div class="datepicker-years"><table class="table-condensed">'+a+b+"</table></div>",d="";return i.options.pickDate&&i.options.pickTime?(d='<div class="bootstrap-datetimepicker-widget'+(i.options.sideBySide?" timepicker-sbs":"")+(i.use24hours?" usetwentyfour":"")+' dropdown-menu" style="z-index:9999 !important;">',d+=i.options.sideBySide?'<div class="row"><div class="col-sm-6 datepicker">'+c+'</div><div class="col-sm-6 timepicker">'+S.getTemplate()+"</div></div>":'<ul class="list-unstyled"><li'+(i.options.collapse?' class="collapse in"':"")+'><div class="datepicker">'+c+'</div></li><li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="'+i.options.icons.time+'"></span></a></li><li'+(i.options.collapse?' class="collapse"':"")+'><div class="timepicker">'+S.getTemplate()+"</div></li></ul>",d+="</div>"):i.options.pickTime?'<div cl
 ass="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker">'+S.getTemplate()+"</div></div>":'<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker">'+c+"</div></div>"},R={modes:[{clsName:"days",navFnc:"month",navStep:1},{clsName:"months",navFnc:"year",navStep:1},{clsName:"years",navFnc:"year",navStep:10}]},S={hourTemplate:'<span data-action="showHours"   data-time-component="hours"   class="timepicker-hour"></span>',minuteTemplate:'<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',secondTemplate:'<span data-action="showSeconds"  data-time-component="seconds" class="timepicker-second"></span>'};S.getTemplate=function(){return'<div class="timepicker-picker"><table class="table-condensed"><tr><td><a href="#" class="btn" data-action="incrementHours"><span class="'+i.options.icons.up+'"></span></a></td><td class="separator"></td><td>'+(i.options.useMinutes?'<a href="#" class="btn" data-action="inc
 rementMinutes"><span class="'+i.options.icons.up+'"></span></a>':"")+"</td>"+(i.options.useSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="'+i.options.icons.up+'"></span></a></td>':"")+(i.use24hours?"":'<td class="separator"></td>')+"</tr><tr><td>"+S.hourTemplate+'</td> <td class="separator">:</td><td>'+(i.options.useMinutes?S.minuteTemplate:'<span class="timepicker-minute">00</span>')+"</td> "+(i.options.useSeconds?'<td class="separator">:</td><td>'+S.secondTemplate+"</td>":"")+(i.use24hours?"":'<td class="separator"></td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>')+'</tr><tr><td><a href="#" class="btn" data-action="decrementHours"><span class="'+i.options.icons.down+'"></span></a></td><td class="separator"></td><td>'+(i.options.useMinutes?'<a href="#" class="btn" data-action="decrementMinutes"><span class="'+i.options.icons.down+'"></span></a>':"")+"</td>"+(i.options.useSec
 onds?'<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="'+i.options.icons.down+'"></span></a></td>':"")+(i.use24hours?"":'<td class="separator"></td>')+'</tr></table></div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"></table></div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"></table></div>'+(i.options.useSeconds?'<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>':"")},i.destroy=function(){H(),I(),i.widget.remove(),i.element.removeData("DateTimePicker"),i.component&&i.component.removeData("DateTimePicker")},i.show=function(a){if(!l().prop("disabled")){if(i.options.useCurrent&&""===l().val()){if(1!==i.options.minuteStepping){var c=b(),d=i.options.minuteStepping;c.minutes(Math.round(c.minutes()/d)*d%60).seconds(0),i.setValue(c.format(i.format))}else i.setValue(b().format(i.format));o("",a.type)}a&&"
 click"===a.type&&i.isInput&&i.widget.hasClass("picker-open")||(i.widget.hasClass("picker-open")?(i.widget.hide(),i.widget.removeClass("picker-open")):(i.widget.show(),i.widget.addClass("picker-open")),i.height=i.component?i.component.outerHeight():i.element.outerHeight(),n(),i.element.trigger({type:"dp.show",date:b(i.date)}),G(),a&&B(a))}},i.disable=function(){var a=l();a.prop("disabled")||(a.prop("disabled",!0),H())},i.enable=function(){var a=l();a.prop("disabled")&&(a.prop("disabled",!1),F())},i.hide=function(){var a,c,d=i.widget.find(".collapse");for(a=0;a<d.length;a++)if(c=d.eq(a).data("collapse"),c&&c.transitioning)return;i.widget.hide(),i.widget.removeClass("picker-open"),i.viewMode=i.startViewMode,E(),i.element.trigger({type:"dp.hide",date:b(i.date)}),I()},i.setValue=function(a){b.locale(i.options.language),a?i.unset=!1:(i.unset=!0,K()),a=b.isMoment(a)?a.locale(i.options.language):a instanceof Date?b(a):b(a,i.format,i.options.useStrict),a.isValid()?(i.date=a,K(),i.viewDate=b(
 {y:i.date.year(),M:i.date.month()}),t(),x()):p(a)},i.getDate=function(){return i.unset?null:b(i.date)},i.setDate=function(a){var c=b(i.date);i.setValue(a?a:null),o(c,"function")},i.setDisabledDates=function(a){i.options.disabledDates=O(a),i.viewDate&&q()},i.setEnabledDates=function(a){i.options.enabledDates=O(a),i.viewDate&&q()},i.setMaxDate=function(a){void 0!==a&&(i.options.maxDate=b.isMoment(a)||a instanceof Date?b(a):b(a,i.format,i.options.useStrict),i.viewDate&&q())},i.setMinDate=function(a){void 0!==a&&(i.options.minDate=b.isMoment(a)||a instanceof Date?b(a):b(a,i.format,i.options.useStrict),i.viewDate&&q())},k()};a.fn.datetimepicker=function(b){return this.each(function(){var c=a(this),e=c.data("DateTimePicker");e||c.data("DateTimePicker",new d(this,b))})},a.fn.datetimepicker.defaults={format:!1,pickDate:!0,pickTime:!0,useMinutes:!0,useSeconds:!1,useCurrent:!0,calendarWeeks:!1,minuteStepping:1,minDate:b({y:1900}),maxDate:b().add(100,"y"),showToday:!0,collapse:!0,language:b.lo
 cale(),defaultDate:"",disabledDates:!1,enabledDates:!1,icons:{},useStrict:!1,direction:"auto",sideBySide:!1,daysOfWeekDisabled:[],widgetParent:!1}});
\ No newline at end of file


[14/18] airavata-php-gateway git commit: AIRAVATA-2152 User Storage Preference management views

Posted by sm...@apache.org.
AIRAVATA-2152 User Storage Preference management views

Also beginning work on loading a user's SSH credential summary info


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/10e9f42d
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/10e9f42d
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/10e9f42d

Branch: refs/heads/develop
Commit: 10e9f42d10df0246117c9c7a27650fb49ff6a21c
Parents: 8f0cc36
Author: Marcus Christie <ma...@iu.edu>
Authored: Fri Oct 21 13:52:31 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:05:14 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php           |  57 ++++++++
 app/libraries/URPUtilities.php                  |  31 +++++
 app/routes.php                                  |   5 +
 app/views/account/dashboard.blade.php           |   2 +-
 .../account/user-compute-resources.blade.php    |   2 +-
 .../account/user-storage-resources.blade.php    | 139 +++++++++++++++++++
 .../user-storage-resource-preferences.blade.php |  58 ++++++++
 7 files changed, 292 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/10e9f42d/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 8e88e90..7b5e4cb 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -554,6 +554,7 @@ class AccountController extends BaseController
         $unselectedCRs = array_values($allCRsById);
 
         // TODO: actually get all of the user's credential store tokens, including description
+        URPUtilities::get_all_ssh_pub_keys_summary_for_user();
         $tokens = array(
             $userResourceProfile->credentialStoreToken => "Default SSH Key"
         );
@@ -590,4 +591,60 @@ class AccountController extends BaseController
             return Redirect::to("account/user-compute-resources")->with("message","Compute Resource Account Settings have been deleted.");
         }
     }
+
+    public function getStorageResources(){
+
+        $userResourceProfile = URPUtilities::get_or_create_user_resource_profile();
+
+        $allSRs = SRUtilities::getAllSRObjects();
+        foreach( $allSRs as $index => $srObject )
+        {
+            $allSRsById[$srObject->storageResourceId] = $srObject;
+        }
+        // Add srDetails to each UserStoragePreference
+        foreach ($userResourceProfile->userStoragePreferences as $index => $userStoragePreference) {
+            $userStoragePreference->srDetails = $allSRsById[$userStoragePreference->storageResourceId];
+            // To figure out the unselectedSRs, remove this storage resource from allSRsById
+            unset($allSRsById[$userStoragePreference->storageResourceId]);
+        }
+        $unselectedSRs = array_values($allSRsById);
+
+        // TODO: actually get all of the user's credential store tokens, including description
+        URPUtilities::get_all_ssh_pub_keys_summary_for_user();
+        $tokens = array(
+            $userResourceProfile->credentialStoreToken => "Default SSH Key"
+        );
+
+        return View::make("account/user-storage-resources", array(
+            "userResourceProfile" => $userResourceProfile,
+            "storageResources" => $allSRs,
+            "unselectedSRs" => $unselectedSRs,
+            "tokens" => $tokens
+        ));
+    }
+
+    public function addUserStorageResourcePreference() {
+
+        if( URPUtilities::add_or_update_user_SRP( Input::all()) )
+        {
+            return Redirect::to("account/user-storage-resources")->with("message","Storage Resource Account Settings have been saved.");
+        }
+    }
+
+    public function updateUserStorageResourcePreference() {
+
+        if( URPUtilities::add_or_update_user_SRP( Input::all(), true ) )
+        {
+            return Redirect::to("account/user-storage-resources")->with("message","Storage Resource Account Settings have been updated.");
+        }
+    }
+
+    public function deleteUserStorageResourcePreference() {
+        $storageResourceId = Input::get("rem-user-srId");
+        $result = URPUtilities::delete_user_SRP( $storageResourceId );
+        if( $result )
+        {
+            return Redirect::to("account/user-storage-resources")->with("message","Storage Resource Account Settings have been deleted.");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/10e9f42d/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index ad5c79a..b4ceba6 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -3,6 +3,7 @@
 use Airavata\API\Error\AiravataSystemException;
 use Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile;
 use Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference;
+use Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference;
 
 class URPUtilities
 {
@@ -79,6 +80,7 @@ class URPUtilities
             $inputs["reservationEndTime"] = CommonUtilities::convertLocalToUTC(strtotime($inputs["reservationEndTime"])) * 1000;
 
         $userComputeResourcePreference = new UserComputeResourcePreference($inputs);
+        // Log::debug("add_or_update_user_CRP: ", array($userComputeResourcePreference));
         $userId = Session::get('username');
         if ($update)
         {
@@ -94,6 +96,35 @@ class URPUtilities
         $userId = Session::get('username');
         $gatewayId = Session::get('gateway_id');
         $result = Airavata::deleteUserComputeResourcePreference(Session::get('authz-token'), $userId, $gatewayId, $computeResourceId);
+        // Log::debug("deleteUserComputeResourcePreference($userId, $gatewayId, $computeResourceId) => $result");
+        return $result;
+    }
+
+    public static function add_or_update_user_SRP($inputs, $update = false)
+    {
+        $inputs = Input::all();
+
+        $userStoragePreference = new UserStoragePreference($inputs);
+        $userId = Session::get('username');
+        $gatewayId = Session::get('gateway_id');
+        $storageResourceId = $inputs["storageResourceId"];
+        if ($update)
+        {
+            return Airavata::updateUserStoragePreference(Session::get('authz-token'), $userId, $inputs["gatewayId"], $inputs["storageResourceId"], $userStoragePreference);
+        } else
+        {
+            // Log::debug("addUserStoragePreference($userId, $gatewayId, $storageResourceId)", array($userStoragePreference));
+            $result = Airavata::addUserStoragePreference(Session::get('authz-token'), $userId, $gatewayId, $storageResourceId, $userStoragePreference);
+            return $result;
+        }
+    }
+
+    public static function delete_user_SRP($storageResourceId)
+    {
+        $userId = Session::get('username');
+        $gatewayId = Session::get('gateway_id');
+        $result = Airavata::deleteUserStoragePreference(Session::get('authz-token'), $userId, $gatewayId, $storageResourceId);
+        // Log::debug("deleteUserStoragePreference($userId, $gatewayId, $storageResourceId) => $result");
         return $result;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/10e9f42d/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index ffb6850..a087339 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -58,6 +58,11 @@ Route::post("account/add-user-crp", "AccountController@addUserComputeResourcePre
 Route::post("account/update-user-crp", "AccountController@updateUserComputeResourcePreference");
 Route::post("account/delete-user-crp", "AccountController@deleteUserComputeResourcePreference");
 
+Route::get("account/user-storage-resources", "AccountController@getStorageResources");
+Route::post("account/add-user-srp", "AccountController@addUserStorageResourcePreference");
+Route::post("account/update-user-srp", "AccountController@updateUserStorageResourcePreference");
+Route::post("account/delete-user-srp", "AccountController@deleteUserStorageResourcePreference");
+
 /*
  * The following routes will not work without logging in.
  *

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/10e9f42d/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index 038dbbb..58c4c7b 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -402,7 +402,7 @@
                     </div>
                 </a>
 
-                <a href="{{URL::to('/')}}/account/storageResources">
+                <a href="{{URL::to('/')}}/account/user-storage-resources">
                     <div class=" col-md-4 well">
                         <div class="col-md-12">
                             <span class="glyphicon glyphicon-folder-open console-icon"></span>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/10e9f42d/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index 4b9330a..bc81f37 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -53,7 +53,7 @@ button.add-user-cr {
                         <input type="hidden" name="gatewayId" id="gatewayId"
                                value="{{$userResourceProfile->gatewayID}}">
                         <input type="hidden" name="computeResourceId"
-                               id="gatewayId"
+                               id="computeResourceId"
                                value="{{$user_crp->computeResourceId}}">
 
                         <div class="form-horizontal">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/10e9f42d/app/views/account/user-storage-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-storage-resources.blade.php b/app/views/account/user-storage-resources.blade.php
new file mode 100644
index 0000000..e38ef96
--- /dev/null
+++ b/app/views/account/user-storage-resources.blade.php
@@ -0,0 +1,139 @@
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+<style>
+button.add-user-sr {
+    margin-top: 10px;
+    margin-bottom: 10px;
+}
+#user-sr-select-input-group {
+    margin-bottom: 10px;
+}
+</style>
+@stop
+
+@section('content')
+@foreach( (array)$storageResources as $index => $sr)
+@include('partials/user-storage-resource-preferences', array('storageResource' => $sr))
+@endforeach
+<div class="container">
+    @if( Session::has("message"))
+        <div class="alert alert-success alert-dismissible" role="alert">
+            <button type="button" class="close" data-dismiss="alert"><span
+                    aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+            {{ Session::get("message") }}
+        </div>
+    {{ Session::forget("message") }}
+    @endif
+    <h1>Storage Resource Accounts</h1>
+    <button class="btn btn-default add-user-sr">
+        <span class="glyphicon glyphicon-plus"></span> Add a Storage Resource Account
+    </button>
+    <div id="add-user-storage-resource-block-container">
+    </div>
+    <div class="panel-group" id="accordion">
+        @foreach( (array)$userResourceProfile->userStoragePreferences as $indexUserSRP => $user_srp )
+        <div class="panel panel-default">
+            <div class="panel-heading">
+                <h4 class="panel-title">
+                    <a class="accordion-toggle collapsed"
+                       data-toggle="collapse" data-parent="#accordion"
+                       href="#collapse-user-srp-{{$indexUserSRP}}">
+                        {{$user_srp->srDetails->hostName}}
+                    </a>
+                </h4>
+            </div>
+            <div id="collapse-user-srp-{{$indexUserSRP}}"
+                 class="panel-collapse collapse">
+                <div class="panel-body">
+                    <form class="set-sr-preference" action="{{URL::to('/')}}/account/update-user-srp"
+                          method="POST">
+                        <input type="hidden" name="gatewayId" id="gatewayId"
+                               value="{{$userResourceProfile->gatewayID}}">
+                        <input type="hidden" name="storageResourceId"
+                               id="storageResourceId"
+                               value="{{$user_srp->storageResourceId}}">
+
+                        <div class="form-horizontal">
+                            @include('partials/user-storage-resource-preferences',
+                            array('storageResource' => $user_srp->srDetails,
+                            'preferences'=>$user_srp, 'show'=>true,
+                            'allowDelete'=>true))
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+        @endforeach
+    </div>
+</div>
+<div class="add-user-storage-resource-block hide">
+    <div class="well">
+        <form action="{{URL::to('/')}}/account/add-user-srp" method="POST">
+            <input type="hidden" name="gatewayId" id="gatewayId" value="{{$userResourceProfile->gatewayID}}">
+
+            <div id="user-sr-select-input-group" class="input-group">
+                <select id="user-sr-select" name="storageResourceId" class="form-control">
+                    <option value="">Select a Storage Resource and configure your account</option>
+                    @foreach( (array)$unselectedSRs as $index => $sr)
+                    <option value="{{ $sr->storageResourceId}}">{{ $sr->hostName }}</option>
+                    @endforeach
+                </select>
+                <span class="input-group-addon remove-user-sr" style="cursor:pointer;">x</span>
+            </div>
+            <div class="user-sr-pref-space form-horizontal"></div>
+        </form>
+    </div>
+</div>
+
+<div class="modal fade" id="remove-user-storage-resource-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
+    <div class="modal-dialog">
+
+        <form action="{{URL::to('/')}}/account/delete-user-srp" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Remove Storage Resource Account Confirmation</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control remove-user-srId" name="rem-user-srId"/>
+
+                    Do you really want to remove your Storage Resource Account settings for <span class="remove-user-sr-name"> </span>?
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-danger" value="Remove"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                    </div>
+                </div>
+            </div>
+
+        </form>
+    </div>
+</div>
+@stop
+
+@section('scripts')
+@parent
+<script>
+
+$('.add-user-sr').on('click', function(){
+
+    $('#add-user-storage-resource-block-container').append( $(".add-user-storage-resource-block").html() );
+});
+$(".remove-user-storage-resource").click( function(){
+	$(".remove-user-sr-name").html( $(this).data("sr-name") );
+	$(".remove-user-srId").val( $(this).data("sr-id") );
+});
+$("#add-user-storage-resource-block-container").on("change", "#user-sr-select", function(){
+    srId = $(this).val();
+    //This is done as Jquery creates problems when using period(.) in id or class.
+    srId = srId.replace(/\./g,"_");
+    $("#add-user-storage-resource-block-container .user-sr-pref-space").html($("#sr-" + srId).html());
+});
+$("#add-user-storage-resource-block-container").on("click", ".remove-user-sr", function(){
+    $("#add-user-storage-resource-block-container").empty();
+});
+</script>
+@stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/10e9f42d/app/views/partials/user-storage-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-storage-resource-preferences.blade.php b/app/views/partials/user-storage-resource-preferences.blade.php
new file mode 100644
index 0000000..b70d48e
--- /dev/null
+++ b/app/views/partials/user-storage-resource-preferences.blade.php
@@ -0,0 +1,58 @@
+<!-- partial template variables:
+    storageResource - (required, StorageResourceDescription) the storage resource object
+    preferences - (optional, UserStoragePreference) the saved preference data
+    show - (optional, boolean)
+    allowDelete - (optional, boolean)
+-->
+<!-- String replace is done as Jquery creates problems when using period(.) in id or class. -->
+<div id="sr-{{ str_replace( '.', "_", $storageResource->storageResourceId) }}" class="@if(isset( $show) ) @if( !$show) hide @endif @else hide @endif">
+<div class="form-group">
+    <label class="control-label col-md-3">Login Username</label>
+
+    <div class="col-md-9">
+        <input type="text" name="loginUserName" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">File System Root Location</label>
+
+    <div class="col-md-9">
+        <input type="text" name="fileSystemRootLocation" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->fileSystemRootLocation}}@endif"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Resource Specific Credential Store Token</label>
+
+    <div class="col-md-9">
+        <select class="form-control gateway-credential-store-token" name="resourceSpecificCredentialStoreToken" >
+            <option value="">Select a Credential Token from Store</option>
+            @foreach( $tokens as $token => $description )
+                <option value="{{$token}}" @if( isset( $preferences) ) @if( $token == $preferences->resourceSpecificCredentialStoreToken) selected @endif @endif>{{$description}}</option>
+            @endforeach
+            <option value="">DO-NO-SET</option>
+        </select>
+        <!--
+        <input type="text" name="resourceSpecificCredentialStoreToken" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->resourceSpecificCredentialStoreToken}}@endif"/>
+        -->
+    </div>
+</div>
+
+<div class="row">
+    <div class="form-group col-md-12 text-center">
+        <input type="submit" class="btn btn-primary" value="Save"/>
+        <button type="button" class="btn btn-danger remove-user-storage-resource @if(isset( $allowDelete ) ) @if( !$allowDelete) hide @endif @else hide @endif"
+            data-toggle="modal"
+            data-target="#remove-user-storage-resource-block"
+            data-cr-name="{{$storageResource->hostName}}"
+            data-cr-id="{{$storageResource->storageResourceId}}">
+            Remove
+        </button>
+    </div>
+</div>
+
+</div>


[16/18] airavata-php-gateway git commit: AIRAVATA-2152 Remove debugging info

Posted by sm...@apache.org.
AIRAVATA-2152 Remove debugging info


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/0cf77f46
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/0cf77f46
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/0cf77f46

Branch: refs/heads/develop
Commit: 0cf77f462832bdfd5d191c7db4e0f5d5dab3c4ce
Parents: 10e9f42
Author: Marcus Christie <ma...@iu.edu>
Authored: Fri Oct 21 14:04:44 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:05:16 2016 -0400

----------------------------------------------------------------------
 app/views/account/user-compute-resources.blade.php | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0cf77f46/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index bc81f37..d3cd844 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -113,10 +113,6 @@ button.add-user-cr {
         </form>
     </div>
 </div>
-
-<pre>
-    {{var_dump($userResourceProfile)}}
-</pre>
 @stop
 
 @section('scripts')


[03/18] airavata-php-gateway git commit: AIRAVATA-2152 Initial UI for updating UserComputeResourcePreferences

Posted by sm...@apache.org.
AIRAVATA-2152 Initial UI for updating UserComputeResourcePreferences


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/5940f9be
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/5940f9be
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/5940f9be

Branch: refs/heads/develop
Commit: 5940f9be2bace0cb9e3997047d34cb564d652b27
Parents: 4068347
Author: Marcus Christie <ma...@gmail.com>
Authored: Thu Oct 13 16:06:27 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:03:36 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php           | 19 +++++++-
 app/libraries/URPUtilities.php                  | 11 +++--
 app/routes.php                                  |  3 +-
 .../account/user-compute-resources.blade.php    | 46 ++++++++++++++++++++
 .../user-compute-resource-preferences.blade.php |  5 +++
 5 files changed, 79 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5940f9be/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 35f8235..1fe9d80 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -539,6 +539,14 @@ class AccountController extends BaseController
     public function getComputeResources(){
         $userResourceProfile = URPUtilities::get_or_create_user_resource_profile();
         $allCRs = CRUtilities::getAllCRObjects();
+        foreach( $allCRs as $index => $crObject)
+        {
+            $allCRsById[$crObject->computeResourceId] = $crObject;
+        }
+        // Add crDetails to each UserComputeResourcePreference
+        foreach ($userResourceProfile->userComputeResourcePreferences as $index => $userCompResPref) {
+            $userCompResPref->crDetails = $allCRsById[$userCompResPref->computeResourceId];
+        }
         // TODO: actually get all of the user's credential store tokens, including description
         $tokens = array(
             $userResourceProfile->credentialStoreToken => "Default SSH Key"
@@ -552,11 +560,20 @@ class AccountController extends BaseController
         ));
     }
 
-    public function modifyUserCRP() {
+    public function addUserComputeResourcePreference() {
 
+        // TODO: flash message isn't setup in the view
         if( URPUtilities::add_or_update_user_CRP( Input::all()) )
         {
             return Redirect::to("account/user-compute-resources")->with("message","Compute Resource Account Settings have been saved.");
         }
     }
+
+    public function updateUserComputeResourcePreference() {
+
+        if( URPUtilities::add_or_update_user_CRP( Input::all(), true ) )
+        {
+            return Redirect::to("account/user-compute-resources")->with("message","Compute Resource Account Settings have been updated.");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5940f9be/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index 005b5cf..026b06e 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -70,7 +70,7 @@ class URPUtilities
         return $credentialSummaryMap;
     }
 
-    public static function add_or_update_user_CRP($inputs)
+    public static function add_or_update_user_CRP($inputs, $update = false)
     {
         $timeDifference = Session::get("user_timezone");
         $addOrSubtract = "-";
@@ -84,8 +84,13 @@ class URPUtilities
 
         $userComputeResourcePreference = new UserComputeResourcePreference($inputs);
         $userId = Session::get('username');
-
-        return Airavata::addUserComputeResourcePreference(Session::get('authz-token'), $userId, $inputs["gatewayId"], $inputs["computeResourceId"], $userComputeResourcePreference);
+        if ($update)
+        {
+            return Airavata::updateUserComputeResourcePreference(Session::get('authz-token'), $userId, $inputs["gatewayId"], $inputs["computeResourceId"], $userComputeResourcePreference);
+        } else
+        {
+            return Airavata::addUserComputeResourcePreference(Session::get('authz-token'), $userId, $inputs["gatewayId"], $inputs["computeResourceId"], $userComputeResourcePreference);
+        }
     }
 
     // Only used for testing

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5940f9be/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 8227064..b8b5aeb 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -54,7 +54,8 @@ Route::post("account/add-credential", "AccountController@addCredential");
 Route::post("account/delete-credential", "AccountController@deleteCredential");
 
 Route::get("account/user-compute-resources", "AccountController@getComputeResources");
-Route::post("account/add-user-crp", "AccountController@modifyUserCRP");
+Route::post("account/add-user-crp", "AccountController@addUserComputeResourcePreference");
+Route::post("account/update-user-crp", "AccountController@updateUserComputeResourcePreference");
 
 /*
  * The following routes will not work without logging in.

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5940f9be/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index 7838623..f460a53 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -18,6 +18,52 @@
             </button>
         </div>
     </div>
+    <div class="row">
+        <div class="col-md-12">
+            <div class="panel-group" id="accordion">
+                @foreach( (array)$userResourceProfile->userComputeResourcePreferences as $indexUserCRP => $user_crp )
+                <div class="panel panel-default">
+                    <div class="panel-heading">
+                        <h4 class="panel-title">
+                            <a class="accordion-toggle collapsed"
+                               data-toggle="collapse" data-parent="#accordion"
+                               href="#collapse-user-crp-{{$indexUserCRP}}">
+                                HOSTNAME TODO: {{$user_crp->computeResourceId}}
+                            </a>
+                            <div class="pull-right col-md-2 fade">
+                                <span class="glyphicon glyphicon-remove remove-compute-resource"
+                                      style="cursor:pointer;" data-toggle="modal"
+                                      data-target="#remove-compute-resource-block"
+                                      data-cr-name="TODO"
+                                      data-cr-id="{{$user_crp->computeResourceId}}"
+                                      data-gp-id="{{ $userResourceProfile->gatewayID }}"></span>
+                            </div>
+                        </h4>
+                    </div>
+                    <div id="collapse-user-crp-{{$indexUserCRP}}"
+                         class="panel-collapse collapse">
+                        <div class="panel-body">
+                            <form class="set-cr-preference" action="{{URL::to('/')}}/account/update-user-crp"
+                                  method="POST">
+                                <input type="hidden" name="gatewayId" id="gatewayId"
+                                       value="{{$userResourceProfile->gatewayID}}">
+                                <input type="hidden" name="computeResourceId"
+                                       id="gatewayId"
+                                       value="{{$user_crp->computeResourceId}}">
+
+                                <div class="form-horizontal">
+                                    @include('partials/user-compute-resource-preferences',
+                                    array('computeResource' => $user_crp->crDetails,
+                                    'preferences'=>$user_crp, 'show'=>true))
+                                </div>
+                            </form>
+                        </div>
+                    </div>
+                </div>
+                @endforeach
+            </div>
+        </div>
+    </div>
 </div>
 <div class="add-user-compute-resource-block hide">
     <div class="well">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5940f9be/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
index e930e53..f045bd0 100644
--- a/app/views/partials/user-compute-resource-preferences.blade.php
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -1,3 +1,8 @@
+<!-- partial template variables:
+    computeResource - (required, ComputeResourceDescription) the compute resource object
+    preferences - (optional, UserComputeResourcePreference) the saved preference data
+    show - (optional, boolean)
+-->
 <!-- String replace is done as Jquery creates problems when using period(.) in id or class. -->
 <div id="cr-{{ str_replace( '.', "_", $computeResource->computeResourceId) }}" class="@if(isset( $show) ) @if( !$show) hide @endif @else hide @endif">
 <h3 class="text-center">Set Preferences</h3>


[17/18] airavata-php-gateway git commit: AIRAVATA-2152 Allow user to pick resource specific SSH key

Posted by sm...@apache.org.
AIRAVATA-2152 Allow user to pick resource specific SSH key


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/480021cf
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/480021cf
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/480021cf

Branch: refs/heads/develop
Commit: 480021cf807d410ad6cea71dfe78a576679c4693
Parents: 2d6bf7f
Author: Marcus Christie <ma...@iu.edu>
Authored: Fri Oct 28 13:09:20 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:05:16 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php           | 20 +++++++----------
 .../account/user-compute-resources.blade.php    |  7 ++++--
 .../account/user-storage-resources.blade.php    |  7 ++++--
 .../user-compute-resource-preferences.blade.php | 23 +++++++++++---------
 .../user-storage-resource-preferences.blade.php | 19 +++++++++++-----
 5 files changed, 44 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/480021cf/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 7b5e4cb..6037dda 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -553,17 +553,15 @@ class AccountController extends BaseController
         }
         $unselectedCRs = array_values($allCRsById);
 
-        // TODO: actually get all of the user's credential store tokens, including description
-        URPUtilities::get_all_ssh_pub_keys_summary_for_user();
-        $tokens = array(
-            $userResourceProfile->credentialStoreToken => "Default SSH Key"
-        );
+        $credentialSummaries = URPUtilities::get_all_ssh_pub_keys_summary_for_user();
+        $defaultCredentialSummary = $credentialSummaries[$userResourceProfile->credentialStoreToken];
 
         return View::make("account/user-compute-resources", array(
             "userResourceProfile" => $userResourceProfile,
             "computeResources" => $allCRs,
             "unselectedCRs" => $unselectedCRs,
-            "tokens" => $tokens
+            "credentialSummaries" => $credentialSummaries,
+            "defaultCredentialSummary" => $defaultCredentialSummary
         ));
     }
 
@@ -609,17 +607,15 @@ class AccountController extends BaseController
         }
         $unselectedSRs = array_values($allSRsById);
 
-        // TODO: actually get all of the user's credential store tokens, including description
-        URPUtilities::get_all_ssh_pub_keys_summary_for_user();
-        $tokens = array(
-            $userResourceProfile->credentialStoreToken => "Default SSH Key"
-        );
+        $credentialSummaries = URPUtilities::get_all_ssh_pub_keys_summary_for_user();
+        $defaultCredentialSummary = $credentialSummaries[$userResourceProfile->credentialStoreToken];
 
         return View::make("account/user-storage-resources", array(
             "userResourceProfile" => $userResourceProfile,
             "storageResources" => $allSRs,
             "unselectedSRs" => $unselectedSRs,
-            "tokens" => $tokens
+            "credentialSummaries" => $credentialSummaries,
+            "defaultCredentialSummary" => $defaultCredentialSummary
         ));
     }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/480021cf/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index d3cd844..2756a91 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -16,7 +16,9 @@ button.add-user-cr {
 
 @section('content')
 @foreach( (array)$computeResources as $index => $cr)
-@include('partials/user-compute-resource-preferences', array('computeResource' => $cr))
+@include('partials/user-compute-resource-preferences',
+    array('computeResource' => $cr, 'credentialSummaries' => $credentialSummaries,
+        'defaultCredentialSummary' => $defaultCredentialSummary))
 @endforeach
 <div class="container">
     @if( Session::has("message"))
@@ -60,7 +62,8 @@ button.add-user-cr {
                             @include('partials/user-compute-resource-preferences',
                             array('computeResource' => $user_crp->crDetails,
                             'preferences'=>$user_crp, 'show'=>true,
-                            'allowDelete'=>true))
+                            'allowDelete'=>true, 'credentialSummaries' => $credentialSummaries,
+                            'defaultCredentialSummary' => $defaultCredentialSummary))
                         </div>
                     </form>
                 </div>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/480021cf/app/views/account/user-storage-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-storage-resources.blade.php b/app/views/account/user-storage-resources.blade.php
index e38ef96..b87660e 100644
--- a/app/views/account/user-storage-resources.blade.php
+++ b/app/views/account/user-storage-resources.blade.php
@@ -15,7 +15,9 @@ button.add-user-sr {
 
 @section('content')
 @foreach( (array)$storageResources as $index => $sr)
-@include('partials/user-storage-resource-preferences', array('storageResource' => $sr))
+@include('partials/user-storage-resource-preferences',
+    array('storageResource' => $sr, 'credentialSummaries' => $credentialSummaries,
+        'defaultCredentialSummary' => $defaultCredentialSummary))
 @endforeach
 <div class="container">
     @if( Session::has("message"))
@@ -59,7 +61,8 @@ button.add-user-sr {
                             @include('partials/user-storage-resource-preferences',
                             array('storageResource' => $user_srp->srDetails,
                             'preferences'=>$user_srp, 'show'=>true,
-                            'allowDelete'=>true))
+                            'allowDelete'=>true, 'credentialSummaries' => $credentialSummaries,
+                            'defaultCredentialSummary' => $defaultCredentialSummary))
                         </div>
                     </form>
                 </div>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/480021cf/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
index 8753f6c..49c3f85 100644
--- a/app/views/partials/user-compute-resource-preferences.blade.php
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -1,5 +1,7 @@
 <!-- partial template variables:
     computeResource - (required, ComputeResourceDescription) the compute resource object
+    credentialSummaries - (required, list of CredentialSummary) user's credentials
+    defaultCredentialSummary - (required, CredentialSummary) user's default credential
     preferences - (optional, UserComputeResourcePreference) the saved preference data
     show - (optional, boolean)
     allowDelete - (optional, boolean)
@@ -47,20 +49,21 @@
 </div>
 
 <div class="form-group">
-    <label class="control-label col-md-3">Resource Specific Credential Store Token</label>
+    <label class="control-label col-md-3">Resource Specific SSH Key</label>
 
     <div class="col-md-9">
-        <select class="form-control gateway-credential-store-token" name="resourceSpecificCredentialStoreToken" >
-            <option value="">Select a Credential Token from Store</option>
-            @foreach( $tokens as $token => $description )
-                <option value="{{$token}}" @if( isset( $preferences) ) @if( $token == $preferences->resourceSpecificCredentialStoreToken) selected @endif @endif>{{$description}}</option>
+        <select class="form-control" name="resourceSpecificCredentialStoreToken" >
+            <option value="" @if( isset( $preferences) && $preferences->resourceSpecificCredentialStoreToken == null) selected @endif>
+                No resource specific SSH key, just use the default one ({{{$defaultCredentialSummary->description}}})
+            </option>
+            @foreach( $credentialSummaries as $token => $credentialSummary )
+            @if( $token != $defaultCredentialSummary->token)
+            <option value="{{$token}}" @if( isset( $preferences) && $token == $preferences->resourceSpecificCredentialStoreToken) selected @endif>
+                Use {{{$credentialSummary->description}}}
+            </option>
+            @endif
             @endforeach
-            <option value="">DO-NO-SET</option>
         </select>
-        <!--
-        <input type="text" name="resourceSpecificCredentialStoreToken" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->resourceSpecificCredentialStoreToken}}@endif"/>
-        -->
     </div>
 </div>
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/480021cf/app/views/partials/user-storage-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-storage-resource-preferences.blade.php b/app/views/partials/user-storage-resource-preferences.blade.php
index 16946d6..a5bc771 100644
--- a/app/views/partials/user-storage-resource-preferences.blade.php
+++ b/app/views/partials/user-storage-resource-preferences.blade.php
@@ -1,5 +1,7 @@
 <!-- partial template variables:
     storageResource - (required, StorageResourceDescription) the storage resource object
+    credentialSummaries - (required, list of CredentialSummary) user's credentials
+    defaultCredentialSummary - (required, CredentialSummary) user's default credential
     preferences - (optional, UserStoragePreference) the saved preference data
     show - (optional, boolean)
     allowDelete - (optional, boolean)
@@ -25,15 +27,20 @@
 </div>
 
 <div class="form-group">
-    <label class="control-label col-md-3">Resource Specific Credential Store Token</label>
+    <label class="control-label col-md-3">Resource Specific SSH Key</label>
 
     <div class="col-md-9">
-        <select class="form-control gateway-credential-store-token" name="resourceSpecificCredentialStoreToken" >
-            <option value="">Select a Credential Token from Store</option>
-            @foreach( $tokens as $token => $description )
-                <option value="{{$token}}" @if( isset( $preferences) ) @if( $token == $preferences->resourceSpecificCredentialStoreToken) selected @endif @endif>{{$description}}</option>
+        <select class="form-control" name="resourceSpecificCredentialStoreToken" >
+            <option value="" @if( isset( $preferences) && $preferences->resourceSpecificCredentialStoreToken == null) selected @endif>
+                No resource specific SSH key, just use the default one ({{{$defaultCredentialSummary->description}}})
+            </option>
+            @foreach( $credentialSummaries as $token => $credentialSummary )
+            @if( $token != $defaultCredentialSummary->token)
+            <option value="{{$token}}" @if( isset( $preferences) && $token == $preferences->resourceSpecificCredentialStoreToken) selected @endif>
+                Use {{{$credentialSummary->description}}}
+            </option>
+            @endif
             @endforeach
-            <option value="">DO-NO-SET</option>
         </select>
     </div>
 </div>


[05/18] airavata-php-gateway git commit: AIRAVATA-2152 Fix small layout issues

Posted by sm...@apache.org.
AIRAVATA-2152 Fix small layout issues


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/6555a6ea
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/6555a6ea
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/6555a6ea

Branch: refs/heads/develop
Commit: 6555a6ea5ab7408d67c91db825f43ec6b35b4eb3
Parents: 3bcc348
Author: Marcus Christie <ma...@gmail.com>
Authored: Thu Oct 13 16:40:29 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:03:38 2016 -0400

----------------------------------------------------------------------
 app/views/account/user-compute-resources.blade.php             | 6 ++++++
 app/views/partials/user-compute-resource-preferences.blade.php | 3 +--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6555a6ea/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index 080a422..a8dbff7 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -2,6 +2,12 @@
 
 @section('page-header')
 @parent
+<style>
+button.add-user-cr {
+    margin-top: 10px;
+    margin-bottom: 10px;
+}
+</style>
 @stop
 
 @section('content')

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6555a6ea/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
index f045bd0..af70ecc 100644
--- a/app/views/partials/user-compute-resource-preferences.blade.php
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -5,7 +5,6 @@
 -->
 <!-- String replace is done as Jquery creates problems when using period(.) in id or class. -->
 <div id="cr-{{ str_replace( '.', "_", $computeResource->computeResourceId) }}" class="@if(isset( $show) ) @if( !$show) hide @endif @else hide @endif">
-<h3 class="text-center">Set Preferences</h3>
 <div class="form-group">
     <label class="control-label col-md-3">Login Username</label>
 
@@ -121,7 +120,7 @@ if( isset( $preferences) && $preferences->reservationEndTime != '')
     </div>
 </div>
 
-<div class="form-group text-center">
+<div class="form-group col-md-12 text-center">
     <input type="submit" class="btn btn-primary submit-user-crp-form" value="Save"/>
 </div>
 </div>


[12/18] airavata-php-gateway git commit: AIRAVATA-2152 Convert to time value before calling convertLocalToUTC

Posted by sm...@apache.org.
AIRAVATA-2152 Convert to time value before calling convertLocalToUTC


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/bce3cc82
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/bce3cc82
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/bce3cc82

Branch: refs/heads/develop
Commit: bce3cc827d35dfd409e387796baccc450a7476c1
Parents: 3a79019
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Oct 20 11:58:55 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:04:31 2016 -0400

----------------------------------------------------------------------
 app/libraries/CRUtilities.php  | 4 ++--
 app/libraries/URPUtilities.php | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/bce3cc82/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index 34066c1..ae3e1ad 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -526,9 +526,9 @@ class CRUtilities
     {
         $inputs = Input::all();
         if( $inputs["reservationStartTime"] != "")
-            $inputs["reservationStartTime"] = CommonUtilities::convertLocalToUTC($inputs["reservationStartTime"]) * 1000;
+            $inputs["reservationStartTime"] = CommonUtilities::convertLocalToUTC(strtotime($inputs["reservationStartTime"])) * 1000;
         if( $inputs["reservationEndTime"] != "")
-            $inputs["reservationEndTime"] = CommonUtilities::convertLocalToUTC($inputs["reservationEndTime"]) * 1000;
+            $inputs["reservationEndTime"] = CommonUtilities::convertLocalToUTC(strtotime($inputs["reservationEndTime"])) * 1000;
 
         $computeResourcePreferences = new computeResourcePreference($inputs);
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/bce3cc82/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index ad4529b..ad5c79a 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -74,9 +74,9 @@ class URPUtilities
     {
         $inputs = Input::all();
         if( $inputs["reservationStartTime"] != "")
-            $inputs["reservationStartTime"] = CommonUtilities::convertLocalToUTC($inputs["reservationStartTime"]) * 1000;
+            $inputs["reservationStartTime"] = CommonUtilities::convertLocalToUTC(strtotime($inputs["reservationStartTime"])) * 1000;
         if( $inputs["reservationEndTime"] != "")
-            $inputs["reservationEndTime"] = CommonUtilities::convertLocalToUTC($inputs["reservationEndTime"]) * 1000;
+            $inputs["reservationEndTime"] = CommonUtilities::convertLocalToUTC(strtotime($inputs["reservationEndTime"])) * 1000;
 
         $userComputeResourcePreference = new UserComputeResourcePreference($inputs);
         $userId = Session::get('username');


[10/18] airavata-php-gateway git commit: AIRAVATA-2152 Missing semicolons

Posted by sm...@apache.org.
AIRAVATA-2152 Missing semicolons


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/9544427a
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/9544427a
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/9544427a

Branch: refs/heads/develop
Commit: 9544427a3c513d58d40a3baf77809497bee6747f
Parents: bce3cc8
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Oct 20 15:36:11 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:04:31 2016 -0400

----------------------------------------------------------------------
 app/views/partials/compute-resource-preferences.blade.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9544427a/app/views/partials/compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/compute-resource-preferences.blade.php b/app/views/partials/compute-resource-preferences.blade.php
index 82bdd62..86f0b3d 100644
--- a/app/views/partials/compute-resource-preferences.blade.php
+++ b/app/views/partials/compute-resource-preferences.blade.php
@@ -134,11 +134,11 @@
 //to add or remove time according to local hours.
 $reservationStartTime = "";
 if( isset( $preferences) && $preferences->reservationStartTime != '')
-    $reservationStartTime = CommonUtilities::convertUTCToLocal($preferences->reservationStartTime/1000)
+    $reservationStartTime = CommonUtilities::convertUTCToLocal($preferences->reservationStartTime/1000);
 
 $reservationEndTime = "";
 if( isset( $preferences) && $preferences->reservationEndTime != '')
-    $reservationEndTime = CommonUtilities::convertUTCToLocal($preferences->reservationEndTime/1000)
+    $reservationEndTime = CommonUtilities::convertUTCToLocal($preferences->reservationEndTime/1000);
 
 ?>
 <div class="form-group col-md-6">


[04/18] airavata-php-gateway git commit: AIRAVATA-2152 Add save/update result message

Posted by sm...@apache.org.
AIRAVATA-2152 Add save/update result message


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/3bcc3489
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3bcc3489
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3bcc3489

Branch: refs/heads/develop
Commit: 3bcc348931def6dfc733cdba4cd6fb5a15c7d3a1
Parents: 5940f9b
Author: Marcus Christie <ma...@gmail.com>
Authored: Thu Oct 13 16:30:53 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:03:38 2016 -0400

----------------------------------------------------------------------
 .../account/user-compute-resources.blade.php    | 92 ++++++++++----------
 1 file changed, 46 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bcc3489/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index f460a53..080a422 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -10,59 +10,59 @@
 @include('partials/user-compute-resource-preferences', array('computeResource' => $cr))
 @endforeach
 <div class="container">
-    <h1>Compute Resource Accounts</h1>
-    <div class="row">
-        <div class="col-md-12">
-            <button class="btn btn-default add-user-cr">
-                <span class="glyphicon glyphicon-plus"></span> Add a Compute Resource Account
-            </button>
+    @if( Session::has("message"))
+        <div class="alert alert-success alert-dismissible" role="alert">
+            <button type="button" class="close" data-dismiss="alert"><span
+                    aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+            {{ Session::get("message") }}
         </div>
-    </div>
-    <div class="row">
-        <div class="col-md-12">
-            <div class="panel-group" id="accordion">
-                @foreach( (array)$userResourceProfile->userComputeResourcePreferences as $indexUserCRP => $user_crp )
-                <div class="panel panel-default">
-                    <div class="panel-heading">
-                        <h4 class="panel-title">
-                            <a class="accordion-toggle collapsed"
-                               data-toggle="collapse" data-parent="#accordion"
-                               href="#collapse-user-crp-{{$indexUserCRP}}">
-                                HOSTNAME TODO: {{$user_crp->computeResourceId}}
-                            </a>
-                            <div class="pull-right col-md-2 fade">
-                                <span class="glyphicon glyphicon-remove remove-compute-resource"
-                                      style="cursor:pointer;" data-toggle="modal"
-                                      data-target="#remove-compute-resource-block"
-                                      data-cr-name="TODO"
-                                      data-cr-id="{{$user_crp->computeResourceId}}"
-                                      data-gp-id="{{ $userResourceProfile->gatewayID }}"></span>
-                            </div>
-                        </h4>
+    {{ Session::forget("message") }}
+    @endif
+    <h1>Compute Resource Accounts</h1>
+    <button class="btn btn-default add-user-cr">
+        <span class="glyphicon glyphicon-plus"></span> Add a Compute Resource Account
+    </button>
+    <div class="panel-group" id="accordion">
+        @foreach( (array)$userResourceProfile->userComputeResourcePreferences as $indexUserCRP => $user_crp )
+        <div class="panel panel-default">
+            <div class="panel-heading">
+                <h4 class="panel-title">
+                    <a class="accordion-toggle collapsed"
+                       data-toggle="collapse" data-parent="#accordion"
+                       href="#collapse-user-crp-{{$indexUserCRP}}">
+                        HOSTNAME TODO: {{$user_crp->computeResourceId}}
+                    </a>
+                    <div class="pull-right col-md-2 fade">
+                        <span class="glyphicon glyphicon-remove remove-compute-resource"
+                              style="cursor:pointer;" data-toggle="modal"
+                              data-target="#remove-compute-resource-block"
+                              data-cr-name="TODO"
+                              data-cr-id="{{$user_crp->computeResourceId}}"
+                              data-gp-id="{{ $userResourceProfile->gatewayID }}"></span>
                     </div>
-                    <div id="collapse-user-crp-{{$indexUserCRP}}"
-                         class="panel-collapse collapse">
-                        <div class="panel-body">
-                            <form class="set-cr-preference" action="{{URL::to('/')}}/account/update-user-crp"
-                                  method="POST">
-                                <input type="hidden" name="gatewayId" id="gatewayId"
-                                       value="{{$userResourceProfile->gatewayID}}">
-                                <input type="hidden" name="computeResourceId"
-                                       id="gatewayId"
-                                       value="{{$user_crp->computeResourceId}}">
+                </h4>
+            </div>
+            <div id="collapse-user-crp-{{$indexUserCRP}}"
+                 class="panel-collapse collapse">
+                <div class="panel-body">
+                    <form class="set-cr-preference" action="{{URL::to('/')}}/account/update-user-crp"
+                          method="POST">
+                        <input type="hidden" name="gatewayId" id="gatewayId"
+                               value="{{$userResourceProfile->gatewayID}}">
+                        <input type="hidden" name="computeResourceId"
+                               id="gatewayId"
+                               value="{{$user_crp->computeResourceId}}">
 
-                                <div class="form-horizontal">
-                                    @include('partials/user-compute-resource-preferences',
-                                    array('computeResource' => $user_crp->crDetails,
-                                    'preferences'=>$user_crp, 'show'=>true))
-                                </div>
-                            </form>
+                        <div class="form-horizontal">
+                            @include('partials/user-compute-resource-preferences',
+                            array('computeResource' => $user_crp->crDetails,
+                            'preferences'=>$user_crp, 'show'=>true))
                         </div>
-                    </div>
+                    </form>
                 </div>
-                @endforeach
             </div>
         </div>
+        @endforeach
     </div>
 </div>
 <div class="add-user-compute-resource-block hide">


[08/18] airavata-php-gateway git commit: AIRAVATA-2152 Enable reservation start/end time

Posted by sm...@apache.org.
AIRAVATA-2152 Enable reservation start/end time

Also factored out UTC<->local time conversion to functions in
CommonUtilities.php. Fixed a bug in the logic with timezones with
negative offset; the minus sign wasn't being handled in strtotime so I'm
using the absolute value instead.


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/18a98fd2
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/18a98fd2
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/18a98fd2

Branch: refs/heads/develop
Commit: 18a98fd27475dd7b3e918e3b20d6c7de26dd894c
Parents: 17425c0
Author: Marcus Christie <ma...@iu.edu>
Authored: Wed Oct 19 16:44:48 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:04:30 2016 -0400

----------------------------------------------------------------------
 app/libraries/CRUtilities.php                   |  8 ++----
 app/libraries/CommonUtilities.php               | 26 ++++++++++++++++++
 app/libraries/URPUtilities.php                  |  8 ++----
 .../account/user-compute-resources.blade.php    | 29 ++++++++++++++++++++
 .../compute-resource-preferences.blade.php      |  9 ++----
 .../user-compute-resource-preferences.blade.php |  9 ++----
 6 files changed, 63 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/18a98fd2/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index fad1ad2..34066c1 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -524,15 +524,11 @@ class CRUtilities
 
     public static function add_or_update_CRP($inputs)
     {
-        $timeDifference = Session::get("user_timezone");
-        $addOrSubtract = "-";
-        if( $timeDifference > 0)
-            $addOrSubtract = "+";
         $inputs = Input::all();
         if( $inputs["reservationStartTime"] != "")
-            $inputs["reservationStartTime"] = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", strtotime( $inputs["reservationStartTime"]) ) * 1000;
+            $inputs["reservationStartTime"] = CommonUtilities::convertLocalToUTC($inputs["reservationStartTime"]) * 1000;
         if( $inputs["reservationEndTime"] != "")
-            $inputs["reservationEndTime"] = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", strtotime($inputs["reservationEndTime"]) ) * 1000;
+            $inputs["reservationEndTime"] = CommonUtilities::convertLocalToUTC($inputs["reservationEndTime"]) * 1000;
 
         $computeResourcePreferences = new computeResourcePreference($inputs);
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/18a98fd2/app/libraries/CommonUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php
index 9ec209b..94e8626 100644
--- a/app/libraries/CommonUtilities.php
+++ b/app/libraries/CommonUtilities.php
@@ -373,5 +373,31 @@ class CommonUtilities
             }
         };
     }
+
+    /**
+     * Convert from UTC time to local time. Units are seconds since Unix Epoch.
+     */
+    public static function convertUTCToLocal($utcTime) {
+
+        $timeDifference = Session::get("user_timezone");
+        $addOrSubtract = "-";
+        if( $timeDifference < 0)
+            $addOrSubtract = "+";
+
+        return strtotime( $addOrSubtract . " " . abs($timeDifference) . " hours", $utcTime);
+    }
+
+    /**
+     * Convert from local time to UTC time. Units are seconds since Unix Epoch.
+     */
+    public static function convertLocalToUTC($localTime) {
+
+        $timeDifference = Session::get("user_timezone");
+        $addOrSubtract = "-";
+        if( $timeDifference > 0)
+            $addOrSubtract = "+";
+
+        return strtotime( $addOrSubtract . " " . abs($timeDifference) . " hours", $localTime);
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/18a98fd2/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index 3da8f21..ad4529b 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -72,15 +72,11 @@ class URPUtilities
 
     public static function add_or_update_user_CRP($inputs, $update = false)
     {
-        $timeDifference = Session::get("user_timezone");
-        $addOrSubtract = "-";
-        if( $timeDifference > 0)
-            $addOrSubtract = "+";
         $inputs = Input::all();
         if( $inputs["reservationStartTime"] != "")
-            $inputs["reservationStartTime"] = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", strtotime( $inputs["reservationStartTime"]) ) * 1000;
+            $inputs["reservationStartTime"] = CommonUtilities::convertLocalToUTC($inputs["reservationStartTime"]) * 1000;
         if( $inputs["reservationEndTime"] != "")
-            $inputs["reservationEndTime"] = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", strtotime($inputs["reservationEndTime"]) ) * 1000;
+            $inputs["reservationEndTime"] = CommonUtilities::convertLocalToUTC($inputs["reservationEndTime"]) * 1000;
 
         $userComputeResourcePreference = new UserComputeResourcePreference($inputs);
         $userId = Session::get('username');

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/18a98fd2/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index a1a1f99..e46f37e 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -2,6 +2,7 @@
 
 @section('page-header')
 @parent
+{{ HTML::style('css/datetimepicker.css')}}
 <style>
 button.add-user-cr {
     margin-top: 10px;
@@ -120,6 +121,8 @@ button.add-user-cr {
 
 @section('scripts')
 @parent
+{{ HTML::script('js/moment.js')}}
+{{ HTML::script('js/datetimepicker.js')}}
 <script>
 
 $('.add-user-cr').on('click', function(){
@@ -136,5 +139,31 @@ $("body").on("change", "#user-cr-select", function(){
     crId = crId.replace(/\./g,"_");
     $(".user-cr-pref-space").html($("#cr-" + crId).html());
 });
+
+/* making datetimepicker work for reservation start and end date kept in user-compute-resource-preferences blade*/
+$('.datetimepicker1').datetimepicker({
+    pick12HourFormat: false
+    //pickTime: false
+});
+$('.datetimepicker2').datetimepicker({
+    pick12HourFormat: false
+    //pickTime: false
+});
+
+$(".datetimepicker1 input").focus( function(){
+    $(this).parent().find(".glyphicon-calendar").click();
+});
+$(".datetimepicker2 input").focus( function(){
+    $(this).parent().find(".glyphicon-calendar").click();
+});
+
+$(".datetimepicker1").on("dp.change", function (e) {
+    $('.datetimepicker2').data("DateTimePicker").setMinDate(e.date);
+    $(this).find(".glyphicon-calendar").click();
+});
+$(".datetimepicker2").on("dp.change", function (e) {
+    $('.datetimepicker1').data("DateTimePicker").setMaxDate(e.date);
+    $(this).find(".glyphicon-calendar").click();
+});
 </script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/18a98fd2/app/views/partials/compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/compute-resource-preferences.blade.php b/app/views/partials/compute-resource-preferences.blade.php
index 99fc469..82bdd62 100644
--- a/app/views/partials/compute-resource-preferences.blade.php
+++ b/app/views/partials/compute-resource-preferences.blade.php
@@ -132,18 +132,13 @@
 </div>
 <?php
 //to add or remove time according to local hours.
-$timeDifference = Session::get("user_timezone");
-$addOrSubtract = "-";
-if( $timeDifference < 0)
-    $addOrSubtract = "+";
-
 $reservationStartTime = "";
 if( isset( $preferences) && $preferences->reservationStartTime != '')
-    $reservationStartTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", $preferences->reservationStartTime/1000);
+    $reservationStartTime = CommonUtilities::convertUTCToLocal($preferences->reservationStartTime/1000)
 
 $reservationEndTime = "";
 if( isset( $preferences) && $preferences->reservationEndTime != '')
-    $reservationEndTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", $preferences->reservationEndTime/1000);
+    $reservationEndTime = CommonUtilities::convertUTCToLocal($preferences->reservationEndTime/1000)
 
 ?>
 <div class="form-group col-md-6">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/18a98fd2/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
index 0e2036c..af0872e 100644
--- a/app/views/partials/user-compute-resource-preferences.blade.php
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -83,18 +83,13 @@
 </div>
 <?php
 //to add or remove time according to local hours.
-$timeDifference = Session::get("user_timezone");
-$addOrSubtract = "-";
-if( $timeDifference < 0)
-    $addOrSubtract = "+";
-
 $reservationStartTime = "";
 if( isset( $preferences) && $preferences->reservationStartTime != '')
-    $reservationStartTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", $preferences->reservationStartTime/1000);
+    $reservationStartTime = CommonUtilities::convertUTCToLocal($preferences->reservationStartTime/1000)
 
 $reservationEndTime = "";
 if( isset( $preferences) && $preferences->reservationEndTime != '')
-    $reservationEndTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", $preferences->reservationEndTime/1000);
+    $reservationEndTime = CommonUtilities::convertUTCToLocal($preferences->reservationEndTime/1000)
 
 ?>
 


[02/18] airavata-php-gateway git commit: AIRAVATA-2152 Initial UI for adding UserComputeResourcePreference

Posted by sm...@apache.org.
AIRAVATA-2152 Initial UI for adding UserComputeResourcePreference


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/4068347c
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/4068347c
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/4068347c

Branch: refs/heads/develop
Commit: 4068347c2f916ad9c02c8f65c6d75c3dd860516d
Parents: 0be549c
Author: Marcus Christie <ma...@gmail.com>
Authored: Thu Oct 13 10:25:55 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:02:17 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php |  9 +++++++++
 app/libraries/URPUtilities.php        | 18 ++++++++++++++++++
 app/routes.php                        |  3 ++-
 app/views/account/dashboard.blade.php |  2 +-
 4 files changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4068347c/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 183a427..35f8235 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -467,6 +467,7 @@ class AccountController extends BaseController
         Session::put("notice-seen", true);
     }
 
+    // TODO: maybe move the UserResourceProfile stuff to its own controller?
     public function getCredentialStore() {
 
         $userResourceProfile = URPUtilities::get_or_create_user_resource_profile();
@@ -550,4 +551,12 @@ class AccountController extends BaseController
             "tokens" => $tokens
         ));
     }
+
+    public function modifyUserCRP() {
+
+        if( URPUtilities::add_or_update_user_CRP( Input::all()) )
+        {
+            return Redirect::to("account/user-compute-resources")->with("message","Compute Resource Account Settings have been saved.");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4068347c/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index 68aef94..005b5cf 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -2,6 +2,7 @@
 
 use Airavata\API\Error\AiravataSystemException;
 use Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile;
+use Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference;
 
 class URPUtilities
 {
@@ -69,6 +70,23 @@ class URPUtilities
         return $credentialSummaryMap;
     }
 
+    public static function add_or_update_user_CRP($inputs)
+    {
+        $timeDifference = Session::get("user_timezone");
+        $addOrSubtract = "-";
+        if( $timeDifference > 0)
+            $addOrSubtract = "+";
+        $inputs = Input::all();
+        if( $inputs["reservationStartTime"] != "")
+            $inputs["reservationStartTime"] = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", strtotime( $inputs["reservationStartTime"]) ) * 1000;
+        if( $inputs["reservationEndTime"] != "")
+            $inputs["reservationEndTime"] = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", strtotime($inputs["reservationEndTime"]) ) * 1000;
+
+        $userComputeResourcePreference = new UserComputeResourcePreference($inputs);
+        $userId = Session::get('username');
+
+        return Airavata::addUserComputeResourcePreference(Session::get('authz-token'), $userId, $inputs["gatewayId"], $inputs["computeResourceId"], $userComputeResourcePreference);
+    }
 
     // Only used for testing
     public static function delete_user_resource_profile()

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4068347c/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index e0bc801..8227064 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -53,7 +53,8 @@ Route::post("account/set-default-credential", "AccountController@setDefaultCrede
 Route::post("account/add-credential", "AccountController@addCredential");
 Route::post("account/delete-credential", "AccountController@deleteCredential");
 
-Route::get("account/computeResources", "AccountController@getComputeResources");
+Route::get("account/user-compute-resources", "AccountController@getComputeResources");
+Route::post("account/add-user-crp", "AccountController@modifyUserCRP");
 
 /*
  * The following routes will not work without logging in.

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4068347c/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index 740dded..038dbbb 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -391,7 +391,7 @@
                 <p>Use these settings if you have your own compute and/or
                 storage resource accounts that you would like to use.</p>
 
-                <a href="{{URL::to('/')}}/account/computeResources">
+                <a href="{{URL::to('/')}}/account/user-compute-resources">
                     <div class=" col-md-4 well">
                         <div class="col-md-12">
                             <span class="glyphicon glyphicon-briefcase  console-icon"></span>


[15/18] airavata-php-gateway git commit: AIRAVATA-2152 Fixing storage resource deletion

Posted by sm...@apache.org.
AIRAVATA-2152 Fixing storage resource deletion


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/2d6bf7fa
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/2d6bf7fa
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/2d6bf7fa

Branch: refs/heads/develop
Commit: 2d6bf7faca11a710d85365b070214c250755d356
Parents: 0cf77f4
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Oct 27 15:36:55 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:05:16 2016 -0400

----------------------------------------------------------------------
 .../partials/user-storage-resource-preferences.blade.php     | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2d6bf7fa/app/views/partials/user-storage-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-storage-resource-preferences.blade.php b/app/views/partials/user-storage-resource-preferences.blade.php
index b70d48e..16946d6 100644
--- a/app/views/partials/user-storage-resource-preferences.blade.php
+++ b/app/views/partials/user-storage-resource-preferences.blade.php
@@ -35,10 +35,6 @@
             @endforeach
             <option value="">DO-NO-SET</option>
         </select>
-        <!--
-        <input type="text" name="resourceSpecificCredentialStoreToken" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->resourceSpecificCredentialStoreToken}}@endif"/>
-        -->
     </div>
 </div>
 
@@ -48,8 +44,8 @@
         <button type="button" class="btn btn-danger remove-user-storage-resource @if(isset( $allowDelete ) ) @if( !$allowDelete) hide @endif @else hide @endif"
             data-toggle="modal"
             data-target="#remove-user-storage-resource-block"
-            data-cr-name="{{$storageResource->hostName}}"
-            data-cr-id="{{$storageResource->storageResourceId}}">
+            data-sr-name="{{$storageResource->hostName}}"
+            data-sr-id="{{$storageResource->storageResourceId}}">
             Remove
         </button>
     </div>


[18/18] airavata-php-gateway git commit: AIRAVATA-2152 Removing TODO, will leave in AccountController

Posted by sm...@apache.org.
AIRAVATA-2152 Removing TODO, will leave in AccountController


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/6d121230
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/6d121230
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/6d121230

Branch: refs/heads/develop
Commit: 6d121230ce05d6dff47988f0004e0fc1b30b9786
Parents: 480021c
Author: Marcus Christie <ma...@iu.edu>
Authored: Fri Oct 28 15:06:25 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:06:25 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6d121230/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 6037dda..65bcdc8 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -467,7 +467,6 @@ class AccountController extends BaseController
         Session::put("notice-seen", true);
     }
 
-    // TODO: maybe move the UserResourceProfile stuff to its own controller?
     public function getCredentialStore() {
 
         $userResourceProfile = URPUtilities::get_or_create_user_resource_profile();


[11/18] airavata-php-gateway git commit: AIRAVATA-2152 Implement remove button for CR picker

Posted by sm...@apache.org.
AIRAVATA-2152 Implement remove button for CR picker


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/8f0cc363
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/8f0cc363
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/8f0cc363

Branch: refs/heads/develop
Commit: 8f0cc3631e39f735228b1901ec860cca74ac9526
Parents: 9544427
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Oct 20 16:00:02 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:04:31 2016 -0400

----------------------------------------------------------------------
 app/views/account/user-compute-resources.blade.php | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8f0cc363/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index 4d451ba..4b9330a 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -31,6 +31,8 @@ button.add-user-cr {
     <button class="btn btn-default add-user-cr">
         <span class="glyphicon glyphicon-plus"></span> Add a Compute Resource Account
     </button>
+    <div id="add-user-compute-resource-block-container">
+    </div>
     <div class="panel-group" id="accordion">
         @foreach( (array)$userResourceProfile->userComputeResourcePreferences as $indexUserCRP => $user_crp )
         <div class="panel panel-default">
@@ -79,8 +81,7 @@ button.add-user-cr {
                     <option value="{{ $cr->computeResourceId}}">{{ $cr->hostName }}</option>
                     @endforeach
                 </select>
-                <!-- TODO: implement the remove behavior -->
-                <span class="input-group-addon remove-cr" style="cursor:pointer;">x</span>
+                <span class="input-group-addon remove-user-cr" style="cursor:pointer;">x</span>
             </div>
             <div class="user-cr-pref-space form-horizontal"></div>
         </form>
@@ -126,17 +127,20 @@ button.add-user-cr {
 
 $('.add-user-cr').on('click', function(){
 
-    $(this).after( $(".add-user-compute-resource-block").html() );
+    $('#add-user-compute-resource-block-container').append( $(".add-user-compute-resource-block").html() );
 });
 $(".remove-user-compute-resource").click( function(){
 	$(".remove-user-cr-name").html( $(this).data("cr-name") );
 	$(".remove-user-crId").val( $(this).data("cr-id") );
 });
-$("body").on("change", "#user-cr-select", function(){
+$("#add-user-compute-resource-block-container").on("change", "#user-cr-select", function(){
     crId = $(this).val();
     //This is done as Jquery creates problems when using period(.) in id or class.
     crId = crId.replace(/\./g,"_");
-    $(".user-cr-pref-space").html($("#cr-" + crId).html());
+    $("#add-user-compute-resource-block-container .user-cr-pref-space").html($("#cr-" + crId).html());
+});
+$("#add-user-compute-resource-block-container").on("click", ".remove-user-cr", function(){
+    $("#add-user-compute-resource-block-container").empty();
 });
 
 /* making datetimepicker work for reservation start and end date kept in user-compute-resource-preferences blade*/


[06/18] airavata-php-gateway git commit: AIRAVATA-2152 Support for deleting user compute resources prefs

Posted by sm...@apache.org.
AIRAVATA-2152 Support for deleting user compute resources prefs


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/17425c08
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/17425c08
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/17425c08

Branch: refs/heads/develop
Commit: 17425c084ef45a9cf7f98884f98b7507c5cfaa93
Parents: 6555a6e
Author: Marcus Christie <ma...@gmail.com>
Authored: Fri Oct 14 11:57:19 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:04:29 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php           | 10 +++-
 app/libraries/URPUtilities.php                  |  8 +++
 app/routes.php                                  |  1 +
 .../account/user-compute-resources.blade.php    | 54 +++++++++++++-----
 .../user-compute-resource-preferences.blade.php | 58 +++++++++++---------
 5 files changed, 91 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/17425c08/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 1fe9d80..bf069db 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -562,7 +562,6 @@ class AccountController extends BaseController
 
     public function addUserComputeResourcePreference() {
 
-        // TODO: flash message isn't setup in the view
         if( URPUtilities::add_or_update_user_CRP( Input::all()) )
         {
             return Redirect::to("account/user-compute-resources")->with("message","Compute Resource Account Settings have been saved.");
@@ -576,4 +575,13 @@ class AccountController extends BaseController
             return Redirect::to("account/user-compute-resources")->with("message","Compute Resource Account Settings have been updated.");
         }
     }
+
+    public function deleteUserComputeResourcePreference() {
+        $computeResourceId = Input::get("rem-user-crId");
+        $result = URPUtilities::delete_user_CRP( $computeResourceId );
+        if( $result )
+        {
+            return Redirect::to("account/user-compute-resources")->with("message","Compute Resource Account Settings have been deleted.");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/17425c08/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index 026b06e..3da8f21 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -93,6 +93,14 @@ class URPUtilities
         }
     }
 
+    public static function delete_user_CRP($computeResourceId)
+    {
+        $userId = Session::get('username');
+        $gatewayId = Session::get('gateway_id');
+        $result = Airavata::deleteUserComputeResourcePreference(Session::get('authz-token'), $userId, $gatewayId, $computeResourceId);
+        return $result;
+    }
+
     // Only used for testing
     public static function delete_user_resource_profile()
     {

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/17425c08/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index b8b5aeb..ffb6850 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -56,6 +56,7 @@ Route::post("account/delete-credential", "AccountController@deleteCredential");
 Route::get("account/user-compute-resources", "AccountController@getComputeResources");
 Route::post("account/add-user-crp", "AccountController@addUserComputeResourcePreference");
 Route::post("account/update-user-crp", "AccountController@updateUserComputeResourcePreference");
+Route::post("account/delete-user-crp", "AccountController@deleteUserComputeResourcePreference");
 
 /*
  * The following routes will not work without logging in.

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/17425c08/app/views/account/user-compute-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-compute-resources.blade.php b/app/views/account/user-compute-resources.blade.php
index a8dbff7..a1a1f99 100644
--- a/app/views/account/user-compute-resources.blade.php
+++ b/app/views/account/user-compute-resources.blade.php
@@ -7,6 +7,9 @@ button.add-user-cr {
     margin-top: 10px;
     margin-bottom: 10px;
 }
+#user-cr-select-input-group {
+    margin-bottom: 10px;
+}
 </style>
 @stop
 
@@ -36,16 +39,8 @@ button.add-user-cr {
                     <a class="accordion-toggle collapsed"
                        data-toggle="collapse" data-parent="#accordion"
                        href="#collapse-user-crp-{{$indexUserCRP}}">
-                        HOSTNAME TODO: {{$user_crp->computeResourceId}}
+                        {{$user_crp->crDetails->hostName}}
                     </a>
-                    <div class="pull-right col-md-2 fade">
-                        <span class="glyphicon glyphicon-remove remove-compute-resource"
-                              style="cursor:pointer;" data-toggle="modal"
-                              data-target="#remove-compute-resource-block"
-                              data-cr-name="TODO"
-                              data-cr-id="{{$user_crp->computeResourceId}}"
-                              data-gp-id="{{ $userResourceProfile->gatewayID }}"></span>
-                    </div>
                 </h4>
             </div>
             <div id="collapse-user-crp-{{$indexUserCRP}}"
@@ -62,7 +57,8 @@ button.add-user-cr {
                         <div class="form-horizontal">
                             @include('partials/user-compute-resource-preferences',
                             array('computeResource' => $user_crp->crDetails,
-                            'preferences'=>$user_crp, 'show'=>true))
+                            'preferences'=>$user_crp, 'show'=>true,
+                            'allowDelete'=>true))
                         </div>
                     </form>
                 </div>
@@ -73,12 +69,11 @@ button.add-user-cr {
 </div>
 <div class="add-user-compute-resource-block hide">
     <div class="well">
-        <!-- TODO: need to implement /add-user-crp -->
         <form action="{{URL::to('/')}}/account/add-user-crp" method="POST">
             <input type="hidden" name="gatewayId" id="gatewayId" value="{{$userResourceProfile->gatewayID}}">
 
-            <div class="input-group">
-                <select name="computeResourceId" class="cr-select form-control">
+            <div id="user-cr-select-input-group" class="input-group">
+                <select id="user-cr-select" name="computeResourceId" class="form-control">
                     <option value="">Select a Compute Resource and configure your account</option>
                     @foreach( (array)$unselectedCRs as $index => $cr)
                     <option value="{{ $cr->computeResourceId}}">{{ $cr->hostName }}</option>
@@ -91,6 +86,33 @@ button.add-user-cr {
         </form>
     </div>
 </div>
+
+<div class="modal fade" id="remove-user-compute-resource-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
+    <div class="modal-dialog">
+
+        <form action="{{URL::to('/')}}/account/delete-user-crp" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Remove Compute Resource Account Confirmation</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control remove-user-crId" name="rem-user-crId"/>
+
+                    Do you really want to remove your Compute Resource Account settings for <span class="remove-user-cr-name"> </span>?
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-danger" value="Remove"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                    </div>
+                </div>
+            </div>
+
+        </form>
+    </div>
+</div>
+
 <pre>
     {{var_dump($userResourceProfile)}}
 </pre>
@@ -104,7 +126,11 @@ $('.add-user-cr').on('click', function(){
 
     $(this).after( $(".add-user-compute-resource-block").html() );
 });
-$("body").on("change", ".cr-select", function(){
+$(".remove-user-compute-resource").click( function(){
+	$(".remove-user-cr-name").html( $(this).data("cr-name") );
+	$(".remove-user-crId").val( $(this).data("cr-id") );
+});
+$("body").on("change", "#user-cr-select", function(){
     crId = $(this).val();
     //This is done as Jquery creates problems when using period(.) in id or class.
     crId = crId.replace(/\./g,"_");

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/17425c08/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
index af70ecc..0e2036c 100644
--- a/app/views/partials/user-compute-resource-preferences.blade.php
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -2,6 +2,7 @@
     computeResource - (required, ComputeResourceDescription) the compute resource object
     preferences - (optional, UserComputeResourcePreference) the saved preference data
     show - (optional, boolean)
+    allowDelete - (optional, boolean)
 -->
 <!-- String replace is done as Jquery creates problems when using period(.) in id or class. -->
 <div id="cr-{{ str_replace( '.', "_", $computeResource->computeResourceId) }}" class="@if(isset( $show) ) @if( !$show) hide @endif @else hide @endif">
@@ -96,37 +97,44 @@ if( isset( $preferences) && $preferences->reservationEndTime != '')
     $reservationEndTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone") . " hours", $preferences->reservationEndTime/1000);
 
 ?>
-<div class="form-group col-md-6">
-    <label class="control-label col-md-3">Reservation Start Time</label>
-
-    <div class="input-group date datetimepicker1">
-        <input type="text" name="reservationStartTime" class="form-control"
-               value="@if( isset( $preferences) )@if( trim($preferences->reservationStartTime) != '' || $preferences->reservationStartTime != null){{date('m/d/Y h:i:s A', intval( $reservationStartTime))}}@endif @endif"/>
-        <span class="input-group-addon">
-            <span class="glyphicon glyphicon-calendar"></span>
-        </span>
+
+<div class="row">
+    <div class="form-group col-md-6">
+        <label class="control-label col-md-3">Reservation Start Time</label>
+
+        <div class="input-group date datetimepicker1">
+            <input type="text" name="reservationStartTime" class="form-control"
+                   value="@if( isset( $preferences) )@if( trim($preferences->reservationStartTime) != '' || $preferences->reservationStartTime != null){{date('m/d/Y h:i:s A', intval( $reservationStartTime))}}@endif @endif"/>
+            <span class="input-group-addon">
+                <span class="glyphicon glyphicon-calendar"></span>
+            </span>
+        </div>
     </div>
-</div>
 
-<div class="form-group col-md-6">
-    <label class="control-label col-md-3">Reservation End Time</label>
+    <div class="form-group col-md-6">
+        <label class="control-label col-md-3">Reservation End Time</label>
 
-    <div class="input-group date datetimepicker2">
-        <input type="text" name="reservationEndTime" class="form-control"
-               value="@if( isset( $preferences) )@if( trim($preferences->reservationEndTime) != ''|| $preferences->reservationStartTime != null){{date('m/d/Y h:i:s A', intval($reservationEndTime))}}@endif @endif"/>
-        <span class="input-group-addon">
-            <span class="glyphicon glyphicon-calendar"></span>
-        </span>
+        <div class="input-group date datetimepicker2">
+            <input type="text" name="reservationEndTime" class="form-control"
+                   value="@if( isset( $preferences) )@if( trim($preferences->reservationEndTime) != ''|| $preferences->reservationStartTime != null){{date('m/d/Y h:i:s A', intval($reservationEndTime))}}@endif @endif"/>
+            <span class="input-group-addon">
+                <span class="glyphicon glyphicon-calendar"></span>
+            </span>
+        </div>
     </div>
 </div>
 
-<div class="form-group col-md-12 text-center">
-    <input type="submit" class="btn btn-primary submit-user-crp-form" value="Save"/>
-</div>
+<div class="row">
+    <div class="form-group col-md-12 text-center">
+        <input type="submit" class="btn btn-primary" value="Save"/>
+        <button type="button" class="btn btn-danger remove-user-compute-resource @if(isset( $allowDelete ) ) @if( !$allowDelete) hide @endif @else hide @endif"
+            data-toggle="modal"
+            data-target="#remove-user-compute-resource-block"
+            data-cr-name="{{$computeResource->hostName}}"
+            data-cr-id="{{$computeResource->computeResourceId}}">
+            Remove
+        </button>
+    </div>
 </div>
 
-<div class="loading-gif text-center hide">
-    <img  src='{{URL::to('/')}}/assets/ajax-loader.gif'/>
 </div>
-<div class="col-md-offset-2 col-md-8 alert alert-success hide">Compute Resource Preferences have been updated.</div>
-<div class="col-md-offset-2 col-md-8 alert alert-danger hide">An error has occurred.</div>
\ No newline at end of file


[09/18] airavata-php-gateway git commit: AIRAVATA-2152 Only show unselected compute resources

Posted by sm...@apache.org.
AIRAVATA-2152 Only show unselected compute resources


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/d7cffc61
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/d7cffc61
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/d7cffc61

Branch: refs/heads/develop
Commit: d7cffc616d271dc61c21a73954a7f8c0927e647a
Parents: 18a98fd
Author: Marcus Christie <ma...@iu.edu>
Authored: Wed Oct 19 17:06:00 2016 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Oct 28 15:04:30 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d7cffc61/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index bf069db..8e88e90 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -537,7 +537,9 @@ class AccountController extends BaseController
     }
 
     public function getComputeResources(){
+
         $userResourceProfile = URPUtilities::get_or_create_user_resource_profile();
+
         $allCRs = CRUtilities::getAllCRObjects();
         foreach( $allCRs as $index => $crObject)
         {
@@ -546,16 +548,20 @@ class AccountController extends BaseController
         // Add crDetails to each UserComputeResourcePreference
         foreach ($userResourceProfile->userComputeResourcePreferences as $index => $userCompResPref) {
             $userCompResPref->crDetails = $allCRsById[$userCompResPref->computeResourceId];
+            // To figure out the unselectedCRs, remove this compute resource from allCRsById
+            unset($allCRsById[$userCompResPref->computeResourceId]);
         }
+        $unselectedCRs = array_values($allCRsById);
+
         // TODO: actually get all of the user's credential store tokens, including description
         $tokens = array(
             $userResourceProfile->credentialStoreToken => "Default SSH Key"
         );
+
         return View::make("account/user-compute-resources", array(
             "userResourceProfile" => $userResourceProfile,
             "computeResources" => $allCRs,
-            // TODO: only show compute resources that user hasn't already configured with an account
-            "unselectedCRs" => $allCRs,
+            "unselectedCRs" => $unselectedCRs,
             "tokens" => $tokens
         ));
     }