webstaff: toast on volume/copy template save and delete
authorGalen Charlton <gmc@esilibrary.com>
Tue, 15 Nov 2016 22:14:54 +0000 (17:14 -0500)
committerKathy Lussier <klussier@masslnc.org>
Tue, 22 Nov 2016 19:10:05 +0000 (14:10 -0500)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/cat/volcopy/index.tt2
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 132e21a..97996b7 100644 (file)
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/services/eframe.js"></script>
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/volcopy/app.js"></script>
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/services/record.js"></script>
+<script>
+angular.module('egCoreMod').run(['egStrings', function(s) {
+    s.VOL_COPY_TEMPLATE_SUCCESS_SAVE = "[% l('Saved volume/copy template(s)') %]";
+    s.VOL_COPY_TEMPLATE_SUCCESS_DELETE = "[% l('Deleted volume/copy template') %]";
+}]);
+</script>
 [% END %]
 
 <style>
index 79b568a..2f423de 100644 (file)
@@ -11,6 +11,13 @@ angular.module('egVolCopy',
     }
 })
 
+.config(['ngToastProvider', function(ngToastProvider) {
+  ngToastProvider.configure({
+    verticalPosition: 'bottom',
+    animation: 'fade'
+  });
+}])
+
 .config(function($routeProvider, $locationProvider, $compileProvider) {
     $locationProvider.html5Mode(true);
     $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); // grid export
@@ -1604,8 +1611,8 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
         scope: {
             editTemplates: '=',
         },
-        controller : ['$scope','$window','itemSvc','egCore',
-            function ( $scope , $window , itemSvc , egCore ) {
+        controller : ['$scope','$window','itemSvc','egCore','ngToast',
+            function ( $scope , $window , itemSvc , egCore , ngToast) {
 
                 $scope.defaults = { // If defaults are not set at all, allow everything
                     barcode_checkdigit : false,
@@ -1704,6 +1711,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                         $scope.template_name = '';
                         egCore.hatch.setItem('cat.copy.templates', $scope.templates);
                         $scope.$parent.fetchTemplates();
+                        ngToast.create(egCore.strings.VOL_COPY_TEMPLATE_SUCCESS_DELETE);
                     }
                 }
 
@@ -1732,6 +1740,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                         egCore.hatch.setItem('cat.copy.templates', $scope.templates);
                         $scope.$parent.fetchTemplates();
                     }
+                    ngToast.create(egCore.strings.VOL_COPY_TEMPLATE_SUCCESS_SAVE);
                 }
             
                 $scope.templates = {};