webstaff: teach side-by-side editing to the record merge interface
authorGalen Charlton <gmc@esilibrary.com>
Tue, 6 Oct 2015 18:26:30 +0000 (18:26 +0000)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:49 +0000 (14:58 -0500)
It is now possible to edit the lead record in place (in
flat editor mode).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/cat/bucket/record/t_merge_records.tt2
Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

index 7efdcbc..53821f8 100644 (file)
@@ -9,8 +9,13 @@
           <div class="col-xs-6">
             <h4>[% l('Lead record') %]</h4>
             <div ng-if="lead_id">
-               <button class="btn btn-default btn-sm" ng-click="edit_lead()">[% l('Edit') %]</button>
-               <eg-record-breaker record-id="lead_id"></eg-record-breaker>
+               <button class="btn btn-default btn-sm" ng-class="{disabled : editing_inplace}" ng-click="edit_lead_inplace()">[% l('Edit') %]</button>
+               <button class="btn btn-default btn-sm" ng-class="{disabled : editing_inplace}" ng-click="edit_lead()">[% l('Edit using full editor') %]</button>
+               <eg-marc-edit-record dirty-flag="dirty_flag" record-id="lead_id"
+                         record-type="bre" flat-only="true" embedded="true" 
+                         ng-if="editing_inplace" on-save="post_edit_inplace">
+               </eg-marc-edit-record>
+               <eg-record-breaker record-id="lead_id" ng-if="!editing_inplace"></eg-record-breaker>
                <eg-volume-list record-id="lead_id"></eg-volume-list>
             </div>
             <div ng-if="!lead_id">
index de620f0..7ace380 100644 (file)
@@ -550,6 +550,7 @@ function($scope,  $q , $routeParams,  bucketSvc,  egCore,  $window,
                 ['$scope', '$modalInstance', function($scope, $modalInstance) {
                 $scope.records = [];
                 $scope.lead_id = 0;
+                $scope.editing_inplace = false;
                 angular.forEach(records, function(rec) {
                     $scope.records.push({ id : rec.id });
                 });
@@ -574,6 +575,12 @@ function($scope,  $q , $routeParams,  bucketSvc,  egCore,  $window,
                         }
                     });
                 }
+                $scope.post_edit_inplace = function() {
+                    $scope.editing_inplace = false;
+                }
+                $scope.edit_lead_inplace = function() {
+                    $scope.editing_inplace = true;
+                }
                 $scope.edit_lead = function() {
                     var lead_id = $scope.lead_id;
                     $modal.open({
@@ -588,7 +595,7 @@ function($scope,  $q , $routeParams,  bucketSvc,  egCore,  $window,
                             $scope.cancel = function () { $modalInstance.dismiss() }
                         }]
                     }).result.then(function() {
-                        // TODO: need a way to force a refresh of the egRecordHtml, as
+                        // TODO: need a way to force a refresh of the egRecordBreaker, as
                         // the record ID does not change
                     });
                 };