Skip to content

Commit

Permalink
trying out audio_recordings/filter
Browse files Browse the repository at this point in the history
  • Loading branch information
cofiem committed Sep 5, 2014
1 parent 212db33 commit 7f6d633
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
<li>{{dataPoint}}</li>
</ol>

<div id="audioRecordingCalendar"></div>
<div id="audioRecordingCalendar"></div>

{{filteredAudioRecordings}}
38 changes: 33 additions & 5 deletions src/app/d3Bindings/d3TestPage.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
var bawD3 = bawD3 || angular.module("bawApp.d3", []);
bawD3.controller('D3TestPageCtrl', ['$scope', function($scope) {
bawD3.controller('D3TestPageCtrl', ['$scope', 'conf.paths', '$http', function ($scope, paths, $http) {

// use the REST API in here
// assign the resulting data to scope (not great but it will do for now
$scope.basicData = [0,1,2,3,4,5];
// use the REST API in here
// assign the resulting data to scope (not great but it will do for now
$scope.basicData = [0, 1, 2, 3, 4, 5];

}]);
$scope.siteId = 399;

var request_filter = {
"filter": {
"site_id":{
"eq":$scope.siteId
}
},
"projection": {
"include": ["id", "recorded_date", "duration_seconds"]
}//,
//"paging":{
// "page":2,
// "items":30
//}
};

$http.post(paths.api.routes.audioRecording.filterAbsolute, request_filter)
.success(function (data, status, headers, config) {

$scope.filteredAudioRecordings = data;
})
.error(function (data, status, headers, config) {
$scope.filteredAudioRecordings = data;
console.warn('Filtered audio recordings failed.', data, status, headers, config);
});


}]);
3 changes: 2 additions & 1 deletion src/baw.configuration.tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ angular.module('bawApp.configuration', ['url'])
audioRecording: {
listShort: "/audio_recordings/{recordingId}",
show: "/audio_recordings/{recordingId}",
list: "/audio_recordings/"
list: "/audio_recordings/",
filter: "/audio_recordings/filter"
},
audioEvent: {
list: "/audio_recordings/{recordingId}/audio_events",
Expand Down

0 comments on commit 7f6d633

Please sign in to comment.