Merge branch 'feature/mlpma-classifier'

This commit is contained in:
Josef Citrine 2016-08-29 00:12:12 +01:00
commit 727a83d95b
5 changed files with 11 additions and 12 deletions

View file

@ -9,10 +9,10 @@
"packages": {}, "packages": {},
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"angular": "1.5.6", "angular": "1.5.8",
"angular-chart.js": "1.0.0-alpha6", "angular-chart.js": "1.0.0-alpha6",
"angular-strap": "2.3.8", "angular-strap": "2.3.8",
"angular-ui-router": "0.2.18", "angular-ui-router": "0.3.1",
"chart.js": "2.1.0", "chart.js": "2.1.0",
"coffee-loader": "0.7.2", "coffee-loader": "0.7.2",
"coffee-script": "1.10.0", "coffee-script": "1.10.0",
@ -31,8 +31,7 @@
"gulp-plumber": "1.1.0", "gulp-plumber": "1.1.0",
"gulp-sourcemaps": "1.6.0", "gulp-sourcemaps": "1.6.0",
"gulp-util": "3.0.7", "gulp-util": "3.0.7",
"jquery": "2.2.0", "jquery": "2.2.4",
"jquery-ui": "1.10.5",
"script-loader": "0.7.0", "script-loader": "0.7.0",
"underscore": "1.8.3", "underscore": "1.8.3",
"webpack": "1.13.1", "webpack": "1.13.1",

View file

@ -279,12 +279,12 @@ ponyfm.config [
templateUrl: '/templates/admin/show-songs.html' templateUrl: '/templates/admin/show-songs.html'
state.state 'admin.tracks', state.state 'admin.tracks',
url: '/tracks' url: '/tracks?filter&page'
controller: 'admin-tracks' controller: 'admin-tracks'
templateUrl: '/templates/admin/tracks.html' templateUrl: '/templates/admin/tracks.html'
state.state 'admin.classifier', state.state 'admin.classifier',
url: '/tracks/unclassified' url: '/tracks/unclassified?filter&page'
controller: 'admin-classifier' controller: 'admin-classifier'
templateUrl: '/templates/admin/classifier.html' templateUrl: '/templates/admin/classifier.html'

View file

@ -21,6 +21,7 @@ window.pfm.preloaders['admin-classifier'] = [
tracks.mainQuery.fromFilterString($state.params.filter) tracks.mainQuery.fromFilterString($state.params.filter)
tracks.mainQuery.setPage $state.params.page || 1 tracks.mainQuery.setPage $state.params.page || 1
tracks.mainQuery.setAdmin true tracks.mainQuery.setAdmin true
tracks.mainQuery.fetch(tracks.FetchType.UNCLASSIFIED)
) )
] ]
@ -28,5 +29,4 @@ module.exports = angular.module('ponyfm').controller "admin-classifier", [
'$scope', 'tracks', '$state', '$scope', 'tracks', '$state',
($scope, tracks, $state) -> ($scope, tracks, $state) ->
] ]

View file

@ -21,12 +21,11 @@ window.pfm.preloaders['admin-tracks'] = [
tracks.mainQuery.fromFilterString($state.params.filter) tracks.mainQuery.fromFilterString($state.params.filter)
tracks.mainQuery.setPage $state.params.page || 1 tracks.mainQuery.setPage $state.params.page || 1
tracks.mainQuery.setAdmin true tracks.mainQuery.setAdmin true
tracks.mainQuery.fetch(tracks.FetchType.ALL)
) )
] ]
module.exports = angular.module('ponyfm').controller "admin-tracks", [ module.exports = angular.module('ponyfm').controller "admin-tracks", [
'$scope', 'tracks', '$state', '$scope', 'tracks', '$state',
($scope, tracks, $state) -> ($scope, tracks, $state) ->
] ]

View file

@ -23,8 +23,8 @@ module.exports = angular.module('ponyfm').directive 'pfmPagedTracksList', () ->
class: '@class' class: '@class'
controller: [ controller: [
'$scope', 'tracks', '$state', '$scope', 'tracks', '$state', '$location'
($scope, tracks, $state) -> ($scope, tracks, $state, $location) ->
typeEnum = switch typeEnum = switch
when $scope.type == 'normal' then tracks.FetchType.NORMAL when $scope.type == 'normal' then tracks.FetchType.NORMAL
when $scope.type == 'all' then tracks.FetchType.ALL when $scope.type == 'all' then tracks.FetchType.ALL
@ -61,7 +61,8 @@ module.exports = angular.module('ponyfm').directive 'pfmPagedTracksList', () ->
$scope.pageSelectorShown = false $scope.pageSelectorShown = false
$scope.gotoPage = (page) -> $scope.gotoPage = (page) ->
$state.transitionTo $state.current.name, {filter: $state.params.filter, page: page} #$scope.$emit 'pageChange', {filter: $state.params.filter, page: page}
$state.go '.', {filter: $state.params.filter, page: page}
$scope.showPageSelector = () -> $scope.showPageSelector = () ->
$scope.pageSelectorShown = true $scope.pageSelectorShown = true