You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/07/05 13:57:50 UTC
[2/2] airavata-php-gateway git commit: Airavata-1749 merging browse
and search in experiments and projects
Airavata-1749 merging browse and search in experiments and projects
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/3a69012f
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3a69012f
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3a69012f
Branch: refs/heads/master
Commit: 3a69012f315aff6763aadb1d13cf5c0672858976
Parents: dd594c4
Author: Supun Nakandala <sc...@apache.org>
Authored: Sun Jul 5 17:27:29 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Sun Jul 5 17:27:29 2015 +0530
----------------------------------------------------------------------
app/controllers/ExperimentController.php | 44 +---
app/controllers/ProjectController.php | 42 +---
app/libraries/CommonUtilities.php | 2 -
app/libraries/ExperimentUtilities.php | 38 ++--
app/routes.php | 8 -
app/views/experiment/browse.blade.php | 294 +++++++++++++++-----------
app/views/experiment/search.blade.php | 203 ------------------
app/views/project/browse.blade.php | 89 +++++---
app/views/project/search.blade.php | 136 ------------
app/views/resource/browse.blade.php | 17 +-
10 files changed, 273 insertions(+), 600 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 8b568db..f2140b2 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -7,7 +7,7 @@ class ExperimentController extends BaseController
* Limit used in fetching paginated results
* @var int
*/
- var $limit = 20;
+ var $limit = 10;
/**
* Instantiate a new ExperimentController Instance
@@ -219,44 +219,6 @@ class ExperimentController extends BaseController
return View::make("home");
}
- public function searchView()
- {
- $experimentStates = ExperimentUtilities::getExpStates();
- return View::make("experiment/search", array("expStates" => $experimentStates));
- }
-
- public function searchSubmit()
- {
- $search = Input::get('search');
- if (isset($search)) {
- $pageNo = 1;
- } else {
- $pageNo = Input::get('pageNo');
- $prev = Input::get('prev');
- if (empty($pageNo)) {
- $pageNo = 1;
- } else {
- if (isset($prev)) {
- $pageNo -= 1;
- } else {
- $pageNo += 1;
- }
- }
- }
-
- $expContainer = ExperimentUtilities::get_expsearch_results_with_pagination(Input::all(), $this->limit,
- ($pageNo - 1) * $this->limit);
-
- $experimentStates = ExperimentUtilities::getExpStates();
- return View::make('experiment/search', array(
- 'input' => Input::all(),
- 'pageNo' => $pageNo,
- 'limit' => $this->limit,
- 'expStates' => $experimentStates,
- 'expContainer' => $expContainer
- ));
- }
-
public function getQueueView()
{
$queues = ExperimentUtilities::getQueueDatafromResourceId(Input::get("crId"));
@@ -282,8 +244,10 @@ class ExperimentController extends BaseController
}
}
- $expContainer = ExperimentUtilities::get_all_user_experiments_with_pagination($this->limit, ($pageNo - 1) * $this->limit);
+ $expContainer = ExperimentUtilities::get_expsearch_results_with_pagination(Input::all(), $this->limit,
+ ($pageNo - 1) * $this->limit);
$experimentStates = ExperimentUtilities::getExpStates();
+
return View::make('experiment/browse', array(
'pageNo' => $pageNo,
'limit' => $this->limit,
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/controllers/ProjectController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ProjectController.php b/app/controllers/ProjectController.php
index b455bb3..cd39583 100755
--- a/app/controllers/ProjectController.php
+++ b/app/controllers/ProjectController.php
@@ -69,39 +69,6 @@ class ProjectController extends BaseController
}
}
- public function searchView()
- {
- return View::make('project/search');
- }
-
- public function searchSubmit()
- {
- $search = Input::get('search');
- if (isset($search)) {
- $pageNo = 1;
- } else {
- $pageNo = Input::get('pageNo');
- $prev = Input::get('prev');
- if (empty($pageNo)) {
- $pageNo = 1;
- } else {
- if (isset($prev)) {
- $pageNo -= 1;
- } else {
- $pageNo += 1;
- }
- }
- }
-
- $projects = ProjectUtilities::get_projsearch_results_with_pagination(Input::get("search-key"),
- Input::get("search-value"), $this->limit, ($pageNo - 1) * $this->limit);
- return View::make('project/search', array(
- 'pageNo' => $pageNo,
- 'limit' => $this->limit,
- 'projects' => $projects)
- );
- }
-
public function browseView()
{
$pageNo = Input::get('pageNo');
@@ -116,7 +83,14 @@ class ProjectController extends BaseController
}
}
- $projects = ProjectUtilities::get_all_user_projects_with_pagination($this->limit, ($pageNo - 1) * $this->limit);
+ $searchValue = Input::get("search-value");
+ if(!empty($searchValue)){
+ $projects = ProjectUtilities::get_projsearch_results_with_pagination(Input::get("search-key"),
+ Input::get("search-value"), $this->limit, ($pageNo - 1) * $this->limit);
+ }else{
+ $projects = ProjectUtilities::get_all_user_projects_with_pagination($this->limit, ($pageNo - 1) * $this->limit);
+ }
+
return View::make('project/browse', array(
'pageNo' => $pageNo,
'limit' => $this->limit,
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/libraries/CommonUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php
index 7b7ee09..a8eb40e 100644
--- a/app/libraries/CommonUtilities.php
+++ b/app/libraries/CommonUtilities.php
@@ -105,13 +105,11 @@ class CommonUtilities
'Project' => array
(
array('label' => 'Create', 'url' => URL::to('/') . '/project/create', "nav-active" => "project"),
- array('label' => 'Search', 'url' => URL::to('/') . '/project/search', "nav-active" => "project"),
array('label' => 'Browse', 'url' => URL::to('/') . '/project/browse', "nav-active" => "project")
),
'Experiment' => array
(
array('label' => 'Create', 'url' => URL::to('/') . '/experiment/create', "nav-active" => "experiment"),
- array('label' => 'Search', 'url' => URL::to('/') . '/experiment/search', "nav-active" => "experiment"),
array('label' => 'Browse', 'url' => URL::to('/') . '/experiment/browse', "nav-active" => "experiment")
)
);
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index f1aaa6e..c73d4e6 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -714,24 +714,28 @@ class ExperimentUtilities
try {
$filters = array();
- if ($inputs["status-type"] != "ALL") {
- $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::STATUS] = $inputs["status-type"];
+ if(!empty($inputs["status-type"])){
+ if ($inputs["status-type"] != "ALL") {
+ $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::STATUS] = $inputs["status-type"];
+ }
}
- switch ($inputs["search-key"]) {
- case 'experiment-name':
- $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_NAME] = $inputs["search-value"];
- break;
- case 'experiment-description':
- $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_DESC] = $inputs["search-value"];
- break;
- case 'application':
- $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::APPLICATION_ID] = $inputs["search-value"];
- break;
- case 'creation-time':
- $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::FROM_DATE] = strtotime($inputs["from-date"]) * 1000;
- $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::TO_DATE] = strtotime($inputs["to-date"]) * 1000;
- break;
- case '':
+ if(!empty($inputs["search-key"])){
+ switch ($inputs["search-key"]) {
+ case 'experiment-name':
+ $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_NAME] = $inputs["search-value"];
+ break;
+ case 'experiment-description':
+ $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_DESC] = $inputs["search-value"];
+ break;
+ case 'application':
+ $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::APPLICATION_ID] = $inputs["search-value"];
+ break;
+ case 'creation-time':
+ $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::FROM_DATE] = strtotime($inputs["from-date"]) * 1000;
+ $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::TO_DATE] = strtotime($inputs["to-date"]) * 1000;
+ break;
+ case '':
+ }
}
$experiments = Airavata::searchExperiments(
Session::get('gateway_id'), Session::get('username'), $filters, $limit, $offset);
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index e6fb483..8e1493e 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -46,10 +46,6 @@ Route::post("project/create", "ProjectController@createSubmit");
Route::get("project/summary", "ProjectController@summary");
-Route::get("project/search", "ProjectController@searchView");
-
-Route::post("project/search", "ProjectController@searchSubmit");
-
Route::get("project/edit", "ProjectController@editView");
Route::post("project/edit", "ProjectController@editSubmit");
@@ -70,10 +66,6 @@ Route::get("experiment/summary", "ExperimentController@summary");
Route::post("experiment/summary", "ExperimentController@expChange");
-Route::get("experiment/search", "ExperimentController@searchView");
-
-Route::post("experiment/search", "ExperimentController@searchSubmit");
-
Route::get("experiment/edit", "ExperimentController@editView");
Route::post("experiment/edit", "ExperimentController@editSubmit");
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/views/experiment/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/browse.blade.php b/app/views/experiment/browse.blade.php
index 105a65d..5fc003e 100755
--- a/app/views/experiment/browse.blade.php
+++ b/app/views/experiment/browse.blade.php
@@ -1,122 +1,119 @@
@extends('layout.basic')
-@section('content')
+@section('page-header')
+@parent
+{{ HTML::style('css/datetimepicker.css')}}
-<div class="container" style="max-width: 750px;">
- <h1>Browse Experiments</h1>
+@stop
- <?php
+@section('content')
- if (isset($expContainer))
- {
- ?>
- <!-- Pagination handling-->
- <form id="paginationForm" action="{{URL::to('/')}}/experiment/browse" method="post" class="form-inline" role="form">
- <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
- <?php
- if ($pageNo != 1) {
- echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
- }
- if (sizeof($expContainer) > 0) {
- echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
- }
- ?>
- </div>
- <div class="pull-left">
- <?php if (sizeof($expContainer) != 0) echo 'Showing results from ' . strval(($pageNo - 1) * $limit + 1)
- . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($expContainer))); ?>
+<div class="container" style="max-width: 80%;">
+ <form action="{{URL::to('/')}}/experiment/search" method="post" class="form-inline" role="form">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3>Search for Experiments</h3>
+ </div>
+ <div class="panel-body">
+ <div class="form-group">
+ <label for="search-key">Search by</label>
+ <select class="form-control" name="search-key" id="search-key">
+ <?php
+
+ // set up options for select input
+ $values = array('experiment-name', 'experiment-description', 'application', 'creation-time');
+ $labels = array('Experiment Name', 'Experiment Description', 'Application', 'Creation Time');
+ $disabled = array('', '', '', '');
+
+ ExperimentUtilities::create_options($values, $labels, $disabled);
+
+ ?>
+ </select>
+ </div>
+
+ <div class="form-group search-text-block">
+ <label for="search-value">for</label>
+ <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value" required
+ value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
+ </div>
+
+ <select name="status-type" class="form-control select-status">
+ <option value="ALL">Status</option>
+ <?php
+ foreach ($expStates as $index => $state) {
+ if (isset($input) && $state == $input["status-type"]) {
+ echo '<option value="' . $state . '" selected>' . $state . '</option>';
+ } else {
+ echo '<option value="' . $state . '">' . $state . '</option>';
+ }
+ }
+ ?>
+ </select>
+
+ <div class="container select-dates hide">
+ <div class="col-md-12">
+ Select dates between which you want to search for experiments.
+ </div>
+ <div class="col-sm-8" style="height:75px;">
+ <div class='col-md-6'>
+ <div class="form-group">
+ <div class='input-group date' id='datetimepicker9'>
+ <input type='text' class="form-control" placeholder="From Date" name="from-date"
+ value="<?php if (isset($_POST['from-date'])) echo $_POST['from-date'] ?>"/>
+ <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
+ </span>
+ </div>
+ </div>
+ </div>
+ <div class='col-md-6'>
+ <div class="form-group">
+ <div class='input-group date' id='datetimepicker10'>
+ <input type='text' class="form-control" placeholder="To Date" name="to-date"
+ value="<?php if (isset($_POST['to-date'])) echo $_POST['to-date'] ?>"/>
+ <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <button name="search" type="submit" class="btn btn-primary pull-right" value="Search"><span
+ class="glyphicon glyphicon-search"></span> Search
+ </button>
+ <p class="help-block">You can use * as a wildcard character. Tip: search for * alone to retrieve all of your
+ experiments.</p>
+
+ </div>
</div>
- <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
-
- <div style="clear: both"></div>
- </form>
- <?php
- if (sizeof($expContainer) == 0)
- {
- if ($pageNo == 1) {
- CommonUtilities::print_warning_message('No results found. Please try again.');
- } else {
- CommonUtilities::print_warning_message('No more results found.');
- }
- }
- else
- {
- ?>
- <div id="re" class="table-responsive">
- <table class="table">
- <tr>
- <th>Name</th>
- <th>Application</th>
- <th>Description</th>
- <!--<th>Resource</th>-->
- <th>Creation Time</th>
- <th>Status</th>
- <!-- <select class="form-control select-status">-->
- <!-- <option value="ALL">Status</option>-->
- <!-- @foreach( $expStates as $index => $state)-->
- <!-- <option value="{{ $state }}">{{ $state }}</option>-->
- <!-- @endforeach-->
- <!-- </select>-->
- <!-- </th>-->
- </tr>
-
-
- <?php
- foreach ($expContainer as $experiment) {
- $description = $experiment['experiment']->description;
- if (strlen($description) > 17) // 17 is arbitrary
- {
- $description = substr($experiment['experiment']->description, 0, 17) . '<span class="text-muted">...</span>';
+ <!-- Pagination Handling -->
+ <?php
+ if (isset($expContainer)) {
+ ?>
+ <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
+ <?php
+ if ($pageNo != 1) {
+ echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
}
-
- echo '<tr>';
- $addEditOption = "";
- if ($experiment['expValue']['editable'])
- $addEditOption = '<a href="' . URL::to('/') . '/experiment/edit?expId=' . $experiment['experiment']->experimentID . '" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>';
-
- echo '<td>' . $experiment['experiment']->name . $addEditOption . '</td>';
-
- echo '<td>' . $experiment['expValue']['applicationInterface']->applicationName . '</td>';
-
- echo '<td>' . $description . '</td>';
-
- //echo "<td>$computeResource->hostName</td>";
- echo '<td class="time" unix-time="' . $experiment['experiment']->creationTime / 1000 . '"></td>';
-
-
- switch ($experiment['expValue']['experimentStatusString']) {
- case 'CANCELING':
- case 'CANCELED':
- case 'UNKNOWN':
- $textClass = 'text-warning';
- break;
- case 'FAILED':
- $textClass = 'text-danger';
- break;
- case 'COMPLETED':
- $textClass = 'text-success';
- break;
- default:
- $textClass = 'text-info';
- break;
+ if (sizeof($expContainer) > 0) {
+ echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
}
-
?>
- <td>
- <a class="<?php echo $textClass; ?>"
- href="{{ URL::to('/') }}/experiment/summary?expId=<?php echo $experiment['experiment']->experimentID; ?>">
- <?php echo $experiment['expValue']['experimentStatusString']; ?>
- </a>
- </td>
- </tr>
- <?php
- }
- }
- }
- ?>
- </table>
- </div>
+ </div>
+ <div class="pull-left">
+ <?php if (sizeof($expContainer) != 0) echo 'Showing experiments from ' . strval(($pageNo - 1) * $limit + 1)
+ . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($expContainer))); ?>
+ </div>
+ <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
+ <div style="clear: both"></div>
+ <?php
+ }
+ ?>
+ </form>
+
+ @include('partials/experiment-container')
+
</div>
@stop
@@ -124,35 +121,75 @@
@section('scripts')
@parent
{{ HTML::script('js/time-conversion.js')}}
+{{ HTML::script('js/moment.js')}}
+{{ HTML::script('js/datetimepicker.js')}}
+
<script type="text/javascript">
$(document).ready(function () {
- /* script to make status select work on the UI side itself. */
+//------------------------Commenting Client Side filtering--------------------------------------
+// /* script to make status select work on the UI side itself. */
+//
+// $(".select-status").on("change", function(){
+// selectedStatus = this.value;
+//
+// if( selectedStatus == "ALL")
+// {
+// $("table tr").slideDown();
+// }
+// else
+// {
+// $("table tr").each(function(index) {
+// if (index != 0) {
+//
+// $row = $(this);
+//
+// var status = $.trim( $row.find("td:last").text() );
+// if (status == selectedStatus )
+// {
+// $(this).slideDown();
+// }
+// else {
+// $(this).slideUp();
+// }
+// }
+// });
+// }
+// });
+
+ /* making datetimepicker work for exp search */
+
+ $('#datetimepicker9').datetimepicker({
+ pick12HourFormat: false
+ });
+ $('#datetimepicker10').datetimepicker({
+ pick12HourFormat: false
+ });
+ $("#datetimepicker9").on("dp.change", function (e) {
+ $('#datetimepicker10').data("DateTimePicker").setMinDate(e.date);
+ });
+ $("#datetimepicker10").on("dp.change", function (e) {
+ $('#datetimepicker9').data("DateTimePicker").setMaxDate(e.date);
+ });
- $(".select-status").on("change", function () {
- selectedStatus = this.value;
+ /* selecting creation time */
+ $("#search-key").on("change", function () {
+ if (this.value == "creation-time") {
+ $(".search-text-block").addClass("hide");
+ $(".select-dates").removeClass("hide");
+ $("#search-value").removeAttr("required");
- if (selectedStatus == "ALL") {
- $("table tr").slideDown();
}
else {
- $("table tr").each(function (index) {
- if (index != 0) {
-
- $row = $(this);
-
- var status = $.trim($row.find("td:last").text());
- if (status == selectedStatus) {
- $(this).slideDown();
- }
- else {
- $(this).slideUp();
- }
- }
- });
+ $(".search-text-block").removeClass("hide");
+ $(".select-dates").addClass("hide");
+ $("#search-value").attr("required");
}
});
+
+ changeInputVisibility($("#search-key").val());
+
});
function changeInputVisibility(selectedStatus) {
@@ -169,5 +206,4 @@
}
}
</script>
-
@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/views/experiment/search.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/search.blade.php b/app/views/experiment/search.blade.php
deleted file mode 100755
index 672206e..0000000
--- a/app/views/experiment/search.blade.php
+++ /dev/null
@@ -1,203 +0,0 @@
-@extends('layout.basic')
-
-@section('page-header')
-@parent
-{{ HTML::style('css/datetimepicker.css')}}
-
-@stop
-
-@section('content')
-
-<div class="container" style="max-width: 750px;">
- <h1>Search for Experiments</h1>
-
- <form action="{{URL::to('/')}}/experiment/search" method="post" class="form-inline" role="form">
- <div class="form-group">
- <label for="search-key">Search by</label>
- <select class="form-control" name="search-key" id="search-key">
- <?php
-
- // set up options for select input
- $values = array('experiment-name', 'experiment-description', 'application', 'creation-time');
- $labels = array('Experiment Name', 'Experiment Description', 'Application', 'Creation Time');
- $disabled = array('', '', '', '');
-
- ExperimentUtilities::create_options($values, $labels, $disabled);
-
- ?>
- </select>
- </div>
-
- <div class="form-group search-text-block">
- <label for="search-value">for</label>
- <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value" required
- value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
- </div>
-
- <select name="status-type" class="form-control select-status">
- <option value="ALL">Status</option>
- <?php
- foreach ($expStates as $index => $state) {
- if (isset($input) && $state == $input["status-type"]) {
- echo '<option value="' . $state . '" selected>' . $state . '</option>';
- } else {
- echo '<option value="' . $state . '">' . $state . '</option>';
- }
- }
- ?>
- </select>
-
- <div class="container select-dates hide">
- <div class="col-md-12">
- Select dates between which you want to search for experiments.
- </div>
- <div class="col-sm-8" style="height:75px;">
- <div class='col-md-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker9'>
- <input type='text' class="form-control" placeholder="From Date" name="from-date"
- value="<?php if (isset($_POST['from-date'])) echo $_POST['from-date'] ?>"/>
- <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- <div class='col-md-6'>
- <div class="form-group">
- <div class='input-group date' id='datetimepicker10'>
- <input type='text' class="form-control" placeholder="To Date" name="to-date"
- value="<?php if (isset($_POST['to-date'])) echo $_POST['to-date'] ?>"/>
- <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <button name="search" type="submit" class="btn btn-primary pull-right" value="Search"><span
- class="glyphicon glyphicon-search"></span> Search
- </button>
- <p class="help-block">You can use * as a wildcard character. Tip: search for * alone to retrieve all of your
- experiments.</p>
-
- <!-- Pagination Handling -->
- <?php
- if (isset($expContainer)) {
- ?>
- <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
- <?php
- if ($pageNo != 1) {
- echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
- }
- if (sizeof($expContainer) > 0) {
- echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
- }
- ?>
- </div>
- <div class="pull-left">
- <?php if (sizeof($expContainer) != 0) echo 'Showing results from ' . strval(($pageNo - 1) * $limit + 1)
- . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($expContainer))); ?>
- </div>
- <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
- <div style="clear: both"></div>
- <?php
- }
- ?>
- </form>
-
- @include('partials/experiment-container')
-
-</div>
-
-@stop
-
-@section('scripts')
-@parent
-{{ HTML::script('js/time-conversion.js')}}
-{{ HTML::script('js/moment.js')}}
-{{ HTML::script('js/datetimepicker.js')}}
-
-<script type="text/javascript">
-
- $(document).ready(function () {
-
-//------------------------Commenting Client Side filtering--------------------------------------
-// /* script to make status select work on the UI side itself. */
-//
-// $(".select-status").on("change", function(){
-// selectedStatus = this.value;
-//
-// if( selectedStatus == "ALL")
-// {
-// $("table tr").slideDown();
-// }
-// else
-// {
-// $("table tr").each(function(index) {
-// if (index != 0) {
-//
-// $row = $(this);
-//
-// var status = $.trim( $row.find("td:last").text() );
-// if (status == selectedStatus )
-// {
-// $(this).slideDown();
-// }
-// else {
-// $(this).slideUp();
-// }
-// }
-// });
-// }
-// });
-
- /* making datetimepicker work for exp search */
-
- $('#datetimepicker9').datetimepicker({
- pick12HourFormat: false
- });
- $('#datetimepicker10').datetimepicker({
- pick12HourFormat: false
- });
- $("#datetimepicker9").on("dp.change", function (e) {
- $('#datetimepicker10').data("DateTimePicker").setMinDate(e.date);
- });
- $("#datetimepicker10").on("dp.change", function (e) {
- $('#datetimepicker9').data("DateTimePicker").setMaxDate(e.date);
- });
-
- /* selecting creation time */
- $("#search-key").on("change", function () {
- if (this.value == "creation-time") {
- $(".search-text-block").addClass("hide");
- $(".select-dates").removeClass("hide");
- $("#search-value").removeAttr("required");
-
- }
- else {
- $(".search-text-block").removeClass("hide");
- $(".select-dates").addClass("hide");
- $("#search-value").attr("required");
- }
- });
-
- changeInputVisibility($("#search-key").val());
-
- });
-
- function changeInputVisibility(selectedStatus) {
- if (selectedStatus == "creation-time") {
- $(".search-text-block").addClass("hide");
- $(".select-dates").removeClass("hide");
- $("#search-value").removeAttr("required");
-
- }
- else {
- $(".search-text-block").removeClass("hide");
- $(".select-dates").addClass("hide");
- $("#search-value").attr("required");
- }
- }
-</script>
-@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/views/project/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/project/browse.blade.php b/app/views/project/browse.blade.php
index 5cbd293..62b7c63 100755
--- a/app/views/project/browse.blade.php
+++ b/app/views/project/browse.blade.php
@@ -6,37 +6,70 @@
@section('content')
-<div class="container" style="max-width: 750px;">
-
- <h1>Browse Projects</h1>
- <?php
+<div class="container" style="max-width: 80%;">
+
+ <form action="{{ URL::to('/') }}/project/search" method="post" class="form-inline" role="form">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3>Search for Projects</h3>
+ </div>
+ <div class="panel-body">
+ <div class="form-group">
+ <label for="search-key">Search by</label>
+ <select class="form-control" name="search-key" id="search-key">
+ <option value="project-name">Project Name</option>
+ <option value="project-description">Project description</option>
+ </select>
+ </div>
+
+ <div class="form-group">
+ <label for="search-value">for</label>
+ <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value"
+ value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
+ </div>
+
+ <button name="search" type="submit" class="btn btn-primary" value="Search"><span
+ class="glyphicon glyphicon-search"></span> Search
+ </button>
+ <p class="help-block">You can use * as a wildcard character. Tip: search for * alone to retrieve all of your
+ projects.</p>
+ </div>
+ </div>
- if (isset($projects))
- {
- ?>
- <!-- Pagination handling-->
- <form id="paginationForm" action="{{URL::to('/')}}/project/browse" method="post" class="form-inline" role="form">
- <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
- <?php
- if ($pageNo != 1) {
- echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
- }
- if (sizeof($projects) > 0) {
- echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
- }
+ <!-- Pagination Handling -->
+ <?php
+ if (isset($projects)) {
?>
- </div>
- <div class="pull-left">
- <?php if (sizeof($projects) != 0) echo 'Showing results from ' . strval(($pageNo - 1) * $limit + 1)
- . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($projects))); ?>
- </div>
- <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
-
- <div style="clear: both"></div>
+ <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
+ <?php
+ if ($pageNo != 1) {
+ echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
+ }
+ if (sizeof($projects) > 0) {
+ echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
+ }
+ ?>
+ </div>
+ <div class="pull-left">
+ <?php if (sizeof($projects) != 0) echo 'Showing projects from ' . strval(($pageNo - 1) * $limit + 1)
+ . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($projects))); ?>
+ </div>
+ <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
+ <div style="clear: both"></div>
+ <?php
+ }
+ ?>
</form>
+
+
+
+
<?php
+
+ if (isset($projects))
+ {
/**
* get results
*/
@@ -46,7 +79,11 @@
*/
if (sizeof($projects) == 0)
{
- CommonUtilities::print_warning_message('No results found. Please try again.');
+ if ($pageNo == 1) {
+ CommonUtilities::print_warning_message('No results found. Please try again.');
+ } else {
+ CommonUtilities::print_warning_message('No more results found.');
+ }
}
else
{
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/views/project/search.blade.php
----------------------------------------------------------------------
diff --git a/app/views/project/search.blade.php b/app/views/project/search.blade.php
deleted file mode 100755
index b7c400b..0000000
--- a/app/views/project/search.blade.php
+++ /dev/null
@@ -1,136 +0,0 @@
-@extends('layout.basic')
-
-@section('page-header')
-@parent
-@stop
-
-@section('content')
-
-<div class="container" style="max-width: 750px;">
-
- <h1>Search for Projects</h1>
-
- <form action="{{ URL::to('/') }}/project/search" method="post" class="form-inline" role="form">
- <div class="form-group">
- <label for="search-key">Search by</label>
- <select class="form-control" name="search-key" id="search-key">
- <option value="project-name">Project Name</option>
- <option value="project-description">Project description</option>
- </select>
- </div>
-
- <div class="form-group">
- <label for="search-value">for</label>
- <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value" required
- value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
- </div>
-
- <button name="search" type="submit" class="btn btn-primary" value="Search"><span
- class="glyphicon glyphicon-search"></span> Search
- </button>
- <p class="help-block">You can use * as a wildcard character. Tip: search for * alone to retrieve all of your
- projects.</p>
-
- <!-- Pagination Handling -->
- <?php
- if (isset($projects)) {
- ?>
- <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
- <?php
- if ($pageNo != 1) {
- echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
- }
- if (sizeof($projects) > 0) {
- echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
- }
- ?>
- </div>
- <div class="pull-left">
- <?php if (sizeof($projects) != 0) echo 'Showing results from ' . strval(($pageNo - 1) * $limit + 1)
- . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($projects))); ?>
- </div>
- <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
- <div style="clear: both"></div>
- <?php
- }
- ?>
- </form>
-
-
-
-
-
- <?php
-
- if (isset($projects))
- {
- /**
- * get results
- */
-
- /**
- * display results
- */
- if (sizeof($projects) == 0)
- {
- if ($pageNo == 1) {
- CommonUtilities::print_warning_message('No results found. Please try again.');
- } else {
- CommonUtilities::print_warning_message('No more results found.');
- }
- }
- else
- {
- ?>
- <div class="table-responsive">
- <table class="table">
-
- <tr>
-
- <th>Name</th>
- <th>Creation Time</th>
- <th>Experiments</th>
-
- </tr>
- <?php
-
- foreach ($projects as $project) {
-
- ?>
- <tr>
- <td>
- <?php echo $project->name; ?>
- <a href="{{URL::to('/')}}/project/edit?projId=<?php echo $project->projectID; ?>" title="Edit">
- <span class="glyphicon glyphicon-pencil"></span>
- </a>
- </td>
- <td class="time" unix-time="
- <?php echo $project->creationTime / 1000 ?>">
- </td>
- <td>
- <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>">
- <span class="glyphicon glyphicon-list"></span>
- </a>
- <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>"> View</a>
- </td>
- </tr>
- <?php
-
- }
-
- echo '</table>';
- echo '</div>';
- }
-
- }
-
- ?>
-
-
- </div>
-
- @stop
- @section('scripts')
- @parent
- {{ HTML::script('js/time-conversion.js')}}
- @stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3a69012f/app/views/resource/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/browse.blade.php b/app/views/resource/browse.blade.php
index d163490..e0526e1 100644
--- a/app/views/resource/browse.blade.php
+++ b/app/views/resource/browse.blade.php
@@ -6,7 +6,7 @@
@section('content')
-<div class="container">
+<div class="container" style="max-width: 80%;">
@if( Session::has("message"))
<div class="col-md-12">
<span class="alert alert-success">{{ Session::get("message") }}</span>
@@ -20,13 +20,20 @@
Resource" to
register a new resources.') }}
@else
+ <br/>
<div class="col-md-12">
- <div class="row">
- <div class="col-md-6">
- <h3 style="margin:0;">Existing Compute Resources :</h3>
+ <div class="panel panel-default form-inline">
+ <div class="panel-heading">
+ <h3 style="margin:0;">Search Compute Resources</h3>
+ </div>
+ <div class="panel-body">
+ <div class="form-group search-text-block">
+ <label>Compute Resource Name </label>
+ <input type="search" class="form-control filterinput"/>
+ </div>
</div>
- <input type="text" class="pull-right filterinput col-md-6" placeholder="Search by Compute Resource Name"/>
</div>
+
<div class="row">
<div class="table-responsive">
<table class="table">