climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omk...@apache.org
Subject [1/2] climate git commit: CLIMATE-379 - Allows dataset customisation
Date Thu, 28 Jan 2016 18:05:45 GMT
Repository: climate
Updated Branches:
  refs/heads/master a9dab5b49 -> 474302106


CLIMATE-379 - Allows dataset customisation


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/aa9f832f
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/aa9f832f
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/aa9f832f

Branch: refs/heads/master
Commit: aa9f832f8828ee6addb2b14e3bec20a86911344f
Parents: 67189a7
Author: Omkar20895 <omkar@Omkars-MacBook-Pro.local>
Authored: Wed Jan 20 19:26:59 2016 +0530
Committer: Omkar20895 <omkar@Omkars-MacBook-Pro.local>
Committed: Wed Jan 20 19:26:59 2016 +0530

----------------------------------------------------------------------
 .../frontend/app/scripts/controllers/observationselect.js | 10 ++++++++--
 ocw-ui/frontend/app/views/selectobservation.html          |  8 ++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/aa9f832f/ocw-ui/frontend/app/scripts/controllers/observationselect.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend/app/scripts/controllers/observationselect.js b/ocw-ui/frontend/app/scripts/controllers/observationselect.js
index 024b567..39d66b4 100644
--- a/ocw-ui/frontend/app/scripts/controllers/observationselect.js
+++ b/ocw-ui/frontend/app/scripts/controllers/observationselect.js
@@ -152,6 +152,7 @@ angular.module('ocwUiApp')
 
       var newDataset = {};
       var input = $('#observationFileInput').val();
+      var name = $('#customDatasetName').val();
 
       // If the backend is limiting directory access we need to add that leader to our path
       // so it remains valid!
@@ -163,8 +164,13 @@ angular.module('ocwUiApp')
       // Save the model path. Note that the path is effectively the "id" for the model.
       newDataset['id'] = input;
       // Grab the file name later for display purposes.
-      var splitFilePath = input.split('/');
-      newDataset['name'] = splitFilePath[splitFilePath.length - 1];
+      if(name == ""){
+        var splitFilePath = input.split('/');
+        newDataset['name'] = splitFilePath[splitFilePath.length - 1];  
+      }
+      else{
+        newDataset['name'] = name;
+      }
       // Save the model parameter variable. We save it twice for consistency and display
convenience.
       newDataset['param'] = $scope.paramSelect;
       newDataset['paramName'] = newDataset['param'];

http://git-wip-us.apache.org/repos/asf/climate/blob/aa9f832f/ocw-ui/frontend/app/views/selectobservation.html
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend/app/views/selectobservation.html b/ocw-ui/frontend/app/views/selectobservation.html
index 96a8054..3a93ab3 100644
--- a/ocw-ui/frontend/app/views/selectobservation.html
+++ b/ocw-ui/frontend/app/views/selectobservation.html
@@ -69,6 +69,14 @@ under the License.
           <select class="form-control" ng-model="timeSelect" ng-options="time for time
in times"></select>
         </div>
       </div>
+      <div class="row top3">
+        <div class="col-md-5 text-center">
+          Custom Dataset Name
+        </div>
+        <div class="col-md-6">
+          <input id ="customDatasetName" placeHolder="This field is optional..." type="text"
predictive-file-browser-input/>
+        </div>
+      </div>
     </div>
   </div>
   <div class="row top3">


Mime
View raw message