implement item attributes editor AKA volume/copy template editor
authorGalen Charlton <gmc@esilibrary.com>
Fri, 4 Nov 2016 17:17:24 +0000 (13:17 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 22 Nov 2016 19:10:05 +0000 (14:10 -0500)
Add a specialization of the volume/copy editor that is restricted
just to managing volume/copy templates; this can be accessed
at the path /eg/staff/cat/volcopy/edit_templates.  A link is added
to the local administration splash page with the label "Volume/Copy
Template Editor"

In attempt to improve terminology, on the local administration page,
the previous "Copy Template Editor" is now called "Serial Copy Template
Editor".

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/src/templates/staff/admin/local/t_splash.tt2
Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
Open-ILS/src/templates/staff/cat/volcopy/t_view.tt2
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index aba2290..58bc231 100644 (file)
@@ -20,7 +20,6 @@
     ,[ l('Copy Location Groups'), "./admin/local/asset/copy_location_group" ]
     ,[ l('Copy Location Order'), "./admin/local/asset/copy_location_order" ]
     ,[ l('Copy Locations Editor'), "./admin/local/asset/copy_locations" ]
-    ,[ l('Copy Template Editor'), "./admin/local/asset/copy_template" ]
     ,[ l('Field Documentation'), "./admin/local/config/idl_field_doc" ]
     ,[ l('Group Penalty Thresholds'), "./admin/local/permission/grp_penalty_threshold" ]
     ,[ l('Hold Policies'), "./admin/local/config/hold_matrix_matchpoint" ]
     ,[ l('Notifications / Action Triggers'), "./admin/local/action_trigger/event_definition" ]
     ,[ l('Patrons with Negative Balances'), "./admin/local/circ/neg_balance_users" ]
     ,[ l('Search Filter Groups'), "./admin/local/actor/search_filter_group" ]
+    ,[ l('Serial Copy Template Editor'), "./admin/local/asset/copy_template" ]
     ,[ l('Standing Penalties'), "./admin/local/config/standing_penalty" ]
     ,[ l('Statistical Categories Editor'), "./admin/local/asset/stat_cat_editor" ]
     ,[ l('Statistical Popularity Badges'), "./admin/local/rating/badge" ]
     ,[ l('Surveys'), "./admin/local/action/survey" ]
     ,[ l('Transit List'), "./circ/transits/list" ]
+    ,[ l('Volume/Copy Template Editor'), "./cat/volcopy/edit_templates" ]
     ,[ l('Work Log'), "./admin/workstation/log" ]
    ];
 
index 38dde8f..f17be86 100644 (file)
@@ -6,7 +6,7 @@
         <div class="col-md-2">
             <eg-basic-combo-box list="template_name_list" selected="template_name"></eg-basic-combo-box>
         </div>
-        <div class="col-md-1">
+        <div class="col-md-1" ng-if="!editTemplates">
             <button class="btn btn-default " ng-click="applyTemplate(template_name)" type="button">[% l('Apply') %]</button>
         </div>
         <div class="col-md-6">
index 1cfa4e0..38ebb53 100644 (file)
@@ -7,12 +7,12 @@ eg-navbar {
 }
 </style>
 
-<eg-record-summary ng-if="!embedded && record_id"
+<eg-record-summary ng-if="!embedded && !edit_templates && record_id"
      record-id="record_id" record="summaryRecord"></eg-record-summary>
 
 <!-- tabbed copy data view -->
 
-<ul class="nav nav-tabs" ng-show="!embedded">
+<ul class="nav nav-tabs" ng-show="!embedded" ng-if="!edit_templates">
   <li ng-class="{active : tab == 'edit'}">
     <a ng-click="tab = 'edit'" >[% l('Edit') %]</a>
   </li>
@@ -24,7 +24,7 @@ eg-navbar {
   </li>
 </ul>
 
-<div class="tab-content">
+<div class="tab-content" ng-if="!edit_templates">
   <div class="tab-pane active">
     <div ng-show="tab == 'edit'">
       <div ng-include="'[% ctx.base_path %]/staff/cat/volcopy/t_edit'"></div>
@@ -38,3 +38,11 @@ eg-navbar {
   </div>
 </div>
 
+<div ng-if="edit_templates">
+  <div class="row">
+    <h2>[% l("Edit Volume/Copy Templates") %]</h2>
+  </div>
+  <div class="row">
+    <eg-vol-template edit-templates="edit_templates"></eg-vol-template>
+  </div>
+</div>
index 0b109da..79b568a 100644 (file)
@@ -19,6 +19,12 @@ angular.module('egVolCopy',
         delay : ['egStartup', function(egStartup) { return egStartup.go(); }]
     };
 
+    $routeProvider.when('/cat/volcopy/edit_templates', {
+        templateUrl: './cat/volcopy/t_view',
+        controller: 'EditCtrl',
+        resolve : resolver
+    });
+
     $routeProvider.when('/cat/volcopy/:dataKey', {
         templateUrl: './cat/volcopy/t_view',
         controller: 'EditCtrl',
@@ -783,6 +789,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
     };
 
     $scope.embedded = ($routeParams.mode && $routeParams.mode == 'embedded') ? true : false;
+    $scope.edit_templates = ($location.path().match(/edit_template/)) ? true : false;
 
     $scope.saveDefaults = function () {
         egCore.hatch.setItem('cat.copy.defaults', $scope.defaults);
@@ -973,7 +980,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
     var dataKey = $routeParams.dataKey;
     console.debug('dataKey: ' + dataKey);
 
-    if (dataKey && dataKey.length > 0) {
+    if ((dataKey && dataKey.length > 0) || $scope.edit_templates) {
 
         $scope.templates = {};
         $scope.template_name = '';
@@ -1594,7 +1601,9 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
         restrict: 'E',
         replace: true,
         template: '<div ng-include="'+"'/eg/staff/cat/volcopy/t_attr_edit'"+'"></div>',
-        scope: { },
+        scope: {
+            editTemplates: '=',
+        },
         controller : ['$scope','$window','itemSvc','egCore',
             function ( $scope , $window , itemSvc , egCore ) {