climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skhud...@apache.org
Subject svn commit: r1513257 - in /incubator/climate/trunk/rcmet/src/main/ui/app: js/controllers/DatasetSelectCtrl.js partials/selectObservation.html partials/selectRcmed.html
Date Mon, 12 Aug 2013 21:25:25 GMT
Author: skhudiky
Date: Mon Aug 12 21:25:25 2013
New Revision: 1513257

URL: http://svn.apache.org/r1513257
Log:
CLIMATE-251 - Fix dataset selector pop up

Modified:
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetSelectCtrl.js
    incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectObservation.html
    incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectRcmed.html

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetSelectCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetSelectCtrl.js?rev=1513257&r1=1513256&r2=1513257&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetSelectCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetSelectCtrl.js Mon
Aug 12 21:25:25 2013
@@ -20,11 +20,36 @@
 // Controller for dataset selection/modification
 App.Controllers.controller('DatasetSelectCtrl', ['$scope', 'selectedDatasetInformation',
 function($scope, selectedDatasetInformation) {
-	$scope.shouldDisableClearButton = function() {
-		return (selectedDatasetInformation.getDatasetCount() == 0);
-	}
-
-	$scope.clearDatasets = function() {
-		selectedDatasetInformation.clearDatasets();
-	}
+
+    // Grab a copy of the datasets so we can display a count to the user!
+    $scope.datasetCount = selectedDatasetInformation.getDatasets();
+
+    $scope.shouldDisableClearButton = function() {
+      return (selectedDatasetInformation.getDatasetCount() == 0);
+    }
+
+    $scope.clearDatasets = function() {
+      selectedDatasetInformation.clearDatasets();
+    }
+
+    $scope.open = function () {
+      $scope.datasetSelect = true;
+    }
+
+    $scope.close = function () {
+      $scope.datasetSelect = false;
+    }
+
+    $scope.opts = {
+      backdropFade: true,
+      dialogFade:true
+    };
+
+    $scope.templates =
+      [ { title:'Local File', url: 'partials/selectObservation.html'}
+      , { title:'RCMED', url: 'partials/selectRcmed.html'}
+      , { title:'ESG', disabled: true } ];
+
+    $scope.template = $scope.templates[0];
+
 }]);

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectObservation.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectObservation.html?rev=1513257&r1=1513256&r2=1513257&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectObservation.html (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectObservation.html Mon Aug
12 21:25:25 2013
@@ -17,47 +17,42 @@
  ~ under the License.
 -->
 
-<ul class="nav nav-pills">
-	<li class="active"><a href="#/obs">Local File</a></li>
-	<li><a href="#/rcmed">RCMED</a></li>
-	<li class="disabled"><a href="#/esg">ESG</a></li>
-  <li class="pull-right">Queued Datasets: {{datasetCount.length}}</li>
-</ul>
+<div ng-controller="ObservationSelectCtrl">
+  <form class="form-inline" autocomplete="off">
+    <input id="observationFileInput" predictive-file-browser-input ng-model="filePathInput"
type="text" class="input-xlarge" autocomplete="off" />
+    <button class="btn" ng-click="uploadLocalFile()" ng-disabled="shouldDisableLoadButton()">
+      <div ng-hide="loadingFile">Parse File</div>
+      <div ng-show="loadingFile"><i class="icon-spinner icon-spin"></i></div>
+    </button>
+  </form>
 
-<form class="form-inline" autocomplete="off">
-	<input id="observationFileInput" predictive-file-browser-input ng-model="filePathInput"
type="text" class="input-xlarge" autocomplete="off" />
-	<button class="btn" ng-click="uploadLocalFile()" ng-disabled="shouldDisableLoadButton()">
-    <div ng-hide="loadingFile">Parse File</div>
-    <div ng-show="loadingFile"><i class="icon-spinner icon-spin"></i></div>
-  </button>
-</form>
+  <div class="row">
+    <div class="span2 text-center">
+      Evaluation Variable
+    </div>
+    <div class="span3">
+      <select ng-model="paramSelect" ng-options="param for param in params"></select>
+    </div>
+    <div class="span2 text-center">
+      Latitude Variable
+    </div>
+    <div class="span3">
+      <select ng-model="latsSelect" ng-options="lat for lat in lats"></select>
+    </div>
+    <div class="span2 text-center">
+      Longitude Variable
+    </div>
+    <div class="span3">
+      <select ng-model="lonsSelect" ng-options="lon for lon in lons"></select>
+    </div>
+    <div class="span2 text-center">
+      Date/Time Variable
+    </div>
+    <div class="span3">
+      <select ng-model="timeSelect" ng-options="time for time in times"></select>
+    </div>
+  </div>
 
-<div class="row">
-	<div class="span2 text-center">
-    Evaluation Variable
-	</div>
-	<div class="span3">
-    <select ng-model="paramSelect" ng-options="param for param in params"></select>
-	</div>
-	<div class="span2 text-center">
-		Latitude Variable
-	</div>
-	<div class="span3">
-    <select ng-model="latsSelect" ng-options="lat for lat in lats"></select>
-	</div>
-	<div class="span2 text-center">
-		Longitude Variable
-	</div>
-	<div class="span3">
-    <select ng-model="lonsSelect" ng-options="lon for lon in lons"></select>
-	</div>
-	<div class="span2 text-center">
-		Date/Time Variable
-	</div>
-	<div class="span3">
-    <select ng-model="timeSelect" ng-options="time for time in times"></select>
-	</div>
-</div>
-
-<button class="btn pull-left" ng-click="addDataSet()">Add Dataset</button>
-<div class="pull-left small-alert" ng-show="fileAdded">Successfully added dataset...</div>
+  <button class="btn pull-left" ng-click="addDataSet()">Add Dataset</button>
+  <div class="pull-left small-alert" ng-show="fileAdded">Successfully added dataset...</div>
+</div>
\ No newline at end of file

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectRcmed.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectRcmed.html?rev=1513257&r1=1513256&r2=1513257&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectRcmed.html (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/partials/selectRcmed.html Mon Aug 12 21:25:25
2013
@@ -17,33 +17,28 @@
  ~ under the License.
 -->
 
-<ul class="nav nav-pills">
-	<li><a href="#/obs">Local File</a></li>
-	<li class="active"><a href="#/rcmed">RCMED</a></li>
-	<li class="disabled"><a href="#/esg">ESG</a></li>
-  <li class="pull-right">Queued Datasets: {{datasetCount.length}}</li>
-</ul>
+<div ng-controller="RcmedSelectionCtrl">
+  <div class="row">
+    <div class="span5">
+    Select the RCMED dataset that you would like use.
+    </div>
+  </div>
+  <div class="row">
+    <div class="span4">
+      <select ng-change="dataSelectUpdated()" class="span5" ng-model="datasetSelection"
ng-options="obs as obs.longname for obs in availableObs"></select>
+    </div>
+  </div>
+  <div class="row">
+    <div class="span5">
+    Select the dataset parameter that you would like to test.
+    </div>
+  </div>
+  <div class="row">
+    <div class="span4">
+      <select class="span3" ng-model="parameterSelection" ng-options="param as param.shortname
for param in retrievedObsParams"></select>
+    </div>
+  </div>
 
-<div class="row">
-	<div class="span5">
-		Select the RCMED dataset that you would like use.
-	</div>
-</div>
-<div class="row">
-	<div class="span4">
-		<select ng-change="dataSelectUpdated()" class="span5" ng-model="datasetSelection" ng-options="obs
as obs.longname for obs in availableObs"></select>
-	</div>
-</div>
-<div class="row">
-	<div class="span5">
-		Select the dataset parameter that you would like to test.
-	</div>
-</div>
-<div class="row">
-	<div class="span4">
-		<select class="span3" ng-model="parameterSelection" ng-options="param as param.shortname
for param in retrievedObsParams"></select>
-	</div>
-</div>
-
-<button class="btn pull-left" ng-click="addObservation()">Add Observation</button>
-<div class="pull-left small-alert" ng-show="fileAdded">Successfully added dataset...</div>
+  <button class="btn pull-left" ng-click="addObservation()">Add Observation</button>
+  <div class="pull-left small-alert" ng-show="fileAdded">Successfully added dataset...</div>
+</div>
\ No newline at end of file



Mime
View raw message