airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [18/20] airavata-php-gateway git commit: Removed edit links from browse
Date Wed, 17 Aug 2016 15:33:05 GMT
Removed edit links from browse


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

Branch: refs/heads/develop
Commit: ebdc1631bb67c6a03703e16115bf9d8b07a868e2
Parents: 2fe80e7
Author: Jeff Kinnison <jeffdkinnison@gmail.com>
Authored: Wed Aug 17 10:35:38 2016 -0400
Committer: Jeff Kinnison <jeffdkinnison@gmail.com>
Committed: Wed Aug 17 10:35:38 2016 -0400

----------------------------------------------------------------------
 app/controllers/ExperimentController.php          |  7 +++++++
 app/views/partials/experiment-container.blade.php | 16 ++++++++--------
 app/views/partials/experiment-info.blade.php      |  2 ++
 3 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ebdc1631/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index bb58779..b884a17 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -313,12 +313,19 @@ class ExperimentController extends BaseController
         $expContainer = ExperimentUtilities::get_expsearch_results_with_pagination(Input::all(),
$this->limit,
             ($pageNo - 1) * $this->limit);
         $experimentStates = ExperimentUtilities::getExpStates();
+
+        $can_write = array();
+        foreach ($expContainer as $experiment) {
+            $can_write[$experiment->experimentId] = SharingUtilities::userCanWrite(Session::get("username"),
$experiment->experimentId, ResourceType::EXPERIMENT);
+        }
+
         return View::make('experiment/browse', array(
             'input' => Input::all(),
             'pageNo' => $pageNo,
             'limit' => $this->limit,
             'expStates' => $experimentStates,
             'expContainer' => $expContainer,
+            'can_write' => $can_write
         ));
     }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ebdc1631/app/views/partials/experiment-container.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-container.blade.php b/app/views/partials/experiment-container.blade.php
index 4ecf3de..25f99c7 100644
--- a/app/views/partials/experiment-container.blade.php
+++ b/app/views/partials/experiment-container.blade.php
@@ -24,11 +24,11 @@
             @foreach($expContainer as $experiment)
                 <tr>
                     <!-- Experiment Name -->
-                    <td> 
+                    <td>
                         <a href="{{URL::to('/')}}/experiment/summary?expId={{$experiment['experiment']->experimentId}}"
target="_blank">
-                        {{ $experiment['experiment']->name }} 
+                        {{ $experiment['experiment']->name }}
                         </a>
-                        @if( $experiment['expValue']['editable'])
+                        @if( $experiment['expValue']['editable'] and $can_write[$experiment->experimentId]
=== true)
                             <a href="{{URL::to('/')}}/experiment/edit?expId={{$experiment['experiment']->experimentId}}"
title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>
                         @endif
                     </td>
@@ -41,7 +41,7 @@
                     @endif
                     <!-- Resource Name -->
                     <td>
-                        @if( !empty( explode("_", $experiment['experiment']->resourceHostId)[0]
) ) 
+                        @if( !empty( explode("_", $experiment['experiment']->resourceHostId)[0]
) )
                             {{ explode("_", $experiment['experiment']->resourceHostId)[0]
}}
                         @endif
                     </td>
@@ -53,18 +53,18 @@
                             {{$experiment['expValue']['experimentStatusString'] }}
                         </a>
                     </td>
-                    @if( isset( $dashboard)) 
+                    @if( isset( $dashboard))
                     <td class="text-center">
                         <a class="get-exp-stats" data-expid="{{$experiment['experiment']->experimentId}}"
style="cursor: pointer;">
                         <span class="glyphicon glyphicon-stats"></span>
                         </a>
                     </td>
                     @endif
-                    
+
                 </tr>
             @endforeach
-           
+
         </table>
     </div>
     @endif
-@endif
\ No newline at end of file
+@endif

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ebdc1631/app/views/partials/experiment-info.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php
index fa6a605..36c9fe2 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -225,6 +225,7 @@
                 Clone
             </a>
             <input type="hidden" name="expId" value="{{ Input::get('expId') }}"/>
+            @if($can_write === true)
             <a href="{{URL::to('/') }}/experiment/edit?expId={{ $experiment->experimentId
}}&savedExp=true"
                class="btn btn-default"
                role="button"
@@ -232,6 +233,7 @@
                 <span class="glyphicon glyphicon-pencil"></span>
                 Edit
             </a>
+            @endif
         </div>
     </form>
     @endif


Mime
View raw message