From: Galen Charlton Date: Tue, 25 Apr 2017 21:29:06 +0000 (-0400) Subject: webstaff: add subscription selector to prediction manager X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c2e4fd7538670c03c83a38c91aaa2cf190168ceb;p=working%2FEvergreen.git webstaff: add subscription selector to prediction manager This also implement updating the browser URL when a different subscription is chosen. Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/templates/staff/serials/t_manage.tt2 b/Open-ILS/src/templates/staff/serials/t_manage.tt2 index 8e68b2a9dd..38758d0717 100644 --- a/Open-ILS/src/templates/staff/serials/t_manage.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_manage.tt2 @@ -13,7 +13,7 @@ + bib-id="bib_id" ssub-id="ssub.id"> diff --git a/Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2 b/Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2 index a84341d466..49b863f502 100644 --- a/Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2 @@ -1,3 +1,3 @@
-Here will reside prediction pattern management stuff. +
diff --git a/Open-ILS/web/js/ui/default/staff/serials/app.js b/Open-ILS/web/js/ui/default/staff/serials/app.js index 7cd7a34d8a..66e286dd31 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/app.js +++ b/Open-ILS/web/js/ui/default/staff/serials/app.js @@ -39,16 +39,23 @@ angular.module('egSerialsApp') function($scope , $routeParams , $location , egSerialsCoreSvc) { $scope.bib_id = $routeParams.bib_id; $scope.active_tab = $routeParams.active_tab ? $routeParams.active_tab : 'manage-subscriptions'; - $scope.ssub_id = null; + $scope.ssub = {id : null}; if ($routeParams.subscription_id) { egSerialsCoreSvc.verify_subscription_id($scope.bib_id, $routeParams.subscription_id) .then(function(verified) { if (verified) { - $scope.ssub_id = $routeParams.subscription_id; + $scope.ssub.id = $routeParams.subscription_id; } else { // subscription ID is no good, so drop it from the URL $location.path('/serials/' + $scope.bib_id + '/' + $scope.active_tab); } }); + $scope.$watch('ssub.id', function(newVal, oldVal) { +console.debug('changed?'); + if (oldVal != newVal) { + $location.path('/serials/' + $scope.bib_id + '/' + $scope.active_tab + + '/' + $scope.ssub.id); + } + }); } }])